:root {
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: #192033;
  background: #edf1f7;
  --ink: #192033;
  --navy: #171d2f;
  --blue: #384bc0;
  --blue-hover: #2d3ea8;
  --lime: #deef71;
  --muted: #526078;
  --line: #e0e6ef;
  --quiet-bg: #f5f7fb;
  --surface: #fff;
  --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid #596bea; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h2 { font-size: 1.35rem; margin-bottom: 0; line-height: 1.2; letter-spacing: -.028em; }
h3 { font-size: 1rem; margin-bottom: 12px; }
p { color: var(--muted); line-height: 1.55; }

.top { background: var(--navy); color: white; }
.top-inner {
  max-width: 1520px;
  margin-inline: auto;
  padding: 12px clamp(16px, 3.4vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand, .top-right { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 1.035rem; letter-spacing: .12em; }
.brand span:not(.mark) { display: block; color: #bdc7da; font-size: .8125rem; }
.mark {
  width: 39px;
  height: 39px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--lime);
  border-radius: 11px;
  font-size: 1.31rem;
  font-weight: 780;
}
.demo {
  color: #d5dcef;
  border: 1px solid #43506a;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .8125rem;
  white-space: nowrap;
}
.top .quiet { border-color: #43506a; color: #fff; }
.top .quiet:hover { background: #303952; }

main {
  max-width: 1520px;
  margin-inline: auto;
  padding: 32px clamp(16px, 3.4vw, 52px) 54px;
}
.page-head {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: white;
  background: #232b49;
  border-radius: 21px;
  padding: clamp(22px, 3vw, 40px);
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .93fr);
  align-items: center;
  gap: 25px;
}
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 89% 1%, #5b64a19c, transparent 58%),
              linear-gradient(105deg, #1a223a 20%, transparent);
}
.page-copy h1, .login h1 {
  margin: 0 0 8px;
  font-size: clamp(2.15rem, 4.2vw, 3.55rem);
  letter-spacing: -.064em;
  line-height: 1.03;
  font-weight: 750;
}
.page-copy p { color: #d3d9e9; margin: 0; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.filters button {
  text-align: left;
  border: 1px solid #adbaf153;
  background: #293452;
  color: white;
  min-width: 0;
  padding: 12px clamp(10px, 1.35vw, 20px);
  border-radius: 13px;
}
.filters button:hover { background: #3c4a71; }
.filters button[aria-pressed="true"] { background: var(--lime); color: #222b20; border-color: var(--lime); }
.filters button:focus-visible, .top button:focus-visible { outline-color: #f3ffb2; }
.filters span {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #e1e6f4;
}
.filters button[aria-pressed="true"] span { color: #314029; }
.filters strong { font-size: clamp(1.68rem, 3vw, 2.34rem); line-height: 1; font-variant-numeric: tabular-nums; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.37fr) minmax(330px, 1fr);
  align-items: start;
  gap: 20px;
}
.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 18px #25364e09;
}
.toolbar { padding: 20px 21px 17px; }
.liste-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.treffer { color: var(--muted); flex: none; font-size: .875rem; }
.search { display: block; position: relative; }
.search::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  border: 1.8px solid #526078;
  border-radius: 50%;
  width: 11px;
  height: 11px;
  pointer-events: none;
}
.search::after {
  content: "";
  position: absolute;
  top: 27px;
  left: 25px;
  width: 6px;
  height: 2px;
  background: #526078;
  transform: rotate(45deg);
  pointer-events: none;
}
input:not([type="checkbox"]) {
  color: inherit;
  border: 1px solid #cdd6e6;
  border-radius: 9px;
  background: #fff;
  padding: 9px 10px;
  min-width: 0;
  min-height: 40px;
}
input::placeholder { color: #59677e; opacity: 1; }
.search input {
  margin: 0;
  padding-left: 38px;
  min-height: 44px;
  background: #f7f9fd;
}
button, .button {
  display: inline-block;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}
button:disabled { cursor: not-allowed; opacity: .57; }
.primary { color: #fff; background: var(--blue); }
.primary:hover:not(:disabled) { background: var(--blue-hover); }
.secondary { color: #314395; background: #fff; border-color: #ccd4e6; }
.quiet { color: #344575; background: transparent; }
.secondary:hover, .quiet:hover { background: #edf0fc; }
.massbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 10px 20px;
  color: #30469e;
  background: #edf0ff;
  border-top: 1px solid var(--line);
  font-size: .875rem;
}

.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; }
thead { background: #f4f6fa; }
th, td { padding: 12px 10px; border-top: 1px solid var(--line); }
th { color: #4d5c73; font-weight: 650; white-space: nowrap; }
th:last-child, td:last-child { padding-right: 18px; }
tbody tr.selected { background: #eef1ff; }
tbody tr:not(.selected):hover { background: #f7f9fe; }
tbody tr.selected .select-cell { box-shadow: inset 3px 0 #5063db; }
.select-cell { width: 36px; padding-left: 15px; padding-right: 4px; }
input[type="checkbox"] { accent-color: var(--blue); width: 17px; height: 17px; margin: 0; vertical-align: middle; }
.amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.date-cell { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.doc-cell { width: 100%; }
.doc-identity { display: flex; gap: 10px; align-items: center; min-width: 0; }
.doc-text { min-width: 0; flex: 1; }
.doc {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--ink);
  font-size: .9375rem;
  overflow-wrap: anywhere;
  letter-spacing: -.015em;
}
.doc:hover { color: var(--blue-hover); text-decoration: underline; }
.file-type {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 37px;
  height: 37px;
  border-radius: 9px;
  color: #3e4aa1;
  background: #e9edfc;
  font-size: .75rem;
  font-weight: 730;
}
.file, .small, .mobile-facts { display: block; color: var(--muted); font-size: .8125rem; margin-top: 3px; }
.file-line { display: flex; gap: 7px; align-items: baseline; min-width: 0; }
.file-id {
  flex: none;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8125rem;
  color: #4755a8;
  font-variant-numeric: tabular-nums;
}
.file {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.mobile-facts { display: none; }
.status {
  display: inline-flex;
  align-items: center;
  color: #245b41;
  background: #e9f6ee;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}
.status.review { color: #744923; background: #fff0d8; }

.editor { padding: 21px; scroll-margin-top: 12px; }
.editor-context { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.reference { color: var(--blue-hover); font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.editor-head h2 { font-size: 1.55rem; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .875rem; margin-top: 5px; }
.document {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 15px 0 19px;
  padding: 11px;
  border-radius: 11px;
  background: var(--quiet-bg);
  border: 1px solid var(--line);
}
.document strong, .document .small { overflow-wrap: anywhere; }
.document strong { font-size: .875rem; display: block; }
.document .button { white-space: nowrap; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 13px; }
label > input:not([type="checkbox"]) { display: block; width: 100%; margin-top: 5px; }
label { font-size: .875rem; font-weight: 630; }
.fields .small { display: inline; color: #4a50a3; font-weight: 500; margin-left: 4px; }
.form-section { display: block; margin: 16px 0 10px; }
.suggestion {
  background: #eef1fd;
  border-radius: 9px;
  padding: 10px 12px;
  color: #33458f;
  font-size: .8125rem;
}
.suggestion span, .suggestion strong { display: block; overflow-wrap: anywhere; }
.suggestion strong { margin-top: 3px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
details { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 13px; }
summary { cursor: pointer; font-size: .875rem; font-weight: 680; }
details > button { margin-top: 10px; }
.history { margin: 12px 0 0; padding-left: 18px; font-size: .875rem; }
.history li { margin-top: 8px; overflow-wrap: anywhere; }

.notice {
  margin-bottom: 16px;
  color: #1d5539;
  background: #ebf7ef;
  border: 1px solid #bdddc7;
  border-radius: 11px;
  padding: 11px 15px;
}
.notice.error, .error { color: #8d3026; }
.notice.error { background: #fff1eb; border-color: #efc8be; }
.login { max-width: 435px; margin: 8vh auto; padding: clamp(22px, 4.5vw, 35px); }
.login h1 { font-size: clamp(2rem, 4.5vw, 2.85rem); }
.login form { display: grid; gap: 14px; }
.login button { justify-self: start; }
.login .error { margin: 0; }
.login .error:empty { display: none; }

dialog {
  width: min(92vw, 670px);
  max-height: 86vh;
  overflow: auto;
  padding: clamp(19px, 3.5vw, 29px);
  color: inherit;
  border: 1px solid #c8d0e7;
  border-radius: 16px;
  box-shadow: 0 28px 80px #0f173a54;
}
dialog::backdrop { background: #151c39a8; }
dialog h2 { margin-bottom: 8px; }
.dialog-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.preview { padding: 11px 0; border-top: 1px solid var(--line); }
.preview strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.preview .error { margin-bottom: 0; }
.empty { padding: 23px 19px; color: var(--muted); }

@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 700px) {
  main { padding-block: 18px 36px; }
  .page-head { grid-template-columns: 1fr; gap: 17px; margin-bottom: 15px; }
  .toolbar, .editor { padding: 16px; }
  .top-right { gap: 7px; }
}
@media (max-width: 540px) {
  .top-inner { align-items: flex-start; }
  .top-right { justify-content: flex-end; flex-wrap: wrap; }
  .demo { white-space: normal; padding: 4px 7px; }
  .date-cell, .amount-cell { display: none; }
  .mobile-facts { display: block; }
  .doc-identity { gap: 6px; }
  th, td { padding: 10px 6px; }
  th:last-child, td:last-child { padding-right: 10px; }
  .select-cell { padding-left: 10px; }
  .doc-cell .file-type { display: none; }
  .document { grid-template-columns: auto minmax(0, 1fr); }
  .document .button { grid-column: 2; justify-self: start; }
}
@media (max-width: 350px) {
  .filters button { padding-inline: 7px; }
  .filters span { min-height: 2.25em; }
  .fields { grid-template-columns: 1fr; }
}

