: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;
}

.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-count-badge {
  align-items: center;
  background: #d92d20;
  border: 1px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  display: inline-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;
}

.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-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;
}

.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: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.choice-card {
  border: 1px solid #d9e1ef;
  border-radius: 8px;
  color: #14213d;
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 18px;
  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: 18px;
}

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

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

.choice-card span:last-child {
  color: #62708a;
  line-height: 1.35;
}

.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;
}

.choice-number {
  align-items: center;
  background: #e8eef8;
  border-radius: 999px;
  color: #0b3b75;
  display: inline-flex;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.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: 16px;
  margin-top: 24px;
}

.dropzone {
  align-items: center;
  border: 2px dashed #8aa4c8;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 180px;
  padding: 24px;
  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: 74px;
  position: relative;
  width: 74px;
}

.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: 5px;
  height: 54px;
  padding: 12px 10px 10px;
  width: 42px;
}

.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: 24px;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 4px;
  width: 34px;
}

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

.dropzone input {
  max-width: 320px;
}

.selected-files {
  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;
}

.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(960px, calc(100vw - 96px));
}

.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: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
  padding-top: 20px;
}

.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;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
}

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

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

.document-filter-form label > span {
  align-items: center;
  display: inline-flex;
}

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

.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;
}

.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 minmax(180px, 1.1fr);
}

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

.password-copy-note {
  color: #8a5a00;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.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;
}

.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;
}

.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;
}

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

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

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

.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;
}

.documents-list-table,
.compact-record-table {
  min-width: 1100px;
  table-layout: fixed;
}

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

.documents-list-table .documents-client-column,
.documents-list-table .documents-partner-column {
  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-type-column {
  font-weight: 700;
  max-width: 38px;
  min-width: 30px;
  overflow: hidden;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  white-space: nowrap;
  width: 32px;
}

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

.documents-list-table .documents-file-column {
  font-size: 12px;
  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 .column-filter-control,
.compact-record-table .column-filter-control {
  font-size: 12px;
  min-height: 30px;
  min-width: 0;
  padding: 4px 6px;
}

.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-date-column .column-header-label,
.documents-list-table .documents-received-column .column-header-label {
  white-space: normal;
}

.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;
}

.unrecognized-table {
  table-layout: fixed;
}

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

.unrecognized-table .unrecognized-file-column {
  font-size: 12px;
  line-height: 1.3;
  max-width: 220px;
  min-width: 120px;
  overflow-wrap: anywhere;
  white-space: normal;
  width: 12%;
  word-break: normal;
}

.unrecognized-table .unrecognized-date-column {
  font-size: 12px;
  line-height: 1.25;
  max-width: 118px;
  min-width: 96px;
  white-space: normal;
  width: 8%;
}

.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;
}

.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;
  margin-top: 12px;
  min-width: min(760px, 80vw);
  padding-top: 12px;
}

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

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

.client-summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 420px) 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 span {
  color: #475467;
  justify-self: end;
  text-align: right;
}

.client-detail-grid {
  border-top: 1px solid #d9e1ef;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px;
}

.client-detail-grid div {
  display: grid;
  gap: 4px;
}

.client-detail-grid span {
  color: #475467;
}

.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-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-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;
}

@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;
  }

  .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;
  }

  .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;
  }

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

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

  .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 {
    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);
  }
}
