:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --text: #18222b;
  --muted: #60707d;
  --line: #d6dee4;
  --line-strong: #b8c5ce;
  --primary: #075985;
  --primary-dark: #064669;
  --primary-soft: #e0f2fe;
  --success: #166534;
  --success-soft: #dcfce7;
  --warning: #854d0e;
  --warning-soft: #fef3c7;
  --danger: #b42318;
  --danger-dark: #8f1c14;
  --danger-soft: #fee4e2;
  --focus: #f59e0b;
  --shadow: 0 1px 3px rgb(15 23 42 / 8%), 0 10px 30px rgb(15 23 42 / 5%);
  --radius: 10px;
  --document-control-height: calc(.76rem * 1.4 + .4rem);
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--primary-dark);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  transform: translateY(-180%);
}

.skip-link:focus {
  color: #fff;
  transform: translateY(0);
}

.app-header {
  border-bottom: 1px solid #133d57;
  background: #073b5c;
  color: #fff;
}

.app-header__inner {
  display: flex;
  min-height: 64px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.module-menu {
  position: relative;
  flex: 0 0 auto;
}

.module-notification-host {
  position: relative;
  margin-right: 24px;
}

.ebanking-notification {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #ef4444;
}

.ebanking-notification[hidden] {
  display: none;
}

.ebanking-notification--header {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
}

.module-menu__trigger {
  display: flex;
  min-height: 44px;
  padding: 0.3rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  cursor: pointer;
  list-style: none;
}

.module-menu__trigger::-webkit-details-marker {
  display: none;
}

.module-menu__trigger:hover,
.module-menu[open] > .module-menu__trigger {
  border-color: rgb(255 255 255 / 30%);
  background: rgb(255 255 255 / 7%);
}

.module-menu__identity,
.module-menu__option-copy {
  display: grid;
  gap: 0.1rem;
  line-height: 1.3;
}

.module-menu__identity strong {
  font-size: 1.1rem;
}

.module-menu__identity small {
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.module-menu__chevron,
.module-menu__check {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-menu__chevron {
  transition: transform 120ms ease;
}

.module-menu[open] .module-menu__chevron {
  transform: rotate(180deg);
}

.module-menu__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 65;
  width: min(21rem, calc(100vw - 1.5rem));
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 42px rgb(15 23 42 / 24%);
}

.module-menu__heading {
  display: block;
  padding: 0.6rem 0.7rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.module-menu__option {
  display: flex;
  min-height: 65px;
  padding: 0.75rem;
  border-radius: 7px;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
}

.module-menu__option:hover,
.module-menu__option:focus-visible,
.module-menu__option.is-current {
  background: var(--surface-muted);
  color: var(--text);
}

.module-menu__option-copy {
  flex: 1 1 auto;
}

.module-menu__option-copy strong {
  font-size: 0.95rem;
}

.module-menu__option-copy small {
  color: var(--muted);
  font-size: 0.72rem;
}

.module-menu__mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.module-menu__mark--sef {
  background: #075985;
}

.module-menu__mark--measurements {
  background: #17674f;
}

.module-menu__mark svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-menu__trigger .module-menu__mark {
  background: rgb(255 255 255 / 10%);
}

.app-header__actions {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.company-menu {
  position: relative;
  min-width: 0;
  flex: 0 1 auto;
  font-size: 0.92rem;
}

.company-menu__trigger {
  display: flex;
  min-width: 0;
  min-height: 44px;
  padding: 0.4rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #fff;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.company-menu__trigger::-webkit-details-marker {
  display: none;
}

.company-menu__trigger:hover,
.company-menu__trigger:focus-visible,
.company-menu[open] > .company-menu__trigger {
  border-color: rgb(255 255 255 / 32%);
  background: rgb(255 255 255 / 7%);
}

.company-menu__trigger--static {
  cursor: default;
  text-decoration: none;
}

.company-menu__trigger--static:hover {
  border-color: transparent;
  background: transparent;
}

.company-menu__icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
}

.company-menu__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.company-menu__trigger-copy {
  display: block;
  min-width: 0;
  line-height: 1.2;
}

.company-menu__trigger-copy > strong {
  max-width: 13rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-menu__trigger-copy > strong {
  font-size: 0.9rem;
  font-weight: 650;
}

.company-menu__chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 120ms ease;
}

.company-menu[open] .company-menu__chevron {
  transform: rotate(180deg);
}

.company-menu__panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(14rem, calc(100vw - 1.5rem));
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgb(15 23 42 / 24%);
  color: var(--text);
}

.company-menu__heading {
  display: block;
  margin: 0 0.35rem;
  padding: 0.45rem;
  font-size: 0.8rem;
}

.company-menu__option {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  line-height: 1.25;
  text-decoration: none;
}

.company-menu__option:hover,
.company-menu__option:focus-visible,
.company-menu__option.is-current {
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-decoration: none;
}

.company-menu__option > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-menu__option svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.company-menu__option .company-menu__firm-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  stroke-width: 1.7;
}

.company-menu__option .company-menu__current-check {
  margin-left: auto;
}

.account-nav {
  position: relative;
  flex: 0 0 auto;
  font-size: 0.92rem;
}

.account-menu {
  position: relative;
}

.account-menu__trigger {
  display: flex;
  min-width: 0;
  min-height: 44px;
  padding: 0.4rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #fff;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.account-menu__trigger::-webkit-details-marker {
  display: none;
}

.account-menu__trigger:hover,
.account-menu__trigger:focus-visible,
.account-menu[open] > .account-menu__trigger {
  border-color: rgb(255 255 255 / 32%);
  background: rgb(255 255 255 / 7%);
}

.account-menu__avatar {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
}

.account-menu__avatar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.account-menu__trigger-identity {
  display: block;
  min-width: 0;
  line-height: 1.2;
}

.account-menu__trigger-identity strong {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__trigger-identity strong {
  font-size: 0.9rem;
  font-weight: 650;
}

.account-menu__chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 120ms ease;
}

.account-menu[open] .account-menu__chevron {
  transform: rotate(180deg);
}

.account-menu__panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(19rem, calc(100vw - 1.5rem));
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgb(15 23 42 / 24%);
  color: var(--text);
}

.account-menu__profile {
  display: grid;
  min-width: 0;
  margin: 0 0.35rem 0.35rem;
  padding: 0.55rem 0.45rem 0.8rem;
  border-bottom: 1px solid var(--line);
  line-height: 1.25;
}

.account-menu__profile strong,
.account-menu__profile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__profile strong {
  font-size: 0.92rem;
}

.account-menu__profile span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.account-menu__action,
.account-menu__version {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 6px;
  align-items: center;
  gap: 0.65rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
}

.account-menu__action {
  cursor: pointer;
}

.account-menu__action:hover,
.account-menu__action:focus-visible {
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-decoration: none;
}

.account-menu__action svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.account-menu__version {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8rem;
}

.account-menu__version strong {
  color: #3e4e5a;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.account-menu__logout {
  margin: 0.25rem 0 0;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}

.theme-toggle__state {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.theme-toggle__moon,
:root[data-theme="dark"] .theme-toggle__sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__moon {
  display: block;
}

.page-shell {
  flex: 1 0 auto;
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.page-heading {
  display: flex;
  margin-bottom: 1.25rem;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.detail-navigation { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.detail-navigation__context { min-width: 0; margin: 0; color: var(--text); font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.detail-back { display: inline-flex; flex: 0 0 44px; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-muted); color: var(--muted); text-decoration: none; }
.detail-back:hover { background: var(--surface); color: var(--primary); text-decoration: none; }
.detail-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.detail-navigation__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .65rem; margin-left: auto; min-width: 0; }
.results-card.record-summary { padding: 0; margin-bottom: 1.25rem; }
.record-summary__table { min-width: 540px; }
.record-summary__table td { overflow-wrap: anywhere; }

.page-heading h1,
.auth-card h1,
.form-card h1,
.error-card h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  line-height: 1.15;
}

.page-heading p,
.section-heading p,
.auth-card__heading p,
.document-item p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.35rem !important;
  color: var(--primary) !important;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.filter-card,
.filter-info-card,
.results-card,
.detail-card,
.form-card,
.auth-card,
.xml-card,
.user-card,
.error-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filter-card,
.form-card,
.detail-card {
  padding: 1.25rem;
}

.filter-card {
  margin-bottom: 1.25rem;
}

/* Search and contextual information share the SEF card and field geometry. */
.filter-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.filter-workspace > .filter-card { min-width: 0; margin-bottom: 0; }
.filter-info-card { min-width: 0; padding: 1.25rem; }
@media (max-width: 1350px) {
  .filter-workspace { grid-template-columns: minmax(0, 1fr); }
}

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

.section-heading--results {
  align-items: flex-end;
}

.section-heading h2,
.detail-card h2,
.form-card h2,
.users-section h2 {
  margin: 0;
  font-size: 1.18rem;
}

.results-sync-time {
  margin: 0.35rem 0 0 auto !important;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(155px, 0.65fr)) auto;
  align-items: end;
  gap: 0.9rem;
}

.field {
  min-width: 0;
}

label.field > span:first-child,
.field label,
.field legend,
.field > .status-filter__label,
.checkbox-fieldset legend {
  display: block;
  margin-bottom: 0.35rem;
  color: #334451;
  font-size: 0.9rem;
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.search-form input,
.search-form select {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.68rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.search-form input:hover,
.search-form select:hover {
  border-color: #8294a1;
}

.status-filter {
  position: relative;
}

.status-filter__trigger {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.68rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.status-filter__trigger::-webkit-details-marker {
  display: none;
}

.status-filter__trigger::marker {
  content: "";
}

.status-filter__trigger:hover,
.status-filter[open] > .status-filter__trigger {
  border-color: #8294a1;
}

.status-filter__summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-filter__chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  transition: transform 140ms ease;
}

.status-filter[open] .status-filter__chevron {
  transform: rotate(180deg);
}

.status-filter__popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(15 23 42 / 18%);
}

.status-filter__options {
  display: grid;
  justify-items: stretch;
  max-height: 286px;
  margin-top: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.field .status-filter__option {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 36px;
  margin: 0;
  padding: 0.4rem 0.45rem;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  user-select: none;
}

.field .status-filter__option:hover {
  background: var(--surface-muted);
}

.field .status-filter__option > .direction,
.field .status-filter__option > .status-badge {
  width: fit-content;
  justify-self: start;
}

.field .status-filter__option > input,
.search-form .status-filter__option > input {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.status-filter__indicator {
  display: block;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background-color: var(--surface);
  pointer-events: none;
}

.field .status-filter__option > input:checked + .status-filter__indicator {
  border-color: var(--primary);
  background-color: var(--primary);
  background-image: url("/static/filter-check.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
}

.field .status-filter__option > input:focus-visible + .status-filter__indicator {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (forced-colors: active) {
  .status-filter__indicator {
    border-color: ButtonText;
    background-color: Canvas;
    forced-color-adjust: none;
  }

  .field .status-filter__option > input:checked + .status-filter__indicator {
    border-color: Highlight !important;
    background-color: Highlight !important;
    background-image: none !important;
  }

  .field .status-filter__option > input:checked + .status-filter__indicator::after {
    content: "✓";
    display: grid;
    height: 100%;
    place-items: center;
    color: HighlightText;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
  }

  .field .status-filter__option > input:focus-visible + .status-filter__indicator {
    outline-color: Highlight;
  }
}

.date-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.search-form .date-picker__display {
  min-width: 0;
  border-radius: 6px 0 0 6px;
}

.date-picker__button {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.date-picker__button:hover {
  border-color: #8294a1;
  background: var(--surface-muted);
}

.date-picker__button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.date-picker__popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 286px;
  max-width: calc(100vw - 1.5rem);
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(15 23 42 / 18%);
  color: var(--text);
  font-size: 0.875rem;
}

.date-picker__popover[hidden] {
  display: none !important;
}

.date-picker--align-right .date-picker__popover {
  right: 0;
  left: auto;
}

.date-picker__header {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

.date-picker__header strong {
  text-align: center;
  text-transform: capitalize;
}

.date-picker__header button,
.date-picker__footer button,
.date-picker__day {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.date-picker__header button {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
}

.date-picker__header button:hover,
.date-picker__day:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.date-picker__weekdays,
.date-picker__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}

.date-picker__weekdays {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  text-align: center;
}

.date-picker__weekdays span,
.date-picker__day {
  display: inline-flex;
  min-width: 0;
  height: 32px;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.date-picker__day.is-outside-month {
  color: #94a3ad;
}

.date-picker__day:disabled {
  background: transparent;
  box-shadow: none;
  color: #aeb8c0;
  cursor: not-allowed;
  opacity: 0.58;
}

.date-picker__day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1px var(--primary);
  color: var(--primary-dark);
  font-weight: 700;
}

.date-picker__day.is-selected,
.date-picker__day.is-selected:hover {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.date-picker__footer {
  display: flex;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.date-picker__footer button {
  min-height: 32px;
  padding: 0.25rem 0.55rem;
  color: var(--primary);
  font-weight: 650;
}

.date-picker__footer button:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.field__hint,
.help-text {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.search-form__actions,
.button-row,
.document-item__actions,
.badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.search-form__actions {
  display: grid;
  grid-template-columns: repeat(2, 5.75rem);
}

.search-form__actions .button {
  width: 100%;
  min-height: 42px;
  padding-right: 0.65rem;
  padding-left: 0.65rem;
}

.button {
  display: inline-flex;
  min-height: 40px;
  padding: 0.48rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button--primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.button--primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
}

.button--secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button--secondary:hover {
  border-color: #8294a1;
  background: var(--surface-muted);
  color: var(--text);
}

.button--success {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.button--success:hover {
  border-color: #14532d;
  background: #14532d;
  color: #fff;
}

.button--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.button--danger:hover {
  border-color: var(--danger-dark);
  background: var(--danger-dark);
  color: #fff;
}

.button--quiet {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.button--wide {
  width: 100%;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.results-card {
  min-height: 260px;
  padding: 1.25rem 0 0;
  overflow: hidden;
}

.results-card--compact { min-height: 0; }

.results-card > .section-heading,
.results-card > .notice,
.results-card > .empty-state {
  margin-right: 1.25rem;
  margin-left: 1.25rem;
}

.results-card[aria-busy="true"] {
  opacity: 0.65;
}

.table-scroll {
  max-width: 100%;
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.data-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.68rem 0.75rem;
  border-bottom: 1px solid #e8edf0;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-muted);
  color: #3e4e5a;
  font-size: 0.78rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

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

.data-table tbody tr.is-batch-selected,
.data-table tbody tr.is-batch-selected:hover {
  background: #e8f4fb;
}

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

.data-table .align-right,
.align-right {
  text-align: right;
}

.data-table .categorical-heading,
.data-table .categorical-cell {
  text-align: center;
}

.table-link {
  font-weight: 650;
  text-decoration: none;
}

.partner-cell {
  width: 24%;
}

.partner-name {
  display: block;
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount,
.monospace {
  font-variant-numeric: tabular-nums;
}

.direction,
.badge,
.status-badge,
.document-flags .document-link {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #e9eff3;
  color: #3d4d58;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.document-flags .document-link {
  height: var(--document-control-height);
  text-decoration: none;
}

.document-flags .document-link:hover,
.document-flags .document-link:focus-visible {
  background: #dbe7ee;
  color: #173746;
}

.document-flags button.document-link {
  border: 0;
  cursor: pointer;
}

.document-flags .document-link--success {
  background: var(--success);
  color: #fff;
}

.document-flags .document-link--success:hover {
  background: #14532d;
  color: #fff;
}

.document-action {
  display: inline-flex;
  flex: 0 0 var(--document-control-height);
  width: var(--document-control-height);
  min-width: var(--document-control-height);
  height: var(--document-control-height);
  padding: 0;
  border: 0;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #e1ebe4;
  color: #4d6351;
  cursor: pointer;
}

.document-action:hover {
  background: #d3e2d7;
}

.direction--purchase {
  background: #e7f4fd;
  color: #285f89;
}

.direction--sales {
  background: #f0ecfc;
  color: #654e9b;
}

.direction--neutral {
  background: #eef3f6;
  color: #40515d;
}

.status-badge {
  border: 0;
}

.status-badge--new {
  background: #e7f4fd;
  color: #285f89;
}

.status-badge--seen {
  background: #e3f5f6;
  color: #176b72;
}

.status-badge--renotified {
  background: #f4ebf8;
  color: #744b81;
}

.status-badge--storno {
  background: #f8f3df;
  color: #74621d;
}

.status-badge--approved {
  background: #eef8df;
  color: #58751f;
}

.status-badge--rejected {
  background: #fcede7;
  color: #a34a2d;
}

.status-badge--sent {
  background: #f0ecfc;
  color: #654e9b;
}

.status-badge--overdue {
  background: #fff3d8;
  color: #8a5a10;
}

.status-badge--neutral {
  background: #eef3f6;
  color: #40515d;
}

.document-flags {
  white-space: nowrap;
}

.ebank-status-heading,
.ebank-status-cell {
  width: 5.3rem;
  text-align: center !important;
}

.ebank-status {
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: 1px solid #bae6fd;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #e0f2fe;
  color: #0369a1;
  cursor: help;
  line-height: 1;
}

.ebank-status__icon {
  display: block;
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.batch-select-heading,
.batch-select-cell {
  width: 3.25rem;
  text-align: center !important;
}

.batch-select-checkbox {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
}

.batch-select-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.registry-panel {
  margin-bottom: 20px;
  padding: 20px;
  font-weight: 400;
}

.registry-year-form, .registry-pagination {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0;
}

.registry-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 110px 130px 110px 110px auto auto;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.registry-search-form > .field { min-width: 0; }
.registry-search-form > .button { white-space: nowrap; }

@media (max-width: 1200px) {
  .registry-search-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .registry-search-form > .registry-search-form__query { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .registry-search-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.registry-settings-form, .registry-print-form {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.registry-settings-form .field { max-width: 280px; }
.registry-confirm { display: flex; align-items: baseline; gap: 10px; font-weight: 400; }
.registry-panel .table-scroll { overflow-x: auto; }
.registry-panel .data-table { min-width: 620px; font-size: 14px; }
.registry-panel .registry-plan-table { min-width: 880px; }
.registry-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.registry-history-heading { flex-wrap: wrap; gap: 20px; }
.registry-results-card .registry-history-heading {
  margin-right: 1.25rem;
  margin-left: 1.25rem;
}
.registry-results-card .data-table { min-width: 1000px; }
.registry-history-table th,
.registry-history-table td:nth-child(-n+3) { white-space: nowrap; }
.registry-history-table .registry-invoice-number { overflow-wrap: anywhere; }
.registry-range-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.registry-range-form .field { width: 120px; }
.registry-history-table td:nth-child(4),
.registry-history-table td:nth-child(5) { white-space: normal; overflow-wrap: anywhere; }
.registry-report { margin-top: 24px; padding: 32px; background: #fff; color: #18232c; }
.registry-report-search { overflow-wrap: anywhere; }
.registry-report-heading { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.registry-report-heading h1 { font-size: 24px; font-weight: 600; }
.registry-report-heading p { margin: 0 0 8px; color: #475569; font-size: 14px; }
.registry-report-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.registry-report-table col:nth-child(1) { width: 11%; }
.registry-report-table col:nth-child(2) { width: 13%; }
.registry-report-table col:nth-child(3) { width: 12%; }
.registry-report-table col:nth-child(4) { width: 29%; }
.registry-report-table col:nth-child(5) { width: 21%; }
.registry-report-table col:nth-child(6) { width: 14%; }
.registry-report-table th, .registry-report-table td {
  padding: 10px 8px; border-bottom: 1px solid #d8dfe6; text-align: left;
  vertical-align: top; white-space: normal; overflow-wrap: anywhere; color: #18232c;
}
.registry-report-table th { font-weight: 600; background: #f4f6f8; }
.registry-report-table td { font-weight: 400; }
.registry-report-table th:last-child, .registry-report-table td:last-child { text-align: right; }
.manual-registry-panel { max-width: 960px; }
.manual-registry-form { display: grid; gap: 20px; }
.manual-registry-form input, .manual-registry-summary dd { font-weight: 400; }
.manual-registry-form .date-picker__display { min-width: 0; border-radius: 6px 0 0 6px; }
.manual-registry-summary { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 12px 20px; }
.manual-registry-summary dt { color: var(--text-muted); }
.manual-registry-summary dd { margin: 0; overflow-wrap: anywhere; }
.manual-registry-form input[type="file"] { max-width: 100%; }

.receipt-upload-page { max-width: 1280px; margin: 12px auto 40px; }
.receipt-upload-back { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.receipt-upload-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.receipt-upload-heading { margin: 24px 0 32px; font-size: clamp(28px, 3vw, 36px); font-weight: 400; line-height: 1.25; }
.receipt-upload-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.receipt-upload-form { position: relative; margin: 0; text-align: center; }
.receipt-dropzone, .receipt-upload-progress { display: flex; min-height: 460px; padding: 56px 24px; flex-direction: column; align-items: center; justify-content: center; }
.receipt-dropzone { position: relative; cursor: pointer; font-weight: 400; }
.receipt-dropzone:hover, .receipt-dropzone.is-dragging { background: var(--surface-muted); }
.receipt-dropzone.is-dragging { outline: 2px dashed var(--primary); outline-offset: -12px; }
.receipt-dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: -5px; }
.receipt-file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.receipt-upload-icon { display: grid; width: 96px; height: 96px; border-radius: 50%; place-items: center; background: var(--primary-soft); color: var(--primary); }
.receipt-upload-icon svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.receipt-upload-title { max-width: 100%; margin: 26px 0 0; font-size: clamp(22px, 2.3vw, 28px); font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; }
.receipt-upload-choice { display: none; margin-top: 8px; color: var(--primary); font-size: 16px; text-decoration: underline; text-underline-offset: 3px; }
.receipt-upload-form.is-enhanced .receipt-upload-choice { display: block; }
.receipt-upload-limit { margin-top: 22px; color: var(--muted); font-size: 13px; }
.receipt-upload-orbit { position: relative; display: grid; width: 140px; height: 140px; flex: 0 0 auto; place-items: center; }
.receipt-upload-ring { position: absolute; inset: 0; border: 3px solid var(--line); border-top-color: var(--primary); border-right-color: var(--primary); border-radius: 50%; }
.receipt-upload-filename { display: inline-flex; max-width: min(100%, 460px); padding: 10px 18px; margin: 18px 0 0; border-radius: 32px; align-items: center; gap: 10px; background: var(--surface-muted); font-size: 15px; }
.receipt-upload-filename svg { width: 24px; height: 24px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.receipt-upload-filename span { min-width: 0; overflow-wrap: anywhere; }
.receipt-upload-elapsed { margin: 34px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.receipt-upload-slow { max-width: 440px; margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.receipt-upload-retry { margin-top: 14px; font-size: 14px; }
.receipt-upload-error { margin: 0; padding: 0 24px 24px; color: var(--danger); font-size: 14px; overflow-wrap: anywhere; }
.receipt-upload-submit { margin: 0 auto 28px; }
.receipt-upload-form [hidden] { display: none; }
.receipt-upload-form.is-waiting .receipt-upload-ring { animation: none; }

@keyframes receipt-upload-spin { to { transform: rotate(360deg); } }
.module-home {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
}

.module-home:hover {
  color: #fff;
}

.measurements-workday-back + .page-heading { margin-top: 1rem; }

.measurements-list-card,
.measurements-notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.measurements-notice { margin-bottom: 1rem; padding: 1rem 1.25rem; }
.measurements-notice p { margin: 0.25rem 0 0; color: var(--muted); }
.measurements-list-card__heading { padding: 0; }
.measurements-table-wrap { overflow-x: auto; }
.measurements-table th, .measurements-table td { white-space: nowrap; }
.measurements-table--workdays { table-layout: fixed; min-width: 70rem; }
.measurements-table--workdays td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; }
.measurements-table--workdays th:nth-child(n+4),
.measurements-table--workdays td:nth-child(n+4) { text-align: center; }
.measurements-table--workdays th:nth-child(6),
.measurements-table--workdays td:nth-child(6) { text-align: right; }
.measurements-table--workdays td:first-child a { text-decoration: none; }
.measurements-status { display: inline-flex; align-items: center; padding: 0.2rem 0.5rem; border-radius: 999px; background: #fff3cd; color: #7a5200; font-size: 0.76rem; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.measurements-status--confirmed { background: #e6f4ee; color: #17674f; }
.measurements-empty { padding: 4rem 1.5rem; text-align: center; }
.measurements-empty .measurements-workspace__icon { margin: 0 auto 1rem; }
.measurements-empty h2,
.measurements-empty p { margin: 0.3rem 0; }
.measurements-empty p { color: var(--muted); }

.measurements-dialog { width: min(1180px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgb(15 23 42 / 35%); }
.measurements-dialog::backdrop { background: rgb(15 23 42 / 55%); }
.measurements-dialog form { padding: 1.5rem; }
.measurements-dialog__header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1.25rem; }
.measurements-dialog__header h2,
.measurements-dialog__header p { margin: 0; }
.measurements-dialog__close { border: 0; background: transparent; color: var(--muted); font-size: 2rem; line-height: 1; cursor: pointer; }
.measurements-dialog[aria-busy="true"] .measurements-dialog__close { visibility: hidden; }
.measurements-processing { min-height: min(560px, calc(100vh - 10rem)); padding: 3.5rem 1.5rem; }
.measurements-processing[hidden],
.measurements-editor[hidden] { display: none; }
.measurements-day-fields { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 0.8rem; }
.measurements-day-fields label,
.measurements-file-card label { display: grid; gap: 0.35rem; }
.measurements-day-fields input,
.measurements-day-fields select,
.measurements-file-card input,
.measurements-settings input,
.measurements-settings select { min-width: 0; }
.measurements-input-suffix { display: flex; align-items: center; }
.measurements-input-suffix input { width: 100%; border-radius: 7px 0 0 7px; }
.measurements-input-suffix small { align-self: stretch; display: flex; align-items: center; padding: 0 0.7rem; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 7px 7px 0; background: var(--surface-muted); }
.measurements-dropzone { display: grid; margin-top: 1rem; padding: 1.5rem; border: 2px dashed #6b9b88; border-radius: 10px; place-items: center; text-align: center; cursor: pointer; }
.measurements-dropzone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.measurements-dropzone__icon { display: grid; width: 42px; height: 42px; margin-bottom: 0.5rem; border-radius: 50%; place-items: center; background: #e6f4ee; color: #17674f; font-size: 1.5rem; }
.measurements-dropzone small { color: var(--muted); }
.measurements-files { display: grid; gap: 0.65rem; margin-top: 1rem; }
.measurements-file-card { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(170px, 1fr) minmax(190px, 1.2fr) 120px 110px minmax(120px, auto); gap: 0.75rem; align-items: end; padding: 0.8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.measurements-file-card > div { display: grid; min-width: 0; }
.measurements-file-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.measurements-file-card small,
.measurements-file-card__status { color: var(--muted); font-size: 0.78rem; }
.measurements-file-card__status { margin-top: 0.3rem; }
.measurements-file-card__preview { white-space: nowrap; }
.measurements-settings { display: grid; gap: 1rem; }
.measurements-settings__prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1.25rem; }
.measurements-settings__prices label, .measurements-settings__measurer > label, .measurements-settings__new { display: grid; gap: .35rem; }
.measurements-settings__measurers { display: grid; gap: .75rem; padding: 1.25rem; }
.measurements-settings__measurer { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr) auto auto; gap: 1rem; align-items: end; padding: .85rem; border: 1px solid var(--line); border-radius: 8px; }
.measurements-settings__new > label { display: grid; gap: .35rem; }
.measurements-settings__new { grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr); }
.measurements-check { display: flex !important; align-items: center; gap: .45rem; min-height: 42px; }
.measurements-check input { min-width: auto; }
.measurements-form-help { color: var(--muted); }
.measurements-save { width: 100%; margin-top: 0.75rem; }
.measurements-heading__actions { display: flex; align-items: center; gap: .75rem; }
.measurements-heading__actions form,
.measurement-scheme__actions form { margin: 0; }
.measurement-document-card__status { display: flex; justify-content: center; justify-self: center; }
.measurement-document-card__status .measurements-status { width: max-content; }
.measurement-scheme__actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: .65rem; }
.measurement-scheme__documents { display: flex; align-items: center; justify-content: center; gap: .65rem; }
.measurement-scheme__upload { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: .65rem; }
.measurement-scheme__choose { cursor: pointer; white-space: nowrap; }
.measurement-scheme__upload[aria-busy="true"] .measurement-scheme__choose { pointer-events: none; opacity: .65; }
.measurement-scheme__choose svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.measurement-scheme__choose--compact > span { display: grid; place-items: center; }
.measurement-scheme__choose--compact svg { width: 14px; height: 14px; stroke-width: 2.4; }
.measurement-scheme__upload:focus-within .measurement-scheme__choose { outline: 3px solid var(--focus); outline-offset: 2px; }

.measurement-payment-balances { padding: 1.25rem; display: grid; gap: 1rem; }
.measurement-payment-balance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.measurement-payment-balance > div, .measurement-payment-entry > div { display: grid; gap: .4rem; }
.measurement-payment-balance strong { font-size: 1.5rem; }
.measurement-payment-balance span, .measurement-payment-entry small { color: var(--muted); }
.measurement-payment-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1.25rem; }
.measurement-payment-form label { display: grid; gap: .4rem; }
.measurement-payment-entry { display: grid; grid-template-columns: minmax(110px, .5fr) minmax(0, 2fr) minmax(140px, 1fr); align-items: start; gap: 1rem; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; overflow-wrap: anywhere; }
.measurement-payment-correction form { display: grid; gap: .5rem; margin-top: .75rem; }
@media (max-width: 900px) {
  .measurement-payment-form, .measurement-payment-balance, .measurement-payment-entry { grid-template-columns: 1fr; }
}
/* SEF is the shared layout: results-card, section-heading, field and data-table. */
.module-filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: .9rem; }
.module-filter-form .field { flex: 0 1 18rem; }
.module-filter-form .button-row { margin: 0; }
.measurer-finance { max-width: none; }
.finance-balance-card, .finance-ledger-card, .finance-payment-editor, .measurer-jobs, .measurer-accounting { margin-bottom: 1.25rem; }
.finance-balances { padding: 0 1.25rem 1.25rem; }
.measurer-finance__balance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.measurer-finance__balance + .measurer-finance__balance { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.measurer-finance__balance > div { display: grid; gap: .35rem; }
.measurer-finance__balance span, .measurer-finance__balance small { color: var(--muted); }
.measurer-finance__balance strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.finance-ledger th { white-space: nowrap; }
.finance-ledger td:first-child { white-space: nowrap; }
.finance-ledger td:nth-child(2) { min-width: 12rem; max-width: 25rem; overflow-wrap: anywhere; }
.finance-ledger .amount { white-space: nowrap; }
.finance-ledger__payment { background: var(--surface-muted); }
.finance-payment-editor > summary { font-size: 1.18rem; font-weight: 700; cursor: pointer; }
.finance-payment-editor .measurement-payment-form { padding: 0; }
.measurement-documents-table { min-width: 1120px; }
.measurement-documents-table th,
.measurement-documents-table td { white-space: nowrap; }
.measurement-documents-table .measurement-date { white-space: nowrap; }
.measurement-documents-table .measurement-document-card { display: table-row; }
.measurement-documents-table .measurement-document-header { display: table-row; }
.measurement-documents-table .measurement-document-card__identity { color: var(--primary); }
.measurement-documents-table .measurement-document-address { width: 28%; }
.measurement-documents-table .measurement-positions-heading { width: 8%; }
.measurement-documents-table .measurement-pages-heading { width: 7%; }
.measurement-documents-table .measurement-documents-heading { width: 18%; }
.measurement-documents-table .measurement-document-upload { width: 1%; }
.measurement-documents-table .measurement-status-heading { width: 11%; }
.measurements-workday-back { text-decoration: none; }
.data-table small { display: block; margin-top: .2rem; color: var(--muted); font-size: .78rem; }
.measurement-addresses-table th:first-child { width: 46%; }
.measurer-address__order { display: grid; justify-items: start; gap: .35rem; margin-top: .4rem; }
.measurer-address__order p { margin: 0; color: var(--muted); font-size: .85rem; }
.measurer-day-total { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: 1rem 1.25rem; }
.measurer-accounting__list { padding: 1.25rem; }
@media (max-width: 650px) {
  .measurer-finance__balance { grid-template-columns: 1fr; }
  .module-filter-form .field { flex: 1 1 100%; }
  .finance-ledger-card > .section-heading { flex-direction: column; }
}

.measurements-workspace {
  display: flex;
  min-height: 410px;
  margin-top: 1.8rem;
  padding: 3rem 2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  align-items: center;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.measurements-workspace__icon {
  display: grid;
  width: 86px;
  height: 86px;
  margin-bottom: 1.7rem;
  border-radius: 24px;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}

.measurements-workspace__icon svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.measurements-workspace h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  letter-spacing: -0.03em;
}

.measurements-workspace > p:not(.eyebrow) {
  max-width: 37rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
}

.measurements-steps {
  display: grid;
  width: min(100%, 55rem);
  margin: 2.5rem 0 0;
  padding: 1.8rem 0 0;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
  list-style: none;
  text-align: left;
}

.measurements-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.measurements-steps li > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  place-items: center;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
}

.measurements-steps li > div {
  display: grid;
  gap: 0.3rem;
}

.measurements-steps small {
  color: var(--muted);
  font-size: 0.8rem;
}

@media screen {
  body[data-module="measurements"] {
    --primary: #17674f;
    --primary-dark: #104e3c;
    --primary-soft: #e1f1e9;
  }

  body[data-module="measurements"] .app-header {
    border-bottom-color: #195440;
    background: #104b3c;
  }

  :root[data-theme="dark"] body[data-module="measurements"] {
    --primary: #92d9b8;
    --primary-dark: #b8ead1;
    --primary-soft: #203f31;
  }

  :root[data-theme="dark"] body[data-module="measurements"] .app-header {
    border-bottom-color: #305d49;
    background: #113b2d;
  }

  :root[data-theme="dark"] .module-menu__panel {
    box-shadow: 0 18px 46px rgb(0 0 0 / 48%);
  }

  :root[data-theme="dark"] .badge--module-sef {
    background: #17394c;
    color: #a2d9f3;
  }

  :root[data-theme="dark"] .badge--module-measurements {
    background: #203f31;
    color: #a8dfc0;
  }

  :root[data-theme="dark"] body[data-module="measurements"] .button--primary {
    border-color: #83c7a5;
    background: #83c7a5;
    color: #122c20;
  }

  :root[data-theme="dark"] body[data-module="measurements"] .button--primary:hover {
    border-color: #a3dfbe;
    background: #a3dfbe;
    color: #122c20;
  }
}

@media (max-width: 600px) {
  .module-menu__trigger {
    padding-right: 0.25rem;
    padding-left: 0.1rem;
    gap: 0.4rem;
  }

  .module-menu__panel {
    position: fixed;
    top: 4.65rem;
    left: 0.75rem;
  }

  .measurements-workspace {
    min-height: 0;
    padding: 2rem 1.15rem;
  }

  .measurements-steps {
    max-width: 19rem;
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .company-permissions__group,
  .company-permissions__sef > legend {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .receipt-upload-ring { animation: receipt-upload-spin 1.25s linear infinite; }
  .receipt-dropzone { transition: background-color 150ms ease; }
}
@media (max-width: 600px) {
  .receipt-upload-page { margin-top: 0; }
  .receipt-upload-heading { margin: 20px 0 24px; }
  .receipt-dropzone, .receipt-upload-progress { min-height: 380px; padding: 36px 18px; }
  .receipt-upload-orbit { width: 120px; height: 120px; }
  .receipt-upload-icon { width: 84px; height: 84px; }
  .receipt-upload-filename { padding: 8px 12px; font-size: 14px; }
}

.receipt-review-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 1fr); gap: 24px; align-items: start; }
.receipt-preview-panel, .receipt-fields-panel { min-width: 0; }
.receipt-preview-page { margin: 16px 0 0; }
.receipt-preview-page figcaption { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.receipt-preview-page img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.receipt-fields-panel h2, .receipt-preview-panel h2 { font-size: 18px; font-weight: 600; }
.receipt-fields-panel .manual-registry-form { gap: 16px; }
.receipt-warnings { border: 1px solid #ebcf91; border-radius: 6px; background: #fff8e8; color: #604310; padding: 12px 16px; margin: 16px 0; font-size: 14px; }
.receipt-warnings ul { margin: 0; padding-left: 18px; }
.receipt-warnings li + li { margin-top: 6px; }
@media (max-width: 900px) {
  .receipt-review-layout { grid-template-columns: minmax(0, 1fr); }
  .receipt-fields-panel { grid-row: 1; }
}
.registry-panel td, .registry-panel th { padding: 12px; }

.batch-print-control {
  position: fixed;
  right: auto;
  bottom: 1.25rem;
  left: 50%;
  z-index: 20;
  display: flex;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 35px rgb(15 23 42 / 22%);
  align-items: center;
  gap: 0.6rem;
  transform: translateX(-50%);
}

.batch-print-control[hidden] {
  display: none;
}

.batch-print-control__action {
  width: 96px;
  min-width: 96px;
  min-height: 42px;
  padding-right: 0.55rem;
  padding-left: 0.55rem;
}

.batch-print-control__count {
  min-width: 82px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
}

.batch-print-control__count strong {
  color: var(--text);
}

.batch-print-control__clear {
  display: inline-grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  place-items: center;
  line-height: 0;
}

.batch-print-control__clear svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.modal-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  padding: 1rem;
  place-items: center;
  background: rgb(15 23 42 / 58%);
}

body.has-modal-open {
  overflow: hidden;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(100%, 520px);
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 70px rgb(15 23 42 / 30%);
}

.modal-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-card__heading .eyebrow {
  margin-bottom: 0.2rem;
}

.modal-card__heading h2,
.modal-card > p {
  margin: 0;
}

.modal-card > p {
  margin-top: 0.75rem;
  color: var(--muted);
}

.modal-card__close {
  display: inline-flex;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.modal-card__close:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.ebank-modal__date {
  max-width: 286px;
  margin-top: 1rem;
}

.sef-action-modal__notice {
  margin: 1rem 0 0;
}

.sef-action-modal {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.sef-action-modal [hidden] {
  display: none !important;
}

.sef-action-modal__description {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.sef-action-modal__comment {
  margin-top: 1rem;
}

.sef-action-modal__comment textarea {
  display: block;
  min-height: 7rem;
  resize: vertical;
}

.sef-action-confirmation {
  display: flex;
  margin-top: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 650;
}

.sef-action-confirmation input {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin: 0.05rem 0 0;
  accent-color: var(--primary);
}

.sef-action-progress {
  margin-top: 1rem;
}

.sef-action-progress[hidden],
.sef-action-progress__message[hidden],
.sef-action-progress__actions button[hidden] {
  display: none !important;
}

.sef-action-progress__live {
  color: var(--text);
  font-size: 1.05rem;
}

.sef-action-progress__track {
  display: block;
  width: 100%;
  height: 12px;
  margin-top: 0.75rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: var(--surface-muted);
  box-shadow: inset 0 0 0 1px var(--line);
}

.sef-action-progress__track::-webkit-progress-bar {
  border-radius: inherit;
  background: var(--surface-muted);
}

.sef-action-progress__track::-webkit-progress-value {
  border-radius: inherit;
  background: var(--primary);
}

.sef-action-progress__track::-moz-progress-bar {
  border-radius: inherit;
  background: var(--primary);
}

.sef-action-progress__counts {
  display: grid;
  margin: 1rem 0 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.sef-action-progress__counts > div {
  padding: 0.7rem;
  border-radius: 8px;
  background: var(--surface-muted);
}

.sef-action-progress__counts dt,
.sef-action-progress__counts dd {
  margin: 0;
}

.sef-action-progress__counts dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.sef-action-progress__counts dd {
  margin-top: 0.15rem;
  color: var(--text);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.sef-action-progress__message {
  margin-top: 1rem;
}

.sef-action-progress__actions:empty {
  display: none;
}

.ebank-information {
  display: flex;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid #a8d8f0;
  border-radius: 8px;
  align-items: flex-start;
  gap: 0.65rem;
  background: #edf8fd;
  color: #285f78;
}

.ebank-information[hidden] {
  display: none !important;
}

.ebank-information > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.ebank-information h3,
.ebank-information p {
  margin: 0;
}

.ebank-information h3 {
  font-size: 0.95rem;
}

.ebank-information p {
  margin-top: 0.2rem;
  font-size: 0.86rem;
}

.ebank-reexport-warning {
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid #e6bd49;
  border-radius: 8px;
  background: var(--warning-soft);
  color: #713f12;
}

.ebank-reexport-warning[hidden] {
  display: none !important;
}

.ebank-reexport-warning__content {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.ebank-reexport-warning__content > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.ebank-reexport-warning h3,
.ebank-reexport-warning p {
  margin: 0;
}

.ebank-reexport-warning h3 {
  font-size: 0.95rem;
}

.ebank-reexport-warning p {
  margin-top: 0.2rem;
  font-size: 0.86rem;
}

.ebank-reexport-confirmation {
  display: flex;
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgb(133 77 14 / 22%);
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 650;
}

.ebank-reexport-confirmation input {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin: 0.05rem 0 0;
  accent-color: var(--warning);
}

.modal-card__actions {
  display: flex;
  margin-top: 1.25rem;
  justify-content: flex-end;
  gap: 0.65rem;
}

.document-flags span + span {
  margin-left: 0.25rem;
}

.pagination {
  display: flex;
  padding: 1rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pagination span {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 2.75rem 1rem 3.5rem;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 0.35rem;
  color: var(--text);
  font-size: 1.05rem;
}

.empty-state p {
  margin: 0;
}

/* Operation outcomes share one compact treatment across all modules. */
.page-feedback {
  display: flex;
  min-width: 0;
  margin-bottom: 1rem;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--success);
  font-size: 0.95rem;
  line-height: 1.5;
}

.page-feedback[hidden] { display: none; }
.page-feedback--info { color: var(--primary); }
.page-feedback--warning { color: var(--warning); }
.page-feedback--error { color: var(--danger); }

.page-feedback[data-feedback-ready] {
  animation: page-feedback-fade-out 250ms ease-out 10s forwards;
}
.page-feedback--success[data-feedback-ready] { animation-delay: 5s; }

.page-feedback[data-feedback-ready]:hover,
.page-feedback[data-feedback-ready]:focus-within { animation-play-state: paused; }

@keyframes page-feedback-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .page-feedback[data-feedback-ready] { animation-duration: 1ms; }
}

.page-feedback__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  margin-top: 0.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-feedback--success .page-feedback__icon circle { fill: #16803d; stroke: #16803d; }
.page-feedback--success .page-feedback__icon path { stroke: #fff; stroke-width: 2.2; }

.page-feedback__text {
  min-width: 0;
  padding-top: 0.1rem;
  overflow-wrap: anywhere;
}

.page-feedback__dismiss {
  display: none;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.3rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.page-feedback[data-feedback-ready] .page-feedback__dismiss { display: inline-flex; }
.page-feedback__dismiss:hover { background: var(--surface-muted); color: var(--text); }
.page-feedback__dismiss svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.page-feedback-stack {
  display: flex;
  min-width: 0;
  max-width: min(56ch, 50%);
  margin-left: auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.page-feedback-stack:not(:has(> .page-feedback:not([hidden]))) { display: none; }
.page-feedback-stack > .page-feedback { margin: 0; max-width: 100%; }
.page-heading.page-feedback-heading,
.section-heading.page-feedback-heading { flex-wrap: wrap; }

.filter-card > .page-feedback-heading {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, auto);
  column-gap: 1.5rem;
  row-gap: 0;
  align-items: start;
}

.filter-card .page-feedback-heading__copy { display: contents; }
.filter-card .page-feedback-heading__copy > h2 { grid-area: 1 / 1; }
.filter-card .page-feedback-heading__copy > p { grid-area: 2 / 1 / auto / -1; }
.filter-card .page-feedback-stack { grid-area: 1 / 2; max-width: 56ch; }
.auth-card__heading .page-feedback-stack { margin-top: 1rem; max-width: 100%; }

@media (max-width: 760px) {
  .filter-card > .page-feedback-heading { grid-template-columns: minmax(0, 1fr); }
  .filter-card .page-feedback-stack { grid-area: 3 / 1; margin-top: 0.75rem; }
  .page-feedback-stack {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    align-items: flex-start;
  }
}

@media (pointer: coarse) {
  .page-feedback__dismiss { width: 2.75rem; height: 2.75rem; padding: 0.8rem; margin-top: -0.5rem; }
}

.notice {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid;
  border-radius: 7px;
}

.notice--success {
  border-color: #86d99d;
  background: var(--success-soft);
  color: var(--success);
}

.notice--info {
  border-color: #a8d8f0;
  background: #edf8fd;
  color: #285f78;
}

.notice--warning {
  border-color: #f2cf66;
  background: var(--warning-soft);
  color: var(--warning);
}

.notice--error {
  border-color: #f1a6a1;
  background: var(--danger-soft);
  color: #8f1c14;
}

.auth-card {
  width: min(460px, 100%);
  margin: clamp(2rem, 8vh, 5.5rem) auto 0;
  padding: clamp(1.4rem, 4vw, 2rem);
}

.auth-card__heading {
  margin-bottom: 1.5rem;
}

.stacked-form {
  display: grid;
  gap: 1rem;
}

.form-card {
  margin-bottom: 1.5rem;
}

.form-card--narrow {
  width: min(620px, 100%);
  margin: 2rem auto;
}

.form-card > h1,
.form-card > h2 {
  margin-bottom: 0.85rem;
}

.breadcrumb {
  display: flex;
  margin-bottom: 1rem;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(470px, 1.3fr) minmax(380px, 0.9fr);
  align-items: start;
  gap: 1.25rem;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}

.detail-list > div {
  min-width: 0;
  padding: 0.72rem 0;
  border-bottom: 1px solid #e8edf0;
}

.detail-list > div:nth-child(odd) {
  padding-right: 1rem;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0.15rem 0 0;
  font-weight: 550;
}

.break-anywhere {
  overflow-wrap: anywhere;
}

.document-list {
  display: grid;
  gap: 0.85rem;
}

.document-item {
  display: grid;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  gap: 0.9rem;
}

.document-item h3 {
  margin: 0;
  font-size: 1rem;
}

.xml-card {
  overflow: hidden;
}

.xml-view {
  min-height: 50vh;
  max-height: calc(100vh - 210px);
  margin: 0;
  padding: 1.25rem;
  overflow: auto;
  background: #f8fafc;
  color: #1f2937;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-create-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  align-items: start;
  gap: 1rem;
}

.checkbox-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.company-permissions {
  display: grid;
  gap: 0.7rem;
}

.admin-create-form > .company-permissions {
  grid-column: span 2;
}

.company-permissions__item {
  display: grid;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 0.25rem;
}

.company-permissions__company,
.company-permissions__capability {
  width: fit-content;
  margin-right: 0;
}

.company-permissions__capability {
  margin-left: 1.55rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.company-permissions__group {
  display: grid;
  margin-left: 1.55rem;
  padding-top: 0.25rem;
  gap: 0.1rem;
}

.company-permissions__group--actions {
  margin-top: 0.25rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.company-permissions__group-label {
  margin-bottom: 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.company-permissions__group .company-permissions__capability {
  margin-left: 0;
}

.company-permissions__modules {
  gap: 0.4rem;
}

.company-permissions__module {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
}

.company-permissions__module > span {
  display: grid;
  gap: 0.1rem;
}

.company-permissions__module strong {
  color: var(--text);
  font-size: 0.9rem;
}

.company-permissions__module small {
  color: var(--muted);
  font-size: 0.75rem;
}

.company-permissions__module--measurements input {
  accent-color: #17674f;
}

.company-permissions__sef {
  min-width: 0;
  margin: 0.8rem 0 0;
  padding: 0;
  border: 0;
}

.company-permissions__sef > legend {
  margin-left: 1.55rem;
  font-size: 0.83rem;
}

.company-permissions__sef:disabled {
  opacity: 0.55;
}

.users-table__company-access {
  display: grid;
  gap: 0.3rem;
}

.users-table__company-access + .users-table__company-access {
  margin-left: 0.65rem;
}

.badge--module-sef {
  background: #e0f2fe;
  color: #075985;
}

.badge--module-measurements {
  background: #e0f1e9;
  color: #17674f;
}

.check-control {
  display: inline-flex;
  min-height: 34px;
  margin-right: 0.9rem;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.check-control input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.admin-create-form__admin {
  align-self: end;
}

.admin-create-form__button {
  align-self: end;
}

.users-section {
  margin-top: 1.5rem;
}

.user-list {
  display: grid;
  gap: 1rem;
}

.user-card {
  padding: 1.1rem;
}

.user-card__identity {
  display: flex;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.user-card__identity h3,
.user-card__identity p {
  margin: 0;
}

.user-card__identity p {
  color: var(--muted);
}

.users-filter {
  display: grid;
  padding: 0 1.25rem 1.25rem;
  grid-template-columns: minmax(260px, 2fr) minmax(150px, 0.65fr) minmax(150px, 0.65fr);
  align-items: end;
  gap: 0.9rem;
}

.users-results-card__heading {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.users-table {
  min-width: 760px;
}

.users-table__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
}

.users-table__avatar {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 750;
}

.users-table__identity-copy {
  display: grid;
  min-width: 0;
}

.users-table__name {
  max-width: 26rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-table__identity-copy > .monospace {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-table__mobile-role {
  display: none;
}

.users-table__companies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.users-filter-empty {
  border-top: 1px solid var(--line);
}

.user-create-card {
  max-width: 1180px;
}

.user-detail-card {
  max-width: 1180px;
  margin-right: auto;
  margin-left: auto;
}

.user-detail-card__identity {
  display: flex;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  align-items: center;
  gap: 0.75rem;
}

.user-detail-card__identity h2,
.user-detail-card__identity p {
  margin: 0;
}

.user-detail-card__identity p {
  color: var(--muted);
  font-size: 0.84rem;
}

.user-detail-card__badges {
  margin-left: auto;
}

.user-access-form {
  display: grid;
  margin-top: 1.1rem;
  gap: 1rem;
  justify-items: start;
}

.user-access-grid {
  display: grid;
  margin-top: 0.75rem;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 0.8rem;
}

.user-security-grid {
  display: grid;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.8rem;
}

.user-security-panel {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.user-security-panel > summary {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.user-security-panel > summary::-webkit-details-marker {
  display: none;
}

.user-security-panel strong,
.user-security-panel small {
  display: block;
}

.user-security-panel small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.user-password-form {
  display: grid;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 0.75rem;
}

.user-password-form .button {
  grid-column: 1 / -1;
  justify-self: start;
}

.user-security-panel--danger {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-color: #efc4bf;
  background: #fff9f8;
}

.badge--success {
  background: var(--success-soft);
  color: var(--success);
}

.badge--warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge--muted {
  background: #e5e7eb;
  color: #4b5563;
}

.badge--info {
  background: #e7f4fd;
  color: #285f78;
}

.partner-filter-form {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(230px, 1fr) auto;
  align-items: end;
  gap: 0.9rem;
}

.partner-settings-table {
  min-width: 1120px;
  table-layout: fixed;
}

.partner-settings-table__partner-column {
  width: 32%;
}

.partner-settings-table__pib-column {
  width: 10%;
}

.partner-settings-table__count-column {
  width: 10%;
}

.partner-settings-table__account-column {
  width: 19%;
}

.partner-settings-table__check-column {
  width: 16%;
}

.partner-settings-table__state-column {
  width: 13%;
}

.partner-settings-table__name {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partner-settings-table__pib,
.partner-settings-table__account,
.partner-settings-table__checked-at,
.partner-settings-table__state {
  white-space: nowrap;
}

.partner-settings-table__count {
  text-align: center;
}

.partner-settings-table__count-heading {
  white-space: nowrap;
}

.partner-account-card {
  width: min(860px, 100%);
}

.partner-account-form {
  display: grid;
  gap: 1rem;
}

.account-radio-list {
  display: grid;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 0.7rem;
}

.account-radio {
  display: grid;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 0.8rem;
  background: var(--surface-muted);
  cursor: pointer;
}

.account-radio:hover {
  border-color: #8294a1;
}

.account-radio:has(input:checked) {
  border-color: #7bbbd8;
  background: #f0f9fd;
}

.account-radio input {
  width: 19px;
  height: 19px;
  margin: 0.15rem 0 0;
  accent-color: var(--primary);
}

.account-radio__content {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
}

.account-radio__content > strong {
  overflow-wrap: anywhere;
}

.account-radio__content > span:not(.badge-row) {
  color: var(--muted);
  font-size: 0.88rem;
}

.account-radio__content .badge-row {
  margin-top: 0.35rem;
}

.partner-account-form__actions {
  display: flex;
  justify-content: flex-end;
}

.sef-observed-accounts {
  display: grid;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  gap: 0.8rem;
}

.sef-observed-accounts h3,
.sef-observed-accounts p {
  margin: 0;
}

.sef-observed-accounts p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.account-radio--read-only {
  cursor: default;
}

.account-radio--read-only:hover {
  border-color: var(--line);
}

.account-radio__source {
  display: inline-grid;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.user-card__controls {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(300px, 1.2fr) auto;
  padding-top: 1rem;
  align-items: end;
  gap: 1rem;
}

.compact-form {
  min-width: 0;
}

.compact-form .field {
  margin-bottom: 0.55rem;
}

.compact-form--end {
  justify-self: end;
}

.error-card {
  width: min(580px, 100%);
  margin: clamp(2rem, 8vh, 5rem) auto 0;
  padding: 2rem;
  text-align: center;
}

.error-card__code {
  margin: 0;
  color: var(--primary);
  font-size: 3.5rem;
  font-weight: 750;
  line-height: 1;
}

.error-card h1 {
  margin-top: 0.75rem;
}

.error-card > .button {
  margin-top: 0.75rem;
}

.primary-nav {
  display: flex;
  min-height: 64px;
  align-self: stretch;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.875rem;
}

.primary-nav__item {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-height: 44px;
  padding: 0 0.6875rem;
  align-items: center;
  color: rgb(255 255 255 / 78%);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav__item::before {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 0;
  left: 0;
  height: 42px;
  max-height: calc(100% - 4px);
  border-radius: 6px;
  background: transparent;
  transform: translateY(-50%);
  content: "";
}

.primary-nav__item:hover,
.primary-nav__item:focus-visible,
.primary-nav__item.is-current {
  color: #fff;
}

.primary-nav__item:hover::before,
.primary-nav__item:focus-visible::before {
  background: rgb(255 255 255 / 9%);
}

.primary-nav__item.is-current::after {
  position: absolute;
  right: 0.75rem;
  bottom: 0;
  left: 0.75rem;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  content: "";
}

@media (prefers-reduced-motion: no-preference) {
  .primary-nav__item::before { transition: background-color 120ms ease; }
}

@media (max-width: 940px) {
  .app-header__inner {
    flex-wrap: wrap;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .primary-nav {
    min-height: 48px;
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

.eyebrow {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.classification-heading {
  margin-bottom: 1.15rem;
}

.classification-metrics {
  display: grid;
  margin-bottom: 1.15rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  position: relative;
  display: grid;
  min-height: 128px;
  padding: 1.15rem 1.25rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
}

.metric-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--primary);
  content: "";
}

.metric-card--automatic::before {
  background: #0f766e;
}

.metric-card--corrected::before {
  background: #2563eb;
}

.metric-card--review::before {
  background: #d97706;
}

.metric-card:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  margin: 0.12rem 0;
  font-size: 2rem;
  line-height: 1.1;
}

.metric-card small {
  color: var(--muted);
}

.classification-filter {
  margin-bottom: 1.15rem;
}

.classification-filter__form {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(150px, 0.8fr) repeat(2, minmax(150px, 0.8fr)) auto;
  align-items: end;
  gap: 0.85rem;
}

.classification-filter__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.classification-automation-note {
  color: var(--success) !important;
  font-size: 0.86rem;
  font-weight: 650;
}

.classification-automation-note span {
  margin-right: 0.35rem;
  font-size: 0.7rem;
}

.classification-table td {
  vertical-align: middle;
}

.classification-table {
  min-width: 1540px;
}

.classification-table th,
.classification-table td {
  white-space: nowrap;
}

.classification-supplier-cell {
  width: 18rem;
  max-width: 18rem;
}

.classification-supplier-name,
.classification-value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classification-value {
  max-width: 18rem;
}

.classification-value--mixed {
  color: #6d28d9;
}

.classification-value--suggested {
  color: var(--muted);
}

.classification-value--empty {
  color: var(--muted);
}

.classification-status {
  display: inline-flex;
  min-height: 26px;
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  align-items: center;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 720;
}

.classification-status--automatic {
  background: #dff6ef;
  color: #0f6b55;
}

.classification-status--corrected {
  background: #e5edff;
  color: #1d4ed8;
}

.classification-status--review {
  background: var(--warning-soft);
  color: var(--warning);
}

.item-catalog-heading {
  margin-bottom: 1.15rem;
}

.item-catalog-metrics {
  display: grid;
  margin-bottom: 1.15rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card--items::before {
  background: var(--primary);
}

.metric-card--learned::before {
  background: #0f766e;
}

.metric-card--default::before {
  background: #64748b;
}

.metric-card--attention::before {
  background: #d97706;
}

.item-catalog-filter {
  margin-bottom: 1.15rem;
}

.item-catalog-secondary {
  display: flex;
  margin: -0.25rem 0 1.15rem;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 1.2rem;
  font-size: 0.84rem;
}

.item-catalog-secondary a {
  color: var(--text);
  text-underline-offset: 0.2em;
}

.item-catalog-secondary a span {
  margin-left: 0.25rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.item-catalog-secondary > small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.76rem;
}

.item-catalog-filter__form {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(210px, 0.75fr) auto;
  align-items: end;
  gap: 0.85rem;
}

.item-catalog-filter__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.item-catalog-note {
  max-width: 56rem;
  color: var(--muted) !important;
  font-size: 0.86rem;
}

.item-catalog-results > .section-heading > div {
  flex-shrink: 0;
}

.item-catalog-table {
  min-width: 1980px;
}

.item-catalog-table th,
.item-catalog-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.item-catalog-supplier-cell {
  width: 17rem;
  max-width: 17rem;
}

.item-catalog-description-cell {
  width: 24rem;
  max-width: 24rem;
}

.item-catalog-primary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-catalog-table small {
  display: block;
  margin-top: 0.18rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
}

.item-catalog-state-cell {
  min-width: 15rem;
  max-width: 23rem;
}

.item-catalog-saved-rule {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  white-space: normal;
}

.item-catalog-saved-rule summary {
  color: var(--primary);
  cursor: pointer;
}

.item-catalog-saved-rule p {
  margin: 0.4rem 0 0;
  line-height: 1.5;
}

.item-catalog-status--learned {
  background: #dff6ef;
  color: #0f6b55;
}

.item-catalog-status--default,
.item-catalog-status--automatic {
  background: #e8eef2;
  color: #455764;
}

.item-catalog-status--one_off {
  background: #e5edff;
  color: #1d4ed8;
}

.item-catalog-status--mixed {
  background: #eee8ff;
  color: #6d28d9;
}

.item-catalog-status--review {
  background: var(--warning-soft);
  color: var(--warning);
}

.item-detail-heading {
  align-items: flex-end;
}

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

.item-detail-heading h1 {
  max-width: 72rem;
  overflow: hidden;
  font-size: clamp(1.45rem, 2.25vw, 1.9rem);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-detail-heading p {
  font-size: 0.9rem;
}

.item-detail-summary {
  display: grid;
  margin-bottom: 1.15rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  grid-template-columns: 1.4fr repeat(2, 0.55fr) 1.1fr 1fr 0.85fr;
  background: var(--surface);
  box-shadow: var(--shadow);
  gap: 0.85rem;
}

.item-detail-summary > div {
  min-width: 0;
}

.item-detail-summary span:not(.classification-status) {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.item-detail-summary strong:not(.classification-status) {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  font-weight: 400;
  white-space: normal;
}

.item-detail-summary > .record-identity { grid-column: 1 / -1; }
.item-detail-summary > .record-identity strong { white-space: normal; overflow: visible; overflow-wrap: anywhere; }

.item-detail-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(350px, 0.58fr);
  align-items: start;
  gap: 1.15rem;
  font-size: 0.9rem;
}

.item-history-state {
  margin-bottom: 1.15rem;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.55;
}

.item-history-state p {
  margin: 0.35rem 0;
}

.item-history-state__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.3rem;
  color: var(--text);
}

.item-advance-note {
  margin: -0.25rem 0 1.15rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.item-pending-state {
  color: var(--primary) !important;
}

.item-detail-main {
  display: grid;
  min-width: 0;
  gap: 1.15rem;
}

.item-detail-note {
  max-width: 30rem;
  color: var(--muted) !important;
  font-size: 0.82rem;
  text-align: right;
}

.item-occurrence-table {
  min-width: 1420px;
}

.item-occurrence-description {
  width: 22rem;
  max-width: 22rem;
}

.item-occurrence-description span,
.item-occurrence-description small,
.item-occurrence-document small,
.item-occurrence-source small,
.item-occurrence-classification span,
.item-occurrence-classification small,
.item-rule-history-table small {
  display: block;
}

.item-occurrence-description span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-occurrence-description small,
.item-occurrence-document small,
.item-occurrence-source small,
.item-occurrence-classification small,
.item-rule-history-table small {
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.item-occurrence-classification {
  min-width: 24rem;
}

.item-rule-history {
  min-height: 0;
}

.item-document-references {
  margin-top: 6px;
  max-width: 320px;
  font-size: 12px;
  font-weight: 400;
  white-space: normal;
  overflow-wrap: anywhere;
}

.item-document-references summary {
  cursor: pointer;
  color: var(--primary);
}

.item-document-references ul {
  margin: 8px 0 0;
  padding-left: 16px;
}

.item-document-references li + li {
  margin-top: 10px;
}

.item-document-references li > span,
.item-document-references li > a {
  display: block;
}

.item-document-reference-note {
  margin: 12px 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.item-rule-history-table {
  min-width: 900px;
}

.item-rule-history-table td:nth-child(2) {
  min-width: 28rem;
}

.item-rule-status--inactive {
  background: var(--surface-muted);
  color: var(--muted);
}

.item-rule-editor {
  position: sticky;
  top: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.item-rule-editor__heading {
  display: flex;
  margin-bottom: 0.85rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.item-rule-editor__heading h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.item-active-rule {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--surface-muted);
}

.item-active-rule > span,
.item-active-rule > strong,
.item-active-rule > small {
  display: block;
}

.item-active-rule > span {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
}

.item-active-rule > strong {
  font-weight: 500;
}

.item-active-rule p {
  margin: 0.2rem 0;
  color: var(--muted);
}

.item-active-rule > small {
  color: var(--muted);
}

.item-rule-editor__form {
  margin-top: 0.9rem;
}

.item-rule-scope__note {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.item-rule-editor__notice {
  margin: 0;
}

.item-rule-editor__notice p {
  margin: 0.35rem 0 0;
}

.item-rule-editor__invoice-link {
  margin-top: 0.75rem;
}

.breadcrumbs {
  display: flex;
  margin-bottom: 0.9rem;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.classification-detail-heading h1 {
  font-size: clamp(1.65rem, 2.5vw, 2rem);
  font-weight: 600;
}

.classification-detail-heading p {
  font-size: 0.92rem;
  font-weight: 400;
}

.classification-detail-heading .eyebrow {
  font-weight: 600;
}

.classification-detail-heading .button {
  font-size: 0.9rem;
  font-weight: 500;
}

.invoice-summary-strip {
  display: grid;
  margin-bottom: 1.15rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  grid-template-columns: 0.7fr 1.7fr 1fr 0.8fr 0.9fr 1.15fr;
  background: var(--surface);
  box-shadow: var(--shadow);
  gap: 0.85rem;
}

.invoice-summary-strip > div {
  min-width: 0;
}

.invoice-summary-strip span:not(.classification-status) {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invoice-summary-strip strong:not(.classification-status) {
  display: block;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 0.9rem;
  font-weight: 400;
}

.classification-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 0.72fr);
  align-items: start;
  gap: 1.15rem;
  font-size: 0.9rem;
}

.classification-lines-card,
.classification-editor,
.empty-state--card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.classification-lines-card > .section-heading,
.classification-editor {
  padding: 1.1rem;
}

.classification-lines-card > .section-heading {
  margin-bottom: 0;
}

.classification-lines-card > .section-heading h2,
.classification-editor__heading h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

.classification-lines-card > .section-heading p {
  font-size: 0.9rem;
}

.line-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.classification-line-list {
  border-top: 1px solid var(--line);
}

.classification-line {
  display: grid;
  min-height: 78px;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 32px minmax(210px, 1.45fr) minmax(100px, 0.55fr) minmax(160px, 0.85fr) auto;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
}

.classification-line:last-child {
  border-bottom: 0;
}

.classification-line:hover,
.classification-line.is-selected {
  background: var(--surface-muted);
  color: var(--text);
}

.classification-line.is-selected {
  box-shadow: inset 4px 0 var(--primary);
}

.classification-line__number {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.classification-line__main,
.classification-line__class {
  min-width: 0;
}

.classification-line__main strong,
.classification-line__main small,
.classification-line__class strong,
.classification-line__class small {
  display: block;
}

.classification-line__main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classification-line__main strong,
.classification-line__class strong {
  font-weight: 400;
}

.classification-line__main small,
.classification-line__class small {
  margin-top: 0.2rem;
  color: var(--muted);
}

.classification-line__amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.classification-line__state {
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: #dff6ef;
  color: #0f6b55;
  font-size: 0.72rem;
  font-weight: 600;
}

.classification-line__state--review {
  background: var(--warning-soft);
  color: var(--warning);
}

.classification-line__state--override {
  background: #e5edff;
  color: #1d4ed8;
}

.classification-editor {
  position: sticky;
  top: 1rem;
}

.classification-editor__heading {
  display: flex;
  margin-bottom: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.classification-editor__heading h2 {
  margin: 0;
}

.classification-editor__heading .eyebrow {
  font-weight: 600;
}

.classification-editor__description {
  margin: 0 0 1rem;
  padding: 0.7rem;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.classification-editor__form {
  display: grid;
  gap: 0.75rem;
}

.classification-editor__form .field {
  gap: 0.25rem;
}

.classification-editor__form .field label {
  font-size: 0.82rem;
  font-weight: 600;
}

.classification-editor__form .field select,
.classification-editor__form .field textarea {
  min-height: 40px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 400;
}

.classification-editor__form .field label span {
  font-weight: 400;
}

.remember-choice {
  display: grid;
  margin: 0.2rem 0;
  padding: 0;
  border: 0;
  gap: 0.55rem;
}

.remember-choice legend {
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.remember-choice > label {
  display: flex;
  padding: 0.68rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

.remember-choice > label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.remember-choice input {
  margin-top: 0.25rem;
}

.remember-choice strong,
.remember-choice small {
  display: block;
}

.remember-choice strong {
  font-weight: 500;
}

.remember-choice small {
  margin-top: 0.12rem;
  color: var(--muted);
}

.remember-choice .remember-choice__history {
  padding: 0.2rem 0.25rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
}

.remember-choice .remember-choice__history.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.classification-editor__help {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.classification-editor__readonly {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.classification-editor__readonly p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.classification-editor__readonly > strong {
  font-weight: 500;
}

.classification-item-rule-link {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.classification-item-rule-link p {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.classification-item-rule-link .button {
  font-size: 0.84rem;
  font-weight: 500;
}

.invoice-summary-strip .classification-status,
.classification-editor .classification-status {
  font-weight: 600;
}

.empty-state--card {
  padding: 3rem 1.5rem;
}

@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1820;
    --surface: #18242d;
    --surface-muted: #202d37;
    --text: #edf3f7;
    --muted: #adbbc5;
    --line: #394a57;
    --line-strong: #5e7180;
    --primary: #7dd3fc;
    --primary-dark: #bae6fd;
    --primary-soft: #17394c;
    --success: #a7e2b7;
    --success-soft: #193728;
    --warning: #f4cf74;
    --warning-soft: #3d3116;
    --danger: #ffaaa4;
    --danger-dark: #ffd0cc;
    --danger-soft: #472421;
    --focus: #fbbf24;
    --shadow: 0 1px 3px rgb(0 0 0 / 30%), 0 12px 34px rgb(0 0 0 / 24%);
  }

  :root[data-theme="dark"] .skip-link {
    background: var(--text);
    color: var(--bg);
  }

  :root[data-theme="dark"] .skip-link:focus {
    color: var(--bg);
  }

  :root[data-theme="dark"] .app-header {
    border-bottom-color: #2b5065;
    background: #0b2e43;
  }

  :root[data-theme="dark"] .account-menu__panel,
  :root[data-theme="dark"] .company-menu__panel {
    box-shadow: 0 18px 46px rgb(0 0 0 / 48%);
  }

  :root[data-theme="dark"] .account-menu__version strong,
  :root[data-theme="dark"] label.field > span:first-child,
  :root[data-theme="dark"] .field label,
  :root[data-theme="dark"] .field legend,
  :root[data-theme="dark"] .field > .status-filter__label,
  :root[data-theme="dark"] .checkbox-fieldset legend,
  :root[data-theme="dark"] .data-table th {
    color: #d3dee5;
  }

  :root[data-theme="dark"] .theme-toggle__state {
    color: #c2d6e2;
  }

  :root[data-theme="dark"] .field input,
  :root[data-theme="dark"] .field select,
  :root[data-theme="dark"] .field textarea,
  :root[data-theme="dark"] .search-form input,
  :root[data-theme="dark"] .search-form select,
  :root[data-theme="dark"] .status-filter__trigger {
    background: var(--surface);
  }

  :root[data-theme="dark"] .field input:hover,
  :root[data-theme="dark"] .field select:hover,
  :root[data-theme="dark"] .field textarea:hover,
  :root[data-theme="dark"] .search-form input:hover,
  :root[data-theme="dark"] .search-form select:hover,
  :root[data-theme="dark"] .status-filter__trigger:hover,
  :root[data-theme="dark"] .status-filter[open] > .status-filter__trigger,
  :root[data-theme="dark"] .date-picker__button:hover,
  :root[data-theme="dark"] .button--secondary:hover,
  :root[data-theme="dark"] .account-radio:hover {
    border-color: #7790a1;
  }

  :root[data-theme="dark"] .date-picker__day.is-outside-month {
    color: #8497a4;
  }

  :root[data-theme="dark"] .date-picker__day:disabled {
    color: #71838f;
  }

  :root[data-theme="dark"] .button--primary,
  :root[data-theme="dark"] .date-picker__day.is-selected,
  :root[data-theme="dark"] .date-picker__day.is-selected:hover {
    border-color: #0877a6;
    background: #0877a6;
    color: #fff;
  }

  :root[data-theme="dark"] .field .status-filter__option > input:checked + .status-filter__indicator {
    border-color: #0877a6;
    background-color: #0877a6;
  }

  :root[data-theme="dark"] .button--primary:hover {
    border-color: #075e85;
    background: #075e85;
    color: #fff;
  }

  :root[data-theme="dark"] .button--success {
    border-color: #2f7a4b;
    background: #2f7a4b;
    color: #fff;
  }

  :root[data-theme="dark"] .button--success:hover {
    border-color: #245f3a;
    background: #245f3a;
    color: #fff;
  }

  :root[data-theme="dark"] .button--danger {
    border-color: #b42318;
    background: #b42318;
    color: #fff;
  }

  :root[data-theme="dark"] .button--danger:hover {
    border-color: #8f1c14;
    background: #8f1c14;
    color: #fff;
  }

  :root[data-theme="dark"] .data-table th {
    background: #202d37;
  }

  :root[data-theme="dark"] .data-table th,
  :root[data-theme="dark"] .data-table td,
  :root[data-theme="dark"] .detail-list > div {
    border-bottom-color: #31414d;
  }

  :root[data-theme="dark"] .data-table tbody tr:hover {
    background: #1d303c;
  }

  :root[data-theme="dark"] .data-table tbody tr.is-batch-selected,
  :root[data-theme="dark"] .data-table tbody tr.is-batch-selected:hover {
    background: #17394c;
  }

  :root[data-theme="dark"] .direction,
  :root[data-theme="dark"] .badge,
  :root[data-theme="dark"] .status-badge,
  :root[data-theme="dark"] .document-flags .document-link {
    background: #293944;
    color: #dbe6ec;
  }

  :root[data-theme="dark"] .document-flags .document-link:hover,
  :root[data-theme="dark"] .document-flags .document-link:focus-visible {
    background: #36505f;
    color: #f1f7fa;
  }

  :root[data-theme="dark"] .direction--purchase,
  :root[data-theme="dark"] .status-badge--new {
    background: #18384c;
    color: #a8ddf7;
  }

  :root[data-theme="dark"] .direction--sales,
  :root[data-theme="dark"] .status-badge--sent {
    background: #302b4f;
    color: #d1c9ff;
  }

  :root[data-theme="dark"] .status-badge--seen {
    background: #173b3d;
    color: #a9e1e4;
  }

  :root[data-theme="dark"] .status-badge--renotified {
    background: #382843;
    color: #e3bfea;
  }

  :root[data-theme="dark"] .status-badge--storno {
    background: #3b361d;
    color: #e9d982;
  }

  :root[data-theme="dark"] .status-badge--approved {
    background: #293a1d;
    color: #c5df8b;
  }

  :root[data-theme="dark"] .status-badge--rejected {
    background: #472820;
    color: #ffb9a1;
  }

  :root[data-theme="dark"] .status-badge--overdue {
    background: #44351b;
    color: #ffda8c;
  }

  :root[data-theme="dark"] .status-badge--neutral,
  :root[data-theme="dark"] .badge--muted {
    background: #293740;
    color: #d2dce2;
  }

  :root[data-theme="dark"] .badge--success {
    background: #1c3a29;
    color: #a7e2b7;
  }

  :root[data-theme="dark"] .badge--warning {
    background: #403316;
    color: #f4cf74;
  }

  :root[data-theme="dark"] .badge--info {
    background: #18394a;
    color: #a8ddf7;
  }

  :root[data-theme="dark"] .ebank-status {
    border-color: #285d78;
    background: #17394c;
    color: #8bd7fa;
  }

  :root[data-theme="dark"] .modal-backdrop {
    background: rgb(0 0 0 / 68%);
  }

  :root[data-theme="dark"] .ebank-information,
  :root[data-theme="dark"] .notice--info {
    border-color: #285d78;
    background: #17394c;
    color: #b9e5f8;
  }

  :root[data-theme="dark"] .ebank-reexport-warning {
    border-color: #816b2d;
    color: #f5dc9a;
  }

  :root[data-theme="dark"] .ebank-reexport-confirmation {
    border-top-color: rgb(244 207 116 / 28%);
  }

  :root[data-theme="dark"] .sef-action-confirmation {
    border-color: var(--line-strong);
    background: var(--surface-muted);
  }

  :root[data-theme="dark"] .notice--success {
    border-color: #3d7650;
  }

  :root[data-theme="dark"] .notice--warning {
    border-color: #816b2d;
  }

  :root[data-theme="dark"] .notice--error {
    border-color: #91443f;
    color: #ffc3be;
  }

  :root[data-theme="dark"] .xml-view {
    background: #111a21;
    color: #dce7ee;
  }

  :root[data-theme="dark"] .account-radio:has(input:checked) {
    border-color: #4389a9;
    background: #17394c;
  }

  :root[data-theme="dark"] .user-security-panel--danger {
    border-color: #6e3b36;
    background: var(--danger-soft);
  }
}

@media (max-width: 1250px) {
  .search-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .search-form__query {
    grid-column: span 2;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .classification-filter__form,
  .item-catalog-filter__form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .classification-filter__query,
  .item-catalog-filter__query {
    grid-column: span 2;
  }

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

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

  .classification-editor,
  .item-rule-editor {
    position: static;
  }

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

@media (max-width: 860px) {
  .app-header__inner,
  .page-heading,
  .user-card__identity {
    align-items: flex-start;
  }

  .app-header__inner {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .primary-nav {
    min-height: 48px;
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .app-header__inner {
    flex-wrap: wrap;
  }

  .classification-metrics,
  .item-catalog-metrics {
    grid-template-columns: 1fr;
  }

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

  .invoice-summary-strip,
  .item-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .classification-line {
    grid-template-columns: 30px minmax(180px, 1fr) auto;
  }

  .classification-line__amount,
  .classification-line__class {
    grid-column: 2;
  }

  .classification-line__state {
    grid-column: 3;
    grid-row: 1;
  }

  .page-heading {
    flex-wrap: wrap;
  }

  .item-detail-heading h1 {
    white-space: normal;
  }

  .item-detail-note {
    max-width: none;
    text-align: left;
  }

  .account-menu__trigger-identity strong,
  .company-menu__trigger-copy > strong {
    max-width: 12rem;
  }

  .page-heading {
    align-items: flex-start;
  }

  .search-form,
  .admin-create-form,
  .user-card__controls,
  .partner-filter-form,
  .users-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-form__query,
  .users-filter__query {
    grid-column: span 2;
  }

  .user-access-grid,
  .user-security-grid {
    grid-template-columns: 1fr;
  }

  .compact-form--end {
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .app-header__inner {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    gap: 0.75rem;
  }

  .app-header__actions {
    gap: 0.25rem;
  }

  .company-menu__trigger {
    min-width: 0;
    padding-right: 0.45rem;
    padding-left: 0.45rem;
    gap: 0.35rem;
  }

  .company-menu__trigger-copy > strong {
    max-width: 4.5rem;
  }

  .company-menu__panel {
    position: fixed;
    top: 4.65rem;
    right: auto;
    left: 0.75rem;
  }

  .results-sync-time {
    width: 100%;
    margin-left: 0 !important;
    text-align: left;
  }

  .section-heading--results {
    flex-wrap: wrap;
  }

  .account-menu__trigger {
    padding-right: 0.35rem;
    padding-left: 0.35rem;
  }

  .account-menu__trigger > .account-menu__chevron {
    display: none;
  }

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

  .account-menu__panel {
    position: fixed;
    top: 4.65rem;
    right: 0.75rem;
  }

  .page-shell {
    padding: 1rem 0.75rem 2rem;
  }

  .page-heading {
    display: block;
  }

  .page-heading > .button,
  .page-heading > .button-row {
    margin-top: 1rem;
  }

  .search-form,
  .admin-create-form,
  .user-card__controls,
  .partner-filter-form,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .search-form__query {
    grid-column: auto;
  }

  .admin-create-form > .company-permissions {
    grid-column: auto;
  }

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

  .users-filter__query {
    grid-column: 1 / -1;
  }

  .users-table-scroll {
    overflow: visible;
  }

  .users-table {
    min-width: 0;
  }

  .users-table thead {
    display: none;
  }

  .users-table tbody,
  .users-table tr,
  .users-table td {
    display: block;
    width: 100%;
  }

  .users-table tr {
    position: relative;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
  }

  .users-table tr[hidden] {
    display: none !important;
  }

  .users-table tr:last-child {
    border-bottom: 0;
  }

  .users-table td {
    padding: 0;
    border: 0;
  }

  .users-table td:nth-child(2) {
    display: none;
  }

  .users-table td:nth-child(3) {
    margin-top: 0.75rem;
    padding-left: 3rem;
  }

  .users-table td:nth-child(4) {
    margin-top: 0.65rem;
    padding-left: 3rem;
    width: auto;
    text-align: left;
  }

  .users-table__identity {
    padding-right: 0;
  }

  .users-table__mobile-role {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
  }

  .user-detail-card__identity {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .user-detail-card__badges {
    width: 100%;
    margin-left: 3rem;
  }

  .user-access-grid,
  .user-password-form {
    grid-template-columns: 1fr;
  }

  .user-security-panel > summary,
  .user-security-panel--danger {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-security-panel > summary .button,
  .user-security-panel--danger .compact-form,
  .user-security-panel--danger .button {
    width: 100%;
  }

  .search-form__actions .button {
    flex: 1;
  }

  .detail-list > div:nth-child(odd) {
    padding-right: 0;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .pagination span {
    order: -1;
    width: 100%;
    text-align: center;
  }

  .pagination .button {
    flex: 1;
  }

  .user-card__identity {
    display: block;
  }

  .badge-row {
    margin-top: 0.75rem;
  }

  .batch-print-control {
    right: auto;
    bottom: 0.75rem;
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 1.5rem);
    padding: 0.5rem;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .batch-print-control .button {
    flex: 0 1 auto;
  }

  .batch-print-control .batch-print-control__clear {
    flex: 0 0 42px;
  }

  .batch-print-control__count {
    min-width: 0;
  }

  .sef-action-progress__counts {
    grid-template-columns: 1fr;
  }

  .partner-name {
    max-width: 17rem;
  }

  .primary-nav {
    gap: 0.25rem;
  }

  .primary-nav__item {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }

  .classification-filter__form,
  .item-catalog-filter__form,
  .invoice-summary-strip,
  .item-detail-summary {
    grid-template-columns: 1fr;
  }

  .classification-filter__query,
  .item-catalog-filter__query {
    grid-column: auto;
  }

  .classification-filter__actions .button,
  .item-catalog-filter__actions .button {
    flex: 1;
  }

  .classification-line {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .classification-line__amount,
  .classification-line__class,
  .classification-line__state {
    grid-column: 2;
  }

  .classification-line__state {
    grid-row: auto;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .results-card {
    transition: opacity 120ms ease;
  }
}

@page registry-ledger { size: A4 portrait; margin: 12mm; }

@media print {
  :root {
    color-scheme: light;
  }

  :root,
  body {
    background: #fff;
  }

  .app-header,
  .batch-print-control,
  .print-hidden,
  .skip-link {
    display: none !important;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .registry-report { page: registry-ledger; margin: 0; padding: 0; }
  .registry-report-heading { break-after: avoid; }
  .registry-report-heading h1 { font-size: 16pt; }
  .registry-report-heading p { font-size: 10pt; }
  .registry-report-table { font-size: 9pt; }
  .registry-report-table col:nth-child(1) { width: 15%; }
  .registry-report-table col:nth-child(2) { width: 13%; }
  .registry-report-table col:nth-child(3) { width: 14%; }
  .registry-report-table col:nth-child(4) { width: 24%; }
  .registry-report-table col:nth-child(5) { width: 20%; }
  .registry-report-table col:nth-child(6) { width: 14%; }
  .registry-report-table thead { display: table-header-group; }
  .registry-report-table tr { break-inside: avoid; }
  .registry-report-table th, .registry-report-table td { padding: 7pt 4pt; }
  .registry-report-table th { white-space: nowrap; overflow-wrap: normal; }

  .xml-card {
    border: 0;
    box-shadow: none;
  }

  .xml-view {
    max-height: none;
    padding: 0;
    overflow: visible;
    background: #fff;
    color: #000;
    font-size: 9pt;
    white-space: pre-wrap;
  }
}

/* Ebanking follows the shared SuperOperater shell and existing calendar controls. */
body[data-module="ebanking"] { --bg: #f4f3f7; --primary: #66518b; --primary-dark: #433754; --primary-soft: #f0ebf8; }
body[data-module="ebanking"] .app-header { background: #433754; border-bottom-color: #433754; }
:root[data-theme="dark"] body[data-module="ebanking"] { --bg: #171821; --primary: #c7b3ec; --primary-dark: #e0d2f8; --primary-soft: #383043; }
:root[data-theme="dark"] body[data-module="ebanking"] .app-header { background: #332b42; border-bottom-color: #332b42; }
.module-menu__mark--ebanking { background: #66518b; }
.badge--module-ebanking { color: #66518b; background: #f0ebf8; }
:root[data-theme="dark"] .badge--module-ebanking { color: #c7b3ec; background: #383043; }
.ebanking-search { grid-template-columns: minmax(180px, 1fr) minmax(100px, 112px) minmax(210px, 230px) repeat(2, minmax(174px, 180px)); }
.ebanking-search > .field { min-width: 0; }
.ebanking-search select { width: 100%; }
.ebanking-table { min-width: 1280px; table-layout: fixed; }
.ebanking-col-date { width: 9%; }
.ebanking-col-bank { width: 16%; }
.ebanking-col-name, .ebanking-col-amount { width: 12%; }
.ebanking-col-status { width: 13%; }
.ebanking-col-number { width: 15%; }
.ebanking-col-partner { width: 20%; }
.ebanking-table--planned { min-width: 1400px; }
.ebanking-table--planned .ebanking-col-name,
.ebanking-table--planned .ebanking-col-plan,
.ebanking-table--planned .ebanking-col-status { width: 7%; }
.ebanking-table--planned .ebanking-col-bank,
.ebanking-table--planned .ebanking-col-amount { width: 15%; }
.ebanking-table--planned .ebanking-col-partner { width: 22%; }
.ebanking-col-select { width: 3%; }
.ebanking-table small, .ebanking-audit small { display: block; color: var(--muted); font-size: 13px; }
.ebanking-table td { vertical-align: middle; }
.ebanking-table .ebanking-status { text-align: center; }
.ebanking-results-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.ebanking-results-heading .results-sync-time { justify-self: end; text-align: right; }
.ebanking-results-totals { text-align: center; }
.ebanking-results-totals .ebanking-total { color: var(--text); font-weight: 600; }
@media (max-width: 900px) { .ebanking-results-heading { grid-template-columns: 1fr; } .ebanking-results-heading .results-sync-time { justify-self: start; text-align: left; white-space: normal; } }
.ebanking-date, .ebanking-account { white-space: nowrap; }
.ebanking-number { white-space: nowrap; }
.ebanking-partner-cell { max-width: 0; }
.ebanking-partner { display: block; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ebanking-selection-control .batch-print-control__action { width: auto; min-width: 160px; }
.ebanking-selection-control .ebanking-selected-total { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.ebanking-selection-control .ebanking-selected-total.is-over-budget,
.ebanking-selection-control .ebanking-selected-total.is-over-budget strong { color: var(--danger); }
.ebanking-table .ebanking-amount { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ebanking-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ebanking-detail dt { color: var(--muted); font-size: 14px; }
.ebanking-detail dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.ebanking-action { display: grid; gap: 20px; justify-items: start; padding-top: 20px; border-top: 1px solid var(--line); }
.ebanking-action .field { max-width: 230px; }
.ebanking-selection-summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 24px; }
.ebanking-selection-summary > div { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; text-align: right; }
.ebanking-selection-action { grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding-top: 0; border-top: 0; }
.ebanking-selection-action > .button { justify-self: end; }
@media (max-width: 640px) { .ebanking-selection-action { grid-template-columns: 1fr; } }
.ebanking-audit { padding: 0 40px 24px; }
.ebanking-audit li { padding: 8px 0; }
@media (max-width: 1100px) { .ebanking-search { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ebanking-search__query { grid-column: 1 / -1; } }
@media (max-width: 800px) { .ebanking-search { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ebanking-search { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ebanking-detail { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ebanking-search > .field:has([data-date-picker]) { grid-column: 1 / -1; } }

.ebanking-selection-control { width: max-content; max-width: calc(100vw - 1.5rem); flex-wrap: wrap; }
.ebanking-selection-control > .field { flex: 0 0 168px; min-width: 0; }
.ebanking-selection-control > .ebanking-payment-account { flex-basis: 250px; }
.ebanking-payment-account select { width: 100%; }
.ebanking-balances { display: flex; align-items: center; font-size: .9rem; font-variant-numeric: tabular-nums; }
@media (min-width: 1351px) { .filter-workspace--ebanking { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1350px) { .filter-workspace--ebanking { grid-template-columns: minmax(0, 1fr); } }
.ebanking-balances__list { width: 100%; margin: 0; }
.ebanking-balances__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .75rem; padding: .65rem 0; }
.ebanking-balances__row + .ebanking-balances__row { border-top: 1px solid var(--line); }
.ebanking-balances dt { display: flex; align-items: center; gap: .6rem; min-width: 0; overflow-wrap: anywhere; }
.ebanking-balances dt svg { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ebanking-balances dd { flex: 0 1 auto; margin: 0 0 0 auto; text-align: right; }
.ebanking-balances dd strong { white-space: nowrap; }
.ebanking-balances strong { font-weight: 600; }
.ebanking-balances .ebanking-balances__negative { color: var(--danger); }
@media (min-width: 801px) and (max-width: 1350px) {
  .ebanking-balances__list { display: flex; gap: 1.25rem; }
  .ebanking-balances__row { flex: 1; min-width: 0; padding: 0; }
  .ebanking-balances__row + .ebanking-balances__row { border-top: 0; border-left: 1px solid var(--line); padding-left: 1.25rem; }
}
@media (max-width: 640px) {
  .ebanking-selection-control > .ebanking-payment-account { flex: 1 1 200px; }
}
.ebanking-selection-control .date-picker__display { width: 100%; min-width: 0; border-radius: 6px 0 0 6px; }
.ebanking-selection-control .date-picker__popover { top: auto; bottom: calc(100% + 6px); max-height: calc(100dvh - 180px); overflow-y: auto; }

/* Shared SEF form geometry also applies to the measurement editor. */
.measurements-empty--compact { padding: 2rem 1.25rem; }
@media (max-width: 700px) {
  .measurements-day-fields, .measurements-file-card, .measurements-settings__prices,
  .measurements-settings__measurer, .measurements-settings__new > label { display: grid; gap: .35rem; }
.measurements-settings__new { grid-template-columns: 1fr; }
  .measurements-dialog form { padding: 1rem; }
  .measurements-heading__actions { flex-wrap: wrap; }
}

.ebanking-account-name { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ebanking-settings { display: grid; gap: 1.25rem; justify-items: start; }
.ebanking-settings > section { width: 100%; }
.ebanking-settings-table { min-width: 760px; }
.ebanking-account-name-input { width: 100%; max-width: 260px; min-width: 140px; }
.ebanking-settings-new { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; }
.ebanking-settings-new > .field { flex: 1 1 200px; }
.ebanking-settings-new > .check-control { min-height: 44px; align-items: center; }

.ebanking-account-switch { justify-content: center; min-height: 44px; }
