:root {
  --ink: #183641;
  --muted: #61767e;
  --teal: #12786d;
  --line: #dbe3e5;
  --wash: #f3f6f6;
  --paper: #fff;
  --amber: #9b5e13;
  --red: #ae3636;
  --sand: #f5eddd;
  font-family: Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--wash);
  font-size: 16px;
  line-height: 1.65;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 15px;
  background: white;
  color: var(--ink);
}
button:hover {
  border-color: var(--teal);
  background: #edf6f3;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button.primary {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
button.danger {
  color: var(--red);
  border-color: #d3a2a2;
}
a {
  color: var(--teal);
}
h1 {
  font-size: 1.65rem;
  line-height: 1.5;
  margin: 0;
}
h2 {
  font-size: 1.15rem;
  margin: 0 0 16px;
}
h3 {
  font-size: 1rem;
  margin: 0;
}
p {
  margin: 8px 0;
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--ink);
  color: white;
  padding: 25px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 24px;
  border-bottom: 1px solid #ffffff20;
  margin-bottom: 20px;
}
.brand img {
  width: 43px;
  height: 43px;
}
.brand strong {
  display: block;
  font-size: 1.2rem;
}
.brand small {
  color: #c6d9df;
  font-size: 0.8rem;
}
.nav-group {
  font-size: 0.78rem;
  color: #a9c2cb;
  margin: 23px 12px 10px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav button {
  border: 0;
  text-align: start;
  background: none;
  color: #d3e2e6;
  padding: 10px 13px;
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
}
.nav button:hover,
.nav button.active {
  background: #ffffff14;
  color: white;
}
.nav button.active {
  box-shadow: inset -3px 0 var(--sand);
}
[dir="ltr"] .nav button.active {
  box-shadow: inset 3px 0 var(--sand);
}
.nav-symbol {
  font-size: 1.2rem;
  width: 25px;
  text-align: center;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 82px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 32px;
  border-bottom: 1px solid var(--line);
  gap: 15px;
}
.identity {
  font-size: 0.875rem;
  line-height: 1.4;
}
.identity small {
  display: block;
  color: var(--muted);
}
.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lang {
  font-weight: bold;
}
.main {
  padding: 30px 32px 60px;
  max-width: 1600px;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 0.78rem;
  color: var(--teal);
  font-weight: bold;
  margin-bottom: 5px;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 24px;
}
.filters input {
  flex: 1;
  min-width: 180px;
}
.filters select {
  max-width: 220px;
}
.filters label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.875rem;
}
.filters input,
.filters select {
  padding: 7px 10px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  padding: 18px 22px;
  border-radius: 10px;
}
.card .value {
  font-size: 2.3rem;
  line-height: 1.4;
  font-weight: bold;
  direction: ltr;
  text-align: start;
  color: var(--ink);
}
.card .label {
  font-size: 0.875rem;
  color: var(--muted);
}
.card .sub {
  font-size: 0.8rem;
  color: var(--teal);
}
.section {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 20px 0;
  padding: 22px;
  min-width: 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.section-head h2 {
  margin: 0;
}
.section-head small {
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}
th {
  text-align: start;
  background: #edf2f3;
  color: #4a626c;
  font-weight: normal;
  white-space: nowrap;
}
th,
td {
  padding: 12px 15px;
  border-bottom: 1px solid #e6eced;
  vertical-align: middle;
}
td {
  max-width: 350px;
  overflow-wrap: anywhere;
}
tr:last-child td {
  border: 0;
}
tbody tr:hover {
  background: #f7faf9;
}
.mono {
  font-family: Consolas, monospace;
  direction: ltr;
  unicode-bidi: plaintext;
}
.badge {
  display: inline-block;
  border-radius: 5px;
  padding: 2px 8px;
  background: #edf2f3;
  font-size: 0.8rem;
  white-space: nowrap;
  color: #46626d;
}
.badge.warn {
  background: #fbf0dd;
  color: #96621e;
}
.badge.good {
  background: #e1f1eb;
  color: #116c58;
}
.badge.bad {
  background: #fae9e8;
  color: #a13838;
}
.cell-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.cell-actions button {
  font-size: 0.8rem;
  padding: 4px 8px;
}
.empty {
  text-align: center;
  padding: 38px 20px;
  color: var(--muted);
}
.empty strong {
  display: block;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.empty-symbol {
  font-size: 2rem;
  color: #a4b9bd;
  margin-bottom: 8px;
}
.notice {
  padding: 13px 18px;
  border: 1px solid #dec79d;
  background: #fff9ea;
  color: #886024;
  border-radius: 7px;
  margin-bottom: 20px;
}
.notice.error {
  background: #fff0ef;
  color: var(--red);
  border-color: #e9bfba;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.step {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 20px;
}
.step .num {
  color: var(--teal);
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.quick-action {
  padding: 17px;
  text-align: start;
  display: flex;
  align-items: center;
  gap: 12px;
}
.quick-action .symbol {
  background: #eaf3f1;
  color: var(--teal);
  border-radius: 7px;
  padding: 3px 11px;
  font-size: 1.4rem;
}
.quick-action small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}
.split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}
.small {
  font-size: 0.8rem;
}
.muted {
  color: var(--muted);
}
.nowrap {
  white-space: nowrap;
}
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-aside {
  background: var(--ink);
  color: white;
  padding: 10vh 10%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-aside .brand {
  border: none;
  padding: 0;
  margin-bottom: 55px;
}
.auth-aside h1 {
  font-size: 2.1rem;
  max-width: 420px;
}
.auth-aside p {
  color: #b9ccd3;
  max-width: 400px;
}
.chain {
  margin-top: 40px;
  display: grid;
  gap: 10px;
  max-width: 340px;
}
.chain div {
  border: 1px solid #ffffff26;
  border-radius: 8px;
  padding: 12px 17px;
}
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 45px 30px;
}
.auth-box {
  width: min(440px, 100%);
}
.auth-box > .actions {
  justify-content: flex-end;
  margin-bottom: 35px;
}
.auth-box h2 {
  font-size: 1.45rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.875rem;
  min-width: 0;
}
.field.wide {
  grid-column: 1/-1;
}
.field input,
.field select,
.field textarea,
input,
select,
textarea {
  border: 1px solid #bbcbd0;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  min-width: 0;
  max-width: 100%;
}
.field small {
  color: var(--muted);
}
.field textarea {
  min-height: 84px;
}
.field input[type="checkbox"] {
  align-self: flex-start;
  width: 20px;
  height: 20px;
}
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 23px;
  grid-column: 1/-1;
}
.form-error {
  padding: 10px;
  background: #fff0ef;
  color: var(--red);
  border-radius: 5px;
  grid-column: 1/-1;
}
.form-error:empty {
  display: none;
}
dialog {
  width: min(800px, 95vw);
  border: 0;
  border-radius: 13px;
  padding: 28px;
  max-height: 90vh;
  box-shadow: 0 15px 80px #0004;
  color: var(--ink);
}
dialog::backdrop {
  background: #102e3bc4;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
}
#toast {
  position: fixed;
  bottom: 28px;
  inset-inline-end: 30px;
  max-width: 500px;
  background: var(--ink);
  color: white;
  border-radius: 9px;
  padding: 14px 23px;
  box-shadow: 0 8px 30px #0003;
  z-index: 20;
}
.loading {
  padding: 60px;
  text-align: center;
}
pre {
  background: #f2f5f5;
  padding: 15px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  direction: ltr;
  text-align: left;
  font-size: 0.8rem;
}
.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 25px;
}
.details div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.details dt {
  color: var(--muted);
  font-size: 0.875rem;
}
.details dd {
  margin: 0;
  font-weight: bold;
}
.report-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}
.report-link {
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 8px;
}
.report-link h3 {
  margin-bottom: 14px;
}
.report-link .actions a {
  font-size: 0.85rem;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  text-decoration: none;
}
.upload {
  border: 1px dashed #97b4bd;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}
.auth-box form {
  display: grid;
  gap: 14px;
}
.auth-box .primary {
  width: 100%;
}
.owner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.owner-grid button {
  padding: 20px;
}
.footer-note {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 20px;
}
.count {
  font-size: 0.8rem;
  background: #e7eff0;
  border-radius: 5px;
  padding: 2px 8px;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.85rem;
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .main {
    padding: 23px;
  }
  .topbar {
    padding: 15px 23px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-actions,
  .report-links {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 14px;
  }
  .sidebar .brand {
    margin-bottom: 8px;
    padding-bottom: 10px;
  }
  .nav {
    flex-direction: row;
    overflow: auto;
    gap: 7px;
  }
  .nav button {
    white-space: nowrap;
    width: auto;
    padding: 7px 12px;
  }
  .nav-group {
    display: none;
  }
  .nav-symbol {
    display: none;
  }
  .topbar {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .top-actions button {
    padding: 6px 9px;
  }
  .main {
    padding: 18px 14px;
  }
  .page-head {
    flex-direction: column;
    gap: 10px;
  }
  .filters {
    padding: 12px;
    gap: 8px;
  }
  .filters input,
  .filters select {
    width: 100%;
    max-width: none;
    flex-basis: 100%;
  }
  .cards {
    gap: 10px;
  }
  .card {
    padding: 13px;
  }
  .card .value {
    font-size: 1.9rem;
  }
  .section {
    padding: 15px;
  }
  .split,
  .steps,
  .auth-wrap {
    display: block;
  }
  .step {
    margin-bottom: 12px;
  }
  .quick-actions,
  .report-links {
    grid-template-columns: 1fr;
  }
  .auth-aside {
    padding: 30px;
    display: none;
  }
  .auth-main {
    min-height: 100vh;
    padding: 25px;
  }
  .form-grid,
  .details {
    grid-template-columns: 1fr;
  }
  .owner-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .field {
    grid-column: 1;
  }
  .identity small {
    font-size: 0.78rem;
  }
  h1 {
    font-size: 1.35rem;
  }
  .filters label {
    width: 100%;
  }
  dialog {
    padding: 20px;
  }
  .details div {
    gap: 10px;
  }
  .section-head {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.12s,
      border-color 0.12s;
  }
}
@media print {
  .sidebar,
  .topbar,
  .filters,
  .actions,
  .cell-actions {
    display: none;
  }
  .shell {
    display: block;
  }
  .main {
    padding: 0;
  }
  .table-wrap {
    overflow: visible;
  }
  .section {
    break-inside: avoid;
  }
}
