:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fb;
  color: #14213d;
}

body {
  margin: 0;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #d9e1ef;
  display: flex;
  gap: 16px;
  min-height: 64px;
  padding: 0 32px;
}

.brand {
  align-items: center;
  color: #0b3b75;
  display: inline-flex;
  font-size: 22px;
  font-weight: 700;
  gap: 8px;
  text-decoration: none;
}

.brand-mark {
  display: block;
  height: 72px;
  object-fit: contain;
  width: 156px;
}

.topbar-subtitle {
  align-self: flex-start;
  color: #62708a;
  font-size: 14px;
  margin-left: -118px;
  padding-top: 12px;
  white-space: nowrap;
}

.shell {
  margin: 0 auto;
  max-width: min(1800px, calc(100vw - 32px));
  padding: 24px 16px 32px;
}

.logout-form {
  margin-left: 0;
}

.menu-search {
  flex: 0 1 220px;
  min-width: 160px;
  position: relative;
}

.menu-search input {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  min-height: 34px;
  padding: 5px 8px;
  width: 100%;
}

.menu-search-results {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
  left: 0;
  max-height: 320px;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
}

.menu-search-result,
.menu-search-empty {
  color: #0f172a;
  display: block;
  font-size: 12px;
  padding: 8px 10px;
  text-decoration: none;
}

.menu-search-result:hover,
.menu-search-result:focus {
  background: #eef4ff;
}

.nav-link {
  color: #0b3b75;
  font-weight: 700;
  text-decoration: none;
}

.nav-icon-link {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  position: relative;
  text-decoration: none;
}

.nav-active-docs-link {
  min-height: 46px;
  min-width: 46px;
}

.nav-count-badge {
  align-items: center;
  background: #d92d20;
  border: 1px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  display: flex;
  font-size: 6px;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  min-height: 9px;
  min-width: 9px;
  padding: 1px 3px;
  position: absolute;
  right: -4px;
  top: 3px;
}

.nav-active-docs-link .mini-docs-icon {
  transform: scale(1.12);
}

.nav-primary-count-badge {
  border-width: 2px;
  font-size: 9px;
  min-height: 16px;
  min-width: 16px;
  padding: 2px 5px;
  right: -7px;
  top: -1px;
}

.nav-count-badge[hidden] {
  display: none;
}

.mini-upload-icon {
  display: inline-block;
  height: 30px;
  position: relative;
  width: 30px;
}

.mini-upload-page {
  background: #ffffff;
  border: 2px solid #0b3b75;
  border-radius: 4px;
  display: block;
  height: 22px;
  width: 18px;
}

.mini-upload-arrow {
  align-items: center;
  background: #0f62fe;
  border-radius: 999px;
  bottom: 0;
  color: #ffffff;
  display: inline-flex;
  font-size: 17px;
  font-weight: 700;
  height: 19px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 0;
  width: 19px;
}

.mini-docs-icon,
.mini-export-icon,
.mini-unknown-icon {
  display: inline-block;
  height: 30px;
  position: relative;
  width: 30px;
}

.mini-docs-page,
.mini-export-page,
.mini-unknown-page {
  background: #ffffff;
  border: 2px solid #0b3b75;
  border-radius: 4px;
  display: block;
  height: 24px;
  width: 20px;
}

.mini-docs-page::before,
.mini-export-page::before,
.mini-unknown-page::before {
  background: #8aa4c8;
  border-radius: 999px;
  box-shadow: 0 6px 0 #8aa4c8, 0 12px 0 #8aa4c8;
  content: "";
  display: block;
  height: 3px;
  margin: 6px 4px 0;
}

.mini-docs-check,
.mini-export-arrow,
.mini-unknown-mark {
  align-items: center;
  border-radius: 999px;
  bottom: 0;
  color: #ffffff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  height: 19px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 0;
  width: 19px;
}

.mini-docs-check {
  background: #12805c;
}

.mini-export-arrow {
  background: #0f62fe;
}

.mini-unknown-mark {
  background: #b54708;
}

.mini-alert-icon {
  align-items: center;
  background: #b42318;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 24px;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  line-height: 1;
  width: 30px;
}

.mini-rejected-email-icon {
  align-items: center;
  background: #b42318;
  border-radius: 999px;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.mini-rejected-email-icon::before {
  background: #ffffff;
  border-radius: 2px;
  content: "";
  display: block;
  height: 6px;
  width: 20px;
}

.mini-excel-icon {
  align-items: center;
  background: #107c41;
  border: 2px solid #0b5c2f;
  border-radius: 4px;
  color: #ffffff;
  display: inline-flex;
  font-size: 19px;
  font-weight: 800;
  height: 26px;
  justify-content: center;
  line-height: 1;
  width: 26px;
}

.mini-duplicate-icon {
  align-items: center;
  color: #0b3b75;
  display: flex;
  font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
  font-size: 27px;
  height: 30px;
  justify-content: center;
  line-height: 30px;
  width: 30px;
}

.mini-processing-icon {
  align-items: center;
  color: #0b3b75;
  display: flex;
  font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
  font-size: 25px;
  height: 30px;
  justify-content: center;
  line-height: 30px;
  width: 30px;
}

.duplicate-choice-icon {
  font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

.mini-stats-icon {
  align-items: end;
  border-bottom: 2px solid #0b3b75;
  display: inline-grid;
  gap: 3px;
  grid-template-columns: repeat(3, 6px);
  height: 30px;
  padding: 4px 4px 5px;
  width: 30px;
}

.mini-stats-icon span {
  background: #0f62fe;
  border-radius: 3px 3px 0 0;
  display: block;
}

.mini-stats-icon span:nth-child(1) {
  height: 10px;
}

.mini-stats-icon span:nth-child(2) {
  height: 17px;
}

.mini-stats-icon span:nth-child(3) {
  height: 23px;
}

.mini-trash-icon {
  display: inline-block;
  height: 30px;
  position: relative;
  width: 28px;
}

.mini-trash-icon::before {
  background: #5b8fd9;
  border: 2px solid #0b3b75;
  border-radius: 4px 4px 2px 2px;
  content: "";
  height: 5px;
  left: 3px;
  position: absolute;
  top: 2px;
  width: 22px;
}

.mini-trash-icon::after {
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #dcecff 100%);
  border: 2px solid #0b3b75;
  border-radius: 3px 3px 6px 6px;
  box-shadow: inset 0 0 0 1px rgba(15, 98, 254, 0.16);
  color: #0f62fe;
  content: "\267b";
  display: flex;
  font-size: 13px;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  left: 5px;
  line-height: 1;
  position: absolute;
  top: 8px;
  width: 18px;
}

.mini-trash-icon span {
  background: rgba(11, 59, 117, 0.28);
  display: block;
  height: 15px;
  position: absolute;
  top: 11px;
  width: 2px;
  z-index: 1;
}

.mini-trash-icon span:first-child {
  left: 10px;
}

.mini-trash-icon span:last-child {
  right: 10px;
}

.settings-icon-link {
  color: #0b3b75;
  font-size: 24px;
  font-weight: 700;
}

.nav-counterparty-docs-link {
  font-size: 15px;
  letter-spacing: 0;
}

.nav-pvm-refresh-form {
  margin: 0;
}

.admin-view-scope-menu {
  position: relative;
}

.admin-view-scope-trigger {
  cursor: pointer;
  list-style: none;
}

.admin-view-scope-trigger::-webkit-details-marker {
  display: none;
}

.mini-eye-icon {
  border: 2px solid #0b3b75;
  border-radius: 50% / 58%;
  display: inline-flex;
  height: 15px;
  position: relative;
  transform: skewX(-10deg);
  width: 29px;
}

.mini-eye-icon::before {
  background: #0b3b75;
  box-shadow: 8px 1px 0 #0b3b75;
  content: "";
  height: 7px;
  left: 4px;
  position: absolute;
  top: -8px;
  transform: rotate(-24deg);
  width: 2px;
}

.mini-eye-icon::after {
  background: #0b3b75;
  border-radius: 999px;
  content: "";
  height: 7px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) skewX(10deg);
  width: 7px;
}

.admin-view-scope-badge {
  right: -3px;
  top: 1px;
}

.admin-view-scope-form {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #d9e1ef;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(20, 33, 61, 0.16);
  display: grid;
  gap: 10px;
  margin: 0;
  min-width: 280px;
  padding: 12px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

.admin-view-scope-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #475569;
}

.admin-view-scope-form select {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 13px;
  width: 100%;
}

.nav-pvm-refresh-button {
  align-items: center;
  background: #ffffff;
  border: 2px solid #0b3b75;
  border-radius: 4px;
  color: #0b3b75;
  cursor: pointer;
  display: inline-grid;
  font-size: 12px;
  font-weight: 800;
  gap: 1px;
  grid-template-rows: auto auto;
  height: 36px;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  min-width: 54px;
  padding: 4px 7px;
}

.nav-pvm-refresh-button:hover {
  background: #e8eef8;
}

.nav-pvm-refresh-button.has-error {
  border-color: #b42318;
  color: #b42318;
}

.nav-pvm-date {
  font-size: 9px;
  font-weight: 700;
}

.right-nav {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.secondary-button {
  background: #e8eef8;
  color: #0b3b75;
}

.panel {
  background: #ffffff;
  border: 1px solid #d9e1ef;
  border-radius: 8px;
  margin-bottom: 24px;
  overflow-x: visible;
  padding: 24px;
}

.choice-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.choice-card {
  border: 1px solid #d9e1ef;
  border-radius: 6px;
  color: #14213d;
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 9px 10px;
  text-decoration: none;
}

.choice-card .button-link {
  margin-right: 8px;
}

.choice-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.choice-card .choice-actions:last-child {
  color: inherit;
}

.choice-card:hover {
  border-color: #0f62fe;
}

.choice-card strong {
  font-size: 13px;
}

.choice-heading {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.choice-icon {
  align-items: center;
  background: #e8eef8;
  border: 1px solid #d0d9e8;
  border-radius: 6px;
  color: #0b3b75;
  display: inline-flex;
  font-size: 12px;
  height: 22px;
  justify-content: center;
  line-height: 1;
  width: 22px;
}


.imap-status-card {
  background: #fff8e6;
  border-color: #f2c94c;
}

.imap-status-card .choice-icon {
  background: #f2c94c;
  border-color: #d9a90f;
  color: #14213d;
}
.choice-card span:last-child {
  color: #62708a;
  font-size: 11px;
  line-height: 1.25;
}

.choice-card .choice-actions {
  color: inherit;
}

.choice-card .choice-actions .button-link {
  font-size: 11px;
  min-height: 28px;
  padding: 5px 8px;
}

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

.instruction-document {
  border-top: 1px solid #d9e1ef;
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
}

.instruction-document h2 {
  font-size: 24px;
  margin: 0 0 8px;
}

.instruction-document h3 {
  border-top: 1px solid #e5ebf5;
  font-size: 18px;
  margin: 18px 0 4px;
  padding-top: 18px;
}

.instruction-document h4 {
  color: #14213d;
  font-size: 14px;
  margin: 12px 0 0;
}

.instruction-document p {
  margin: 0;
}

.instruction-bullet {
  padding-left: 18px;
  position: relative;
}

.instruction-bullet::before {
  content: "-";
  left: 4px;
  position: absolute;
}

.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.stat-card {
  border: 1px solid #d9e1ef;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 18px;
}

.stat-card span {
  color: #475467;
  font-weight: 700;
}

.stat-card strong {
  color: #0b3b75;
  font-size: 34px;
  line-height: 1;
}

.disabled-card {
  background: #f7f9fc;
  color: #62708a;
}

.button-link {
  align-items: center;
  background: #0f62fe;
  border-radius: 6px;
  color: #ffffff;
  display: inline-flex;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
  text-decoration: none;
}

.auth-panel {
  background: #ffffff;
  border: 1px solid #d9e1ef;
  border-radius: 8px;
  margin: 72px auto 0;
  max-width: 420px;
  padding: 24px;
}

h1,
h2 {
  margin: 0 0 12px;
}

.login-title {
  align-items: center;
  display: flex;
  gap: 10px;
}

.login-title-mark {
  display: block;
  height: 84px;
  object-fit: contain;
  width: 180px;
}

.muted {
  color: #62708a;
}

.upload {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.upload-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.dropzone {
  align-items: center;
  border: 2px dashed #8aa4c8;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 3px;
  justify-items: center;
  min-height: 74px;
  padding: 10px;
  text-align: center;
}

.dropzone:hover {
  background: #f0f6ff;
}

.dropzone.drag-active {
  background: #e8f2ff;
  border-color: #0f62fe;
}

.upload-icon {
  align-items: center;
  display: inline-grid;
  justify-items: center;
  min-height: 36px;
  position: relative;
  width: 40px;
}

.upload-icon-page {
  background: #ffffff;
  border: 2px solid #0b3b75;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(20, 33, 61, 0.12);
  display: grid;
  gap: 3px;
  height: 27px;
  padding: 6px 5px 5px;
  width: 22px;
}

.upload-icon-page span {
  background: #8aa4c8;
  border-radius: 999px;
  height: 3px;
}

.upload-icon-arrow {
  align-items: center;
  background: #0f62fe;
  border-radius: 999px;
  bottom: 0;
  color: #ffffff;
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 1px;
  width: 20px;
}

.dropzone-title {
  color: #0b3b75;
  font-size: 15px;
  font-weight: 700;
}

.upload-primary-submit {
  min-height: 44px;
}

.mobile-upload-action {
  align-items: center;
  background: #0f62fe;
  border-radius: 6px;
  color: #ffffff;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
}

.dropzone input {
  height: 1px;
  opacity: 0.01;
  position: absolute;
  width: 1px;
}

.selected-files {
  font-size: 14px;
  line-height: 1.35;
  max-height: 52px;
  overflow: auto;
}

.upload-progress-status {
  font-size: 14px;
  line-height: 1.35;
}

button {
  background: #0f62fe;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
}

.small-button {
  font-size: 13px;
  margin: 4px 8px 4px 0;
  min-height: 34px;
  padding: 0 10px;
}

.icon-only-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 34px;
  padding: 0;
  width: 34px;
}

.bulk-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.bulk-client-select {
  max-width: 360px;
}

.bulk-type-select {
  max-width: 72px;
}

.compact-bulk-panel {
  padding-bottom: 12px;
  padding-top: 12px;
}

.list-toolbar {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 12px 0;
}

.list-toolbar .advanced-filter {
  margin-top: 0;
}

.list-toolbar .document-filter-form {
  flex-basis: 100%;
  min-width: min(820px, calc(100vw - 96px));
}

.list-subsection {
  border-top: 1px solid #d9e1ef;
  margin-top: 18px;
  padding-top: 16px;
}

.list-subsection h3 {
  margin: 0 0 8px;
}

.filter-bar {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
}

.filter-chip {
  align-items: center;
  border: 1px solid #d9e1ef;
  border-radius: 8px;
  color: #14213d;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 46px;
  padding: 0 12px;
  text-decoration: none;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: #0f62fe;
  box-shadow: inset 0 0 0 1px #0f62fe;
}

.filter-chip strong {
  background: #e8eef8;
  border-radius: 999px;
  color: #0b3b75;
  min-width: 28px;
  padding: 4px 8px;
  text-align: center;
}

.filter-icon {
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #0b3b75;
  display: inline-block;
  height: 0;
  position: relative;
  width: 0;
}

.filter-icon::after {
  background: #0b3b75;
  content: "";
  height: 8px;
  left: -2px;
  position: absolute;
  top: -1px;
  width: 4px;
}

.small-filter-icon {
  border-left-width: 6px;
  border-right-width: 6px;
  border-top-width: 8px;
  margin-right: 6px;
  transform: translateY(2px);
}

.small-filter-icon::after {
  height: 6px;
}

.document-filter-form {
  border-top: 1px solid #d9e1ef;
  display: grid;
  gap: 8px 10px;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  margin-top: 12px;
  padding-top: 12px;
}

.advanced-filter {
  margin-top: 18px;
}

.advanced-filter-summary {
  align-items: center;
  background: #e8eef8;
  border: 1px solid #d0d9e8;
  border-radius: 6px;
  color: #0b3b75;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  font-size: 12px;
  gap: 10px;
  min-height: 32px;
  padding: 0 10px;
}

.advanced-filter-summary::-webkit-details-marker {
  display: none;
}

.advanced-filter-summary::marker {
  content: "";
}

.document-filter-form label > span {
  align-items: center;
  display: inline-flex;
  font-size: 11px;
  gap: 4px;
  min-height: 14px;
}

.filter-actions {
  align-items: end;
  display: flex;
  gap: 8px;
}

.document-filter-form label {
  font-size: 11px;
  gap: 3px;
  min-width: 0;
}

.document-filter-form input,
.document-filter-form select {
  font-size: 12px;
  min-height: 30px;
  padding: 4px 7px;
}

.document-filter-form .filter-actions {
  gap: 6px;
}

.document-filter-form .filter-actions button,
.document-filter-form .filter-actions .button-link {
  font-size: 12px;
  min-height: 30px;
  padding: 5px 9px;
}

.secondary-link {
  background: #e8eef8;
  color: #0b3b75;
}

.instruction-list {
  color: #2f3b52;
  line-height: 1.6;
  margin: 12px 0 0;
  padding-left: 22px;
}

.instruction-list li + li {
  margin-top: 8px;
}

.registry-status-panel {
  border-top: 1px solid #d9e1ef;
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
}

.registry-status-panel form {
  margin: 0;
}

.settings-page .panel {
  font-size: 11px;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.settings-page {
  display: flex;
  flex-direction: column;
}

.settings-registry-panel {
  order: 70;
}

.settings-email-panel {
  order: 80;
}

.settings-infrastructure-panel {
  order: 90;
}

.settings-admin-security-panel {
  order: 100;
}

.settings-page h1,
.settings-page h2 {
  font-size: 16px;
  margin-bottom: 5px;
}

.settings-page h3 {
  font-size: 12px;
  margin: 6px 0 4px;
}

.settings-page .muted {
  font-size: 11px;
  line-height: 1.35;
  margin-bottom: 6px;
}

.settings-page .grid-form {
  gap: 6px 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-page .grid-form label,
.settings-page .grid-form .checkbox-label,
.settings-page .form-note,
.settings-page summary,
.settings-page details,
.settings-page p,
.settings-page li {
  font-size: 11px;
  gap: 4px;
}

.settings-page input,
.settings-page select,
.settings-page textarea {
  font-size: 11px;
  min-height: 28px;
  padding: 4px 7px;
}

.settings-page textarea {
  min-height: 46px;
}

.settings-page .form-section-title {
  font-size: 11px;
  margin-top: 2px;
}

.settings-page table {
  font-size: 11px;
}

.settings-page th,
.settings-page td {
  padding: 4px 6px;
}

.settings-page .status {
  font-size: 11px;
  padding: 4px 6px;
}

.settings-page button,
.settings-page .button-link,
.settings-page .secondary-button {
  font-size: 11px;
  min-height: 28px;
  padding: 4px 9px;
}

.settings-page .registry-status-panel {
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
}

.settings-status-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 6px 0 8px;
}

.settings-status-item {
  align-items: start;
  border: 1px solid #d9e1ef;
  border-radius: 4px;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 5px 6px;
}

.settings-status-item strong,
.settings-status-item span {
  font-size: 10px;
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-status-item > span:not(.status) {
  color: #62708a;
}

.settings-status-item .inline-status {
  display: inline-flex;
  justify-self: start;
  line-height: 1.15;
  padding: 3px 5px;
}

.settings-security-users {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.settings-security-users details {
  border-top: 1px solid #d9e1ef;
  padding-top: 5px;
}

.security-reminder-panel {
  background: #fff8e6;
  border: 1px solid #f2c94c;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 8px 10px;
}

.security-reminder-list {
  display: grid;
  gap: 5px;
}

.security-reminder-form {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.4fr) auto;
}

.compact-security-table {
  margin-top: 5px;
}

.compact-security-table td:first-child {
  display: grid;
  gap: 2px;
}

.settings-page .choice-grid {
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-page .choice-card {
  border-radius: 6px;
  gap: 6px;
  min-height: 0;
  padding: 10px;
}

.settings-page .choice-card strong {
  font-size: 12px;
}

.settings-page .choice-card span {
  font-size: 11px;
}

.settings-link-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.settings-link-row {
  align-items: center;
  border: 1px solid #d9e1ef;
  border-radius: 4px;
  color: #14213d;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(170px, 240px) auto minmax(220px, 1fr);
  min-height: 34px;
  padding: 5px 7px;
  text-decoration: none;
}

.settings-link-row:hover {
  border-color: #0f62fe;
}

.settings-link-row strong,
.settings-link-row span {
  font-size: 11px;
  line-height: 1.25;
}

.settings-link-row strong {
  font-size: 13px;
}

.settings-link-row > span {
  color: #62708a;
}

.settings-link-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.counterparty-registry-results {
  background: #ffffff;
  border: 1px solid #b7c4d8;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.14);
  display: grid;
  gap: 2px;
  margin-top: 4px;
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  position: relative;
  z-index: 30;
}

.counterparty-registry-results[hidden] {
  display: none;
}

.counterparty-registry-result {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #14213d;
  cursor: pointer;
  font: inherit;
  padding: 7px 8px;
  text-align: left;
}

.counterparty-registry-result:hover,
.counterparty-registry-result:focus {
  background: #eaf1fb;
  outline: none;
}

.counterparty-registry-message {
  border-radius: 4px;
  color: #4a5568;
  font-size: 0.9rem;
  padding: 8px;
}

.counterparty-registry-message.loading {
  color: #1f5f9f;
}

.counterparty-registry-message.warning {
  color: #8a5a00;
}

.counterparty-registry-message.error {
  color: #b42318;
}

.column-header-label {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

.sortable-header {
  color: #0b3b75;
  text-decoration: none;
}

.sortable-header:hover {
  color: #0f62fe;
  text-decoration: underline;
}

.column-filter-icon {
  border-left-width: 5px;
  border-right-width: 5px;
  border-top-width: 7px;
  opacity: 0.7;
}

.column-filter-icon::after {
  height: 5px;
  left: -1px;
  width: 2px;
}

.column-filter-row th {
  background: #f7f9fc;
  padding: 8px 6px;
  vertical-align: top;
}

.column-filter-control {
  font-size: 13px;
  min-height: 32px;
  min-width: 88px;
  padding: 5px 7px;
}

.column-filter-submit {
  background: #0f62fe;
  margin-right: 4px;
}

.column-filter-submit .column-filter-icon {
  border-top-color: #ffffff;
  opacity: 1;
}

.column-filter-submit .column-filter-icon::after {
  background: #ffffff;
}

.select-all-label {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

.data-table th:has(.select-all-label input[type="checkbox"]),
.data-table td:has(input[type="checkbox"]) {
  max-width: 38px;
  min-width: 38px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  width: 38px;
}

.data-table th:has(.select-all-label input[type="checkbox"]) .select-all-label {
  display: inline-flex;
  font-size: 0;
  gap: 0;
  justify-content: center;
  line-height: 1;
  width: 18px;
}

.select-all-label input,
.data-table input[type="checkbox"] {
  min-height: 0;
  width: auto;
}

input,
select {
  border: 1px solid #bdc7d8;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 15px;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.password-generator {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(180px, 1fr) auto;
  position: relative;
}

.compact-password-generator {
  grid-template-columns: minmax(150px, 1fr) auto;
}

.password-copy-note {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.compact-password-generator .password-copy-note {
  grid-column: 1 / -1;
}

.generate-password-button {
  min-width: 96px;
  white-space: nowrap;
}

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

.full-row {
  grid-column: 1 / -1;
}

.top-select {
  max-width: 520px;
}

.horizontal-field {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 520px);
}

.checkbox-group {
  border: 1px solid #bdc7d8;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 12px;
}

.checkbox-label {
  align-items: center;
  display: flex;
  flex-direction: row;
  font-weight: 400;
}

.checkbox-label input {
  min-height: auto;
  width: auto;
}

.email-freeze-label {
  color: #b42318;
  font-weight: 700;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form-section-title {
  border-top: 1px solid #d9e1ef;
  color: #14213d;
  font-size: 18px;
  font-weight: 700;
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 18px;
}

.form-note {
  grid-column: 1 / -1;
  margin: 0;
}

label {
  color: #334155;
  display: grid;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
}

.client-select-search {
  margin-bottom: 6px;
}

.actions,
.export {
  align-self: end;
}

.heading-row {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.status {
  border-radius: 6px;
  display: inline-block;
  font-weight: 700;
  padding: 10px 12px;
}

.neutral-status {
  background: #eef4ff;
  color: #0b3b75;
}

.risk-flag {
  align-items: center;
  background: #b42318;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 14px;
  height: 22px;
  justify-content: center;
  line-height: 1;
  margin-right: 6px;
  width: 22px;
}

.compact-status {
  font-size: 13px;
  padding: 6px 8px;
}

.inline-status {
  font-size: 13px;
  margin-left: 8px;
  padding: 5px 8px;
}

.success {
  background: #e6f4ea;
  color: #137333;
}

.upload-success-symbols {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.upload-success-sun {
  color: #fbbc04;
  font-size: 1.5em;
  line-height: 1;
}

.upload-success-clap {
  font-size: 1em;
  line-height: 1;
}

.error {
  background: #fde8e8;
  color: #b42318;
  margin-bottom: 16px;
}

.warning {
  background: #fff7d6;
  color: #8a5a00;
  margin-bottom: 16px;
}

.late-invoice-warning {
  align-items: center;
  background: #d92d20;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  line-height: 1;
  margin-left: 6px;
  position: relative;
  vertical-align: middle;
  width: 18px;
}

.late-invoice-warning[data-tooltip]::after {
  background: #14213d;
  border-radius: 4px;
  bottom: calc(100% + 6px);
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 700;
  left: 50%;
  line-height: 1.2;
  opacity: 0;
  padding: 5px 7px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity 0.12s ease;
  white-space: nowrap;
  z-index: 20;
}

.late-invoice-warning[data-tooltip]::before {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #14213d;
  bottom: calc(100% + 2px);
  content: "";
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity 0.12s ease;
  z-index: 20;
}

.late-invoice-warning[data-tooltip]:hover::after,
.late-invoice-warning[data-tooltip]:hover::before,
.late-invoice-warning[data-tooltip]:focus-visible::after,
.late-invoice-warning[data-tooltip]:focus-visible::before {
  opacity: 1;
}

.field-label-with-warning {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.text-link {
  color: #0b3b75;
  font-weight: 700;
  text-decoration: none;
}

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

.table-scroll-top {
  height: 16px;
  margin: 12px 0 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.table-scroll-top-inner {
  height: 1px;
}

.table-scroll-wrapper {
  overflow-x: auto;
  scrollbar-width: none;
}

.table-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #d9e1ef;
  padding: 10px 6px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: #334155;
  font-size: 14px;
}

.statistics-table {
  font-size: 12px;
}

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

.statistics-table th {
  font-size: 12px;
}

.statistics-extra-form {
  display: grid;
  grid-template-columns: 7rem minmax(12rem, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
}

.statistics-extra-form input {
  min-width: 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.78rem;
}

.statistics-extra-amount-input {
  max-width: 7rem;
}

.statistics-extra-note {
  max-width: 14rem;
  color: #64748b;
  font-size: 0.72rem;
  white-space: normal;
}

.vat-breakdown-panel {
  border: 1px solid #d9e1ef;
  border-radius: 8px;
  padding: 12px;
}

.vat-breakdown-panel h2,
.vat-breakdown-panel h3 {
  font-size: 16px;
  margin: 0 0 8px;
}

.vat-breakdown-table-wrap {
  overflow-x: auto;
}

.vat-breakdown-table {
  min-width: 440px;
}

.vat-breakdown-table th,
.vat-breakdown-table td {
  padding: 7px 6px;
  white-space: nowrap;
}

.documents-list-table,
.compact-record-table {
  table-layout: fixed;
}

.documents-list-table {
  min-width: 1460px;
}

.compact-record-table {
  min-width: 1100px;
}

.documents-list-table th,
.documents-list-table td,
.compact-record-table th,
.compact-record-table td {
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: normal;
}

.client-document-browser {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(140px, 190px) minmax(0, 1fr);
}

.client-document-sidebar {
  border-right: 1px solid #d9e1ef;
  display: grid;
  gap: 4px;
  max-height: 68vh;
  overflow: auto;
  padding-right: 10px;
}

.client-document-sidebar-heading {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.client-document-sidebar-search {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.client-document-sidebar-search span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.client-document-sidebar-search input {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  min-height: 30px;
  padding: 5px 7px;
}

.sidebar-filter-form {
  border-bottom: 1px solid #d9e1ef;
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.sidebar-filter-form label {
  display: grid;
  gap: 4px;
  margin: 0;
}

.sidebar-filter-form label span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-filter-form select,
.sidebar-filter-form input[type="search"] {
  font-size: 12px;
  min-height: 30px;
  padding: 5px 7px;
}

.sidebar-filter-form .small-button,
.sidebar-filter-form .button-link {
  font-size: 12px;
  justify-content: center;
  min-height: 30px;
  padding: 5px 8px;
}

.counterparty-filter-toolbar {
  justify-content: flex-end;
  margin-bottom: 8px;
}

.client-document-sidebar-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #14213d;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 12px;
  gap: 8px;
  justify-content: space-between;
  min-height: 36px;
  padding: 7px 8px;
  text-align: left;
}

.client-sidebar-row {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.client-sidebar-row .client-document-sidebar-item {
  min-width: 0;
  width: 100%;
}

.client-sidebar-delete-form {
  margin: 0;
}

.client-sidebar-delete-form .icon-button {
  font-size: 11px;
  min-height: 26px;
  min-width: 26px;
  padding: 0;
}

.client-document-sidebar-item:hover,
.client-document-sidebar-item:focus-visible,
.client-document-sidebar-item.active {
  background: #eef4fb;
}

.client-document-sidebar-name {
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.client-document-sidebar-count {
  color: #62708a;
  font-size: 11px;
  white-space: nowrap;
}

.client-document-groups {
  min-width: 0;
}

.client-document-group {
  display: none;
}

.client-document-group.active {
  display: block;
}

.admin-split-detail {
  display: none;
}

.admin-split-detail.active {
  display: block;
}

.client-document-empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  font-size: 12px;
  padding: 14px;
}

.client-document-empty-state.hidden {
  display: none;
}

tr[data-document-group-row] {
  display: none;
}

tr[data-document-group-row].active {
  display: table-row;
}

.client-document-group-summary {
  align-items: center;
  display: flex;
  gap: 10px;
  min-height: 34px;
}

.client-document-group-name {
  color: #14213d;
  font-weight: 700;
}

.client-document-group-count {
  color: #62708a;
  font-size: 12px;
}

.client-document-group-table {
  margin-top: 8px;
}

.compact-client-login-browser {
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
}

.compact-staff-create-browser {
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
}

.compact-client-login-browser .client-document-sidebar-item {
  font-size: 11px;
  min-height: 30px;
  padding: 5px 7px;
}

.compact-client-login-browser .client-document-sidebar-count {
  font-size: 10px;
}

.compact-client-login-form,
.compact-client-card-form,
.compact-staff-create-form {
  gap: 8px 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-client-login-form label,
.compact-client-login-form .form-note,
.compact-client-login-form .checkbox-label,
.compact-client-card-form label,
.compact-client-card-form .form-note,
.compact-client-card-form .checkbox-label,
.compact-staff-create-form label {
  font-size: 12px;
}

.compact-client-login-form input,
.compact-client-login-form select,
.compact-client-card-form input,
.compact-client-card-form select,
.compact-staff-create-form input,
.compact-staff-create-form select {
  font-size: 12px;
  min-height: 32px;
  padding: 5px 8px;
}

.compact-client-login-form .form-section-title,
.compact-client-card-form .form-section-title {
  font-size: 12px;
  margin-top: 4px;
}

.compact-staff-create-form .password-generator {
  grid-template-columns: minmax(0, 1fr) auto;
}

@media (max-width: 900px) {
  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .client-document-browser {
    grid-template-columns: 1fr;
  }

  .client-document-sidebar {
    border-right: 0;
    border-bottom: 1px solid #d9e1ef;
    grid-auto-flow: column;
    grid-auto-columns: minmax(130px, 1fr);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    padding-right: 0;
  }
}

.documents-list-table .documents-client-column,
.documents-list-table .documents-partner-column {
  font-size: 12px;
  line-height: 1.3;
  max-width: 125px;
  min-width: 86px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 9%;
  word-break: normal;
}

.documents-list-table .documents-label-column {
  font-size: 10px;
  line-height: 1.2;
  max-width: 110px;
  min-width: 70px;
  text-transform: lowercase;
  width: 7%;
}

.documents-list-table .document-label-preview {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.client-card-link {
  color: #0b3b75;
  font-weight: 700;
  text-decoration: none;
}

.client-card-link:hover,
.client-card-link:focus-visible {
  text-decoration: underline;
}

.invoice-number-link {
  color: #0b3b75;
  font-weight: 700;
  text-decoration: none;
}

.invoice-number-link:hover,
.invoice-number-link:focus-visible {
  text-decoration: underline;
}

.document-file-view-link {
  color: #0b3b75;
  font-weight: 700;
  text-decoration: none;
}

.document-file-view-link:hover,
.document-file-view-link:focus-visible {
  text-decoration: underline;
}

.download-file-icon {
  position: relative;
}

.download-file-icon span {
  border-bottom: 2px solid #0b3b75;
  display: inline-block;
  height: 18px;
  position: relative;
  width: 18px;
}

.download-file-icon span::before {
  background: #0b3b75;
  content: "";
  height: 12px;
  left: 50%;
  position: absolute;
  top: 1px;
  transform: translateX(-50%);
  width: 2px;
}

.download-file-icon span::after {
  border-bottom: 2px solid #0b3b75;
  border-right: 2px solid #0b3b75;
  content: "";
  height: 7px;
  left: 50%;
  position: absolute;
  top: 7px;
  transform: translateX(-50%) rotate(45deg);
  width: 7px;
}

.vat-warning-cell {
  color: #b42318;
  font-weight: 700;
}

.partner-warning-cell {
  color: #b42318;
  font-weight: 700;
}

.client-warning-cell,
.client-warning-cell .client-card-link {
  color: #b42318;
  font-weight: 700;
}

.late-invoice-date {
  color: #b42318;
  font-weight: 700;
}

.documents-list-table .documents-number-column {
  font-size: 12px;
  line-height: 1.3;
  max-width: 112px;
  min-width: 86px;
  overflow-wrap: anywhere;
  padding-left: 4px;
  padding-right: 10px;
  text-align: right;
  white-space: normal;
  width: 6%;
}

.documents-list-table .documents-type-column {
  font-weight: 700;
  max-width: 66px;
  min-width: 56px;
  overflow: hidden;
  padding-left: 4px;
  padding-right: 4px;
  text-align: left;
  white-space: nowrap;
  width: 4%;
}

.documents-list-table .invoice-type-inline-select {
  font-size: 13px;
  font-weight: 700;
  min-height: 30px;
  min-width: 48px;
  padding: 4px 20px 4px 7px;
  text-align: left;
  width: 48px;
}

.documents-list-table .unknown-invoice-type-select {
  border-color: #b42318;
  color: #b42318;
  font-weight: 800;
}

.documents-list-table .documents-date-column,
.documents-list-table .documents-received-column {
  font-size: 12px;
  line-height: 1.25;
  max-width: 112px;
  min-width: 92px;
  white-space: normal;
  width: 7%;
}

.documents-list-table .documents-document-column {
  font-size: 12px;
  line-height: 1.25;
  max-width: 72px;
  min-width: 58px;
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
  width: 4%;
}

.documents-list-table .documents-amount-column,
.documents-list-table .documents-vat-rate-column {
  font-size: 12px;
  line-height: 1.25;
  max-width: 78px;
  min-width: 54px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 5%;
}

.documents-list-table .documents-vat-rate-column {
  max-width: 64px;
  min-width: 46px;
  width: 4%;
}

.documents-list-table .documents-account-column {
  font-size: 12px;
  line-height: 1.25;
  max-width: 92px;
  min-width: 68px;
  width: 5%;
}

.documents-list-table .document-account-code-input {
  max-width: 82px;
  min-width: 0;
  padding: 5px 6px;
}

.documents-list-table .documents-file-column {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  max-width: 150px;
  min-width: 82px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 10%;
  word-break: normal;
}

.documents-list-table .documents-sender-column {
  font-size: 12px;
  line-height: 1.3;
  max-width: 120px;
  min-width: 82px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 8%;
  word-break: normal;
}

.documents-list-table .documents-exported-column {
  font-size: 12px;
  line-height: 1.3;
  max-width: 120px;
  min-width: 82px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 8%;
  word-break: normal;
}

.documents-list-table .documents-marker-column {
  font-size: 11px;
  line-height: 1.15;
  max-width: 58px;
  min-width: 42px;
  text-align: center;
  width: 4%;
}

.documents-list-table .documents-marker-column .compact-status {
  font-size: 9px;
  padding: 2px 3px;
}

.documents-list-table .column-filter-control,
.compact-record-table .column-filter-control {
  font-size: 12px;
  max-width: 100%;
  min-height: 30px;
  min-width: 0;
  padding: 4px 6px;
  width: 100%;
}

.documents-list-table .table-actions,
.compact-record-table .table-actions {
  gap: 4px;
}

.documents-list-table .documents-type-column .column-header-label,
.documents-list-table .documents-document-column .column-header-label,
.documents-list-table .documents-number-column .column-header-label,
.documents-list-table .documents-date-column .column-header-label,
.documents-list-table .documents-received-column .column-header-label {
  white-space: normal;
}

.documents-list-table .documents-number-column .column-header-label {
  justify-content: flex-end;
  width: 100%;
}

.duplicate-documents-table .documents-number-column .invoice-number-link {
  font-size: inherit;
  font-weight: 400;
}

.compact-record-table .compact-date-column {
  font-size: 12px;
  line-height: 1.25;
  max-width: 98px;
  min-width: 76px;
  white-space: normal;
  width: 8%;
}

.compact-record-table .compact-file-column {
  font-size: 12px;
  line-height: 1.3;
  max-width: 170px;
  min-width: 82px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 13%;
  word-break: normal;
}

.compact-record-table .compact-name-column,
.compact-record-table .compact-sender-column {
  font-size: 12px;
  line-height: 1.3;
  max-width: 135px;
  min-width: 82px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 11%;
  word-break: normal;
}

.compact-record-table .compact-sender-column {
  max-width: 120px;
  width: 9%;
}

.compact-record-table .compact-number-column,
.compact-record-table .compact-amount-column {
  font-size: 12px;
  line-height: 1.25;
  max-width: 82px;
  min-width: 58px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 6%;
}

.compact-record-table .compact-status-column {
  font-size: 12px;
  line-height: 1.25;
  max-width: 110px;
  min-width: 74px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 8%;
}

.compact-record-table .compact-text-column,
.compact-record-table .compact-reason-column,
.compact-record-table .compact-message-column {
  font-size: 12px;
  line-height: 1.3;
  max-width: 180px;
  min-width: 92px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 13%;
  word-break: normal;
}

.compact-record-table .compact-message-column {
  max-width: 240px;
  width: 18%;
}

.compact-record-table .compact-status {
  font-size: 11px;
  padding: 4px 6px;
}

.email-imports-table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.email-import-filter-bar {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.email-import-filter-bar .filter-chip {
  min-height: 40px;
}

.email-imports-table th,
.email-imports-table td {
  font-size: 11px;
  line-height: 1.25;
  padding: 7px 4px;
  overflow-wrap: anywhere;
  word-break: normal;
}

.email-imports-table .compact-status-column {
  max-width: none;
  min-width: 0;
  width: 7%;
}

.email-imports-table .email-import-select-column {
  max-width: 34px;
  min-width: 34px;
  text-align: center;
  width: 34px;
}

.email-imports-table .compact-date-column {
  max-width: none;
  min-width: 0;
  width: 7%;
}

.email-imports-table .compact-sender-column {
  max-width: none;
  min-width: 0;
  width: 11%;
}

.email-imports-table .compact-text-column {
  max-width: none;
  min-width: 0;
  width: 13%;
}

.email-imports-table .compact-file-column {
  max-width: none;
  min-width: 0;
  width: 12%;
}

.email-imports-table .compact-name-column {
  max-width: none;
  min-width: 0;
  width: 12%;
}

.email-imports-table .compact-reason-column {
  max-width: none;
  min-width: 0;
  width: 10%;
}

.documents-list-table .documents-file-column a {
  font-size: 11px;
  font-weight: 400;
}

.email-imports-table .compact-message-column {
  max-width: none;
  min-width: 0;
  width: 16%;
}

.email-imports-table .email-actions-column {
  max-width: none;
  min-width: 0;
  width: 8%;
}

.email-imports-table .inline-form {
  display: grid;
  margin: 0 0 4px;
}

.email-imports-table button {
  font-size: 11px;
  min-height: 28px;
  padding: 0 6px;
  width: 100%;
}

.email-rejection-actions {
  min-width: 100px;
}

.email-rejection-client-column {
  min-width: 170px;
}

.email-rejection-client-form {
  gap: 4px;
}

.email-rejection-client-form select,
.email-rejection-client-form .client-select-search {
  font-size: 11px;
  min-height: 28px;
  padding: 3px 6px;
  width: 100%;
}

.compact-help-text {
  font-size: 12px;
  line-height: 1.35;
  margin: 4px 0 0;
  max-width: 1100px;
}

.email-transfer-delete-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.email-transfer-delete-actions select,
.email-transfer-delete-actions .client-select-search {
  margin-left: auto;
}

#email-rejection-transfers .table-scroll-wrapper {
  margin-left: 0;
  width: 100%;
}

#email-rejection-transfers .email-imports-table {
  margin-left: 0;
}

#email-rejection-transfers .email-transfer-select-column {
  max-width: 28px;
  min-width: 28px;
  text-align: center;
  width: 28px;
}

#email-rejection-transfers .email-transfer-select-column .select-all-label {
  font-size: 0;
  justify-content: center;
}

#email-rejection-transfers .email-transfer-select-column input[type="checkbox"] {
  margin: 0;
}

#email-rejection-transfers .email-transfer-history-table {
  table-layout: fixed;
}

#email-rejection-transfers .transfer-date-column {
  max-width: 84px;
  min-width: 84px;
  width: 84px;
}

#email-rejection-transfers .transfer-sender-column,
#email-rejection-transfers .transfer-client-column,
#email-rejection-transfers .transfer-user-column {
  width: 16%;
}

#email-rejection-transfers .transfer-subject-column {
  width: 20%;
}

#email-rejection-transfers .transfer-file-column {
  width: 18%;
}

.email-transfer-delete-actions select,
.email-transfer-delete-actions .client-select-search {
  font-size: 11px;
  min-height: 28px;
  min-width: 220px;
  padding: 3px 6px;
}

.email-transfer-delete-actions button {
  min-height: 28px;
}

.unrecognized-table {
  font-size: 10px;
  table-layout: fixed;
}

.unrecognized-table th,
.unrecognized-table td {
  padding: 5px 4px;
}

.unrecognized-table .unrecognized-reason-column {
  line-height: 1.2;
  max-width: 420px;
  min-width: 320px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 34%;
  word-break: normal;
}

.unrecognized-table .unrecognized-file-column {
  font-size: 10px;
  line-height: 1.2;
  max-width: 180px;
  min-width: 100px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 10%;
  word-break: normal;
}

.unrecognized-table .unrecognized-date-column {
  font-size: 10px;
  line-height: 1.15;
  max-width: 86px;
  min-width: 74px;
  white-space: normal;
  width: 6%;
}

.unrecognized-table .unrecognized-select-column {
  max-width: 52px;
  min-width: 42px;
  text-align: center;
  width: 4%;
}

.unrecognized-table .unrecognized-select-column .select-all-label {
  display: grid;
  font-size: 10px;
  gap: 3px;
  justify-items: center;
  line-height: 1.1;
  white-space: normal;
}

.unrecognized-table .unrecognized-reason-column .muted {
  overflow-wrap: anywhere;
  white-space: normal;
}

.unrecognized-table .unrecognized-actions-column {
  line-height: 1.15;
  min-width: 390px;
  width: 46%;
}

.unrecognized-table .unrecognized-actions-column .inline-form {
  gap: 4px;
  margin: 1px 3px 1px 0;
}

.unrecognized-table .unrecognized-actions-column .inline-form select,
.unrecognized-table .unrecognized-actions-column .client-select-search {
  font-size: 10px;
  min-height: 24px;
  padding: 2px 5px;
}

.unrecognized-table .unrecognized-actions-column .unrecognized-client-select,
.unrecognized-table .unrecognized-actions-column .client-select-search {
  max-width: 110px;
  min-width: 110px;
  width: 110px;
}

.unrecognized-table .unrecognized-actions-column select[name="invoice_type"] {
  font-weight: 700;
  max-width: 46px;
  min-width: 46px;
  padding-left: 4px;
  padding-right: 4px;
  width: 46px;
}

.unrecognized-table .unrecognized-actions-column button,
.unrecognized-table .unrecognized-actions-column .icon-button,
.unrecognized-table .unrecognized-actions-column .action-icon-link {
  font-size: 10px;
  min-height: 24px;
  padding: 0 5px;
}

.unrecognized-table .unrecognized-actions-column .icon-button,
.unrecognized-table .unrecognized-actions-column .action-icon-link {
  min-width: 24px;
}

.email-assets-panel {
  border-color: #f2c94c;
}

.section-heading-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: space-between;
  margin: 0 0 8px;
}

.section-heading-row h2,
.section-heading-row h3 {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.section-heading-row .unrecognized-delete-sender-button {
  flex: 0 0 auto;
  max-width: 100%;
  white-space: normal;
}

.email-assets-panel h3 {
  color: #62708a;
  font-size: 14px;
  margin: 0;
}

.email-assets-table {
  margin-bottom: 12px;
}

.email-assets-table th,
.email-assets-table td {
  font-size: 12px;
  padding-bottom: 7px;
  padding-top: 7px;
}

.email-asset-row {
  background: #fffdf2;
}

.group-block {
  border: 1px solid #d9e1ef;
  border-radius: 8px;
  margin-top: 16px;
  overflow: hidden;
}

.group-heading {
  align-items: center;
  background: #f7f9fc;
  border-bottom: 1px solid #d9e1ef;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.group-heading span,
.staff-heading .muted {
  font-size: 13px;
}

.staff-block {
  padding: 16px;
}

.staff-block + .staff-block {
  border-top: 1px solid #d9e1ef;
}

.staff-heading {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 420px);
  margin-bottom: 14px;
}

.staff-heading-row {
  align-items: center;
}

.staff-email {
  justify-self: end;
  text-align: right;
}

.nested-table {
  background: #ffffff;
}

.badge {
  background: #e8f0ff;
  border: 1px solid #bfd2ff;
  border-radius: 999px;
  color: #102a56;
  display: inline-block;
  font-weight: 700;
  min-width: 28px;
  padding: 3px 8px;
  text-align: center;
}

.inline-form {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin: 4px 8px 4px 0;
}

.client-card-actions {
  display: inline-flex;
  margin-right: 8px;
}

.client-delete-form {
  margin-top: 8px;
}

.inline-form select {
  min-width: 220px;
}

.table-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.table-actions .inline-form {
  margin: 0;
}

.action-icon-link {
  background: #e8eef8;
  color: #0b3b75;
  text-decoration: none;
}

.inline-edit-form {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

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

.edit-client-form {
  border-top: 1px solid #d9e1ef;
  gap: 8px 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
  min-width: 0;
  padding: 10px 12px 0;
}

.edit-client-form label,
.edit-client-form .checkbox-label,
.edit-client-form .form-note {
  font-size: 11px;
  gap: 4px;
}

.edit-client-form input,
.edit-client-form select {
  font-size: 11px;
  min-height: 28px;
  padding: 4px 7px;
}

.edit-client-form .form-section-title {
  font-size: 11px;
  margin-top: 2px;
}

.client-template-section {
  border-top: 1px solid #d9e1ef;
  margin-top: 8px;
  padding: 8px 12px 0;
}

.client-template-section .form-section-title {
  font-size: 11px;
  margin-bottom: 3px;
}

.client-template-section .form-note {
  font-size: 11px;
  line-height: 1.35;
  margin: 0 0 6px;
}

.client-template-table {
  font-size: 11px;
  margin-bottom: 6px;
}

.client-template-upload-form {
  gap: 8px 10px;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.3fr) minmax(180px, 1.4fr) auto;
}

.client-template-upload-form label {
  font-size: 11px;
  gap: 4px;
}

.client-template-upload-form input,
.client-template-upload-form select {
  font-size: 11px;
  min-height: 28px;
  padding: 4px 7px;
}

.client-template-upload-form .actions {
  align-items: end;
  margin-top: 0;
}

.compact-client-import-panel h2 {
  font-size: 16px;
  margin-bottom: 6px;
}

.compact-client-import-panel .muted {
  font-size: 11px;
  line-height: 1.35;
  margin-bottom: 8px;
}

.compact-client-import-form {
  gap: 8px 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-client-import-form label,
.compact-client-import-form .actions {
  font-size: 10px;
  gap: 4px;
}

.compact-client-import-form input,
.compact-client-import-form select {
  font-size: 10px;
  min-height: 26px;
  padding: 3px 6px;
}

.compact-client-import-form .actions {
  align-items: end;
  margin-top: 0;
}

.compact-client-import-form button {
  font-size: 10px;
  min-height: 26px;
  padding: 4px 9px;
}

.client-list-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) minmax(170px, 240px) minmax(180px, 260px) minmax(140px, 190px);
  gap: 12px;
  align-items: end;
  margin: 14px 0;
}

.client-list {
  display: grid;
  gap: 12px;
}

.client-list-header {
  color: #475467;
  display: grid;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) 70px minmax(220px, 420px) minmax(190px, auto) auto;
  padding: 0 16px 8px;
}

.client-list-header span:nth-child(2),
.client-list-header span:nth-child(3),
.client-list-header span:nth-child(4) {
  justify-self: start;
}

.client-details {
  border: 1px solid #d9e1ef;
  border-radius: 8px;
  background: #ffffff;
}

.client-summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) 70px minmax(220px, 420px) minmax(190px, auto) auto;
  padding: 14px 16px;
}

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

.client-summary::marker {
  content: "";
}

.client-summary::after {
  color: #0b3b75;
  content: "\25bc";
  font-size: 13px;
  justify-self: end;
}

.client-details[open] > .client-summary::after {
  content: "\25b2";
}

.client-summary .late-invoice-warning {
  justify-self: start;
  margin-left: 0;
}

.client-status-placeholder {
  display: block;
  min-height: 1px;
}

.client-summary span:not(.late-invoice-warning):not(.client-staff-label):not(.client-status-placeholder) {
  color: #475467;
  justify-self: end;
  text-align: right;
}

.compact-client-action {
  justify-self: end;
  padding: 7px 10px;
  white-space: nowrap;
}

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

.client-staff-label {
  color: #475467;
  justify-self: start;
  overflow-wrap: anywhere;
  text-align: left;
}

.staff-checkbox-group {
  border: 1px solid #d9e1ef;
  border-radius: 6px;
  margin: 4px 0 0;
  padding: 8px 10px 10px;
}

.staff-checkbox-group legend {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  padding: 0 4px;
}

.staff-checkbox-list {
  display: grid;
  gap: 5px 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.staff-checkbox-option {
  font-size: 11px;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.staff-checkbox-option span {
  overflow-wrap: anywhere;
}

.hidden-form {
  display: none;
}

.client-detail-grid {
  border-top: 1px solid #d9e1ef;
  display: grid;
  font-size: 11px;
  gap: 6px 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 10px 12px;
}

.client-detail-grid div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.client-detail-grid strong {
  font-size: 10px;
  line-height: 1.2;
}

.client-detail-grid span {
  color: #475467;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.client-code-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(120px, 1fr) auto;
}

.collapse-details-button {
  justify-self: end;
}

.client-login-panel {
  border-top: 1px solid #d9e1ef;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.client-login-meta {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.client-login-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.icon-button {
  align-items: center;
  display: inline-flex;
  font-size: 14px;
  justify-content: center;
  min-height: 34px;
  min-width: 38px;
  padding: 0;
}

.danger-button {
  background: #b42318;
}

.attachment-link {
  color: #0b3b75;
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.document-view-panel {
  min-height: calc(100vh - 130px);
}

.document-view-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.document-view-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.document-view-position {
  color: #62708a;
  font-size: 13px;
  font-weight: 700;
  min-width: 48px;
  text-align: center;
}

.icon-only-link {
  justify-content: center;
  min-width: 40px;
  padding: 0;
}

.disabled-link {
  cursor: not-allowed;
  opacity: 0.45;
}

.document-view-frame,
.document-image-viewer {
  background: #f7f9fc;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  box-sizing: border-box;
  height: calc(100vh - 230px);
  min-height: 720px;
  width: 100%;
}

.document-image-viewer {
  align-items: center;
  display: flex;
  justify-content: center;
  overflow: auto;
  padding: 12px;
}

.document-view-image {
  display: block;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.split-document-view {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  margin-top: 16px;
}

.document-info-panel {
  border: 1px solid #d9e1ef;
  border-radius: 8px;
  max-height: calc(100vh - 230px);
  min-height: 720px;
  overflow: auto;
  padding: 16px;
}

.document-info-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.document-info-form {
  display: grid;
  gap: 12px;
}

.document-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-info-details {
  border-top: 1px solid #d9e1ef;
  margin-top: 16px;
  padding-top: 12px;
}

.document-info-details summary {
  color: #0b3b75;
  cursor: pointer;
  font-weight: 700;
}

.compact-confidence-grid {
  color: #475467;
  display: grid;
  font-size: 12px;
  gap: 4px 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  line-height: 1.3;
  margin-top: 8px;
}

.compact-list {
  color: #475467;
  font-size: 12px;
  line-height: 1.35;
  margin: 8px 0 0;
  padding-left: 18px;
}

.ai-proposal-table {
  font-size: 11px;
  margin: 8px 0;
  table-layout: fixed;
}

.ai-proposal-table th,
.ai-proposal-table td {
  overflow-wrap: anywhere;
  padding: 5px 6px;
  white-space: normal;
}

.compact-document-details {
  border-top: 0;
  margin: 4px 8px 4px 0;
  padding-top: 0;
}

.technical-meta {
  color: #475467;
  display: grid;
  font-size: 12px;
  gap: 4px;
  line-height: 1.3;
  margin-top: 6px;
  max-width: 260px;
  overflow-wrap: anywhere;
}

pre {
  background: #101828;
  border-radius: 8px;
  color: #f2f4f7;
  max-height: 420px;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
}

.note-text {
  background: #f7f9fc;
  color: #14213d;
}

.email-source-body {
  background: #f7f9fc;
  color: #14213d;
  font-size: 12px;
  line-height: 1.35;
  max-height: 220px;
  padding: 10px;
}

.related-attachments-list {
  display: grid;
  font-size: 12px;
  gap: 4px;
  margin-top: 8px;
}

.email-log-subject-details summary {
  color: #0b3b75;
  cursor: pointer;
  font-weight: 700;
}

.email-log-subject-details .email-source-body {
  margin: 6px 0 0;
  max-width: 520px;
}

@media (max-width: 720px) {
  .topbar,
  .shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .grid-form,
  .upload,
  .choice-grid,
  .stats-grid,
  .filter-bar,
  .password-generator,
  .document-filter-form {
    grid-template-columns: 1fr;
  }

  .settings-page .grid-form,
  .settings-page .choice-grid {
    grid-template-columns: 1fr;
  }

  .settings-link-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .settings-link-actions {
    justify-content: flex-start;
  }

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

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

  .horizontal-field {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .upload,
  .heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-form {
    gap: 6px;
    margin-top: 6px;
  }

  .dropzone {
    min-height: 52px;
    padding: 8px;
  }

  .upload-icon {
    display: none;
  }

  .upload-icon-page {
    height: 26px;
    padding: 6px 5px 5px;
    width: 22px;
  }

  .upload-icon-arrow {
    font-size: 15px;
    height: 20px;
    width: 20px;
  }

  .dropzone-title {
    font-size: 14px;
  }

  .mobile-upload-action,
  #upload-submit {
    min-height: 42px;
    width: 100%;
  }

  .selected-files,
  .upload-progress-status {
    font-size: 13px;
  }

  .group-heading,
  .staff-heading {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .staff-email {
    justify-self: start;
    text-align: left;
  }

  .client-summary {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .client-list-controls {
    grid-template-columns: 1fr;
  }

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

  .client-summary::after {
    grid-row: 1;
    grid-column: 3;
  }

  .compact-client-action {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .client-code-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .client-login-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .client-login-form {
    grid-template-columns: 1fr;
  }

  .client-summary span:not(.late-invoice-warning) {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }

  .split-document-view {
    grid-template-columns: 1fr;
  }

  .document-view-frame,
  .document-image-viewer,
  .document-info-panel {
    min-height: 0;
  }

  .document-view-frame,
  .document-image-viewer {
    height: calc(100vh - 190px);
  }
}
.public-document-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.public-document-link input {
  flex: 1 1 320px;
  min-width: 220px;
}

@media (max-width: 520px) {
  .settings-status-grid {
    grid-template-columns: 1fr;
  }
}

.vat-breakdown-table input,
.vat-breakdown-table select {
  width: 100%;
  min-width: 86px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  background: #fff;
}

.vat-breakdown-table select {
  min-width: 128px;
}
