:root {
  --ink: #182b40;
  --muted: #526577;
  --accent: #166b53;
  --line: #d8e0e5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    16px/1.55 system-ui,
    sans-serif;
  background: #f4f6f8;
  color: var(--ink);
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
aside {
  background: #122c42;
  color: #dce7ef;
  padding: 38px 28px;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -1px;
  text-decoration: none;
  color: white;
}
.brand span {
  display: block;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #c2d6e4;
}
.badge {
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid #587083;
  border-radius: 4px;
  padding: 6px;
  margin-top: 30px;
}
nav {
  display: grid;
  gap: 14px;
  margin-top: 38px;
}
nav a {
  color: #e0eaf0;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 0;
}
nav a:hover {
  color: #8fe2bd;
}
.aside-foot {
  margin-top: auto;
  font-size: 13px;
  color: #c0d0db;
  padding-top: 80px;
}
main {
  padding: 42px clamp(22px, 4vw, 66px);
  max-width: 1500px;
  width: 100%;
  min-width: 0;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
header small {
  letter-spacing: 1.7px;
  color: var(--accent);
  font-weight: 700;
}
h1 {
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -1px;
  margin: 8px 0;
}
header p {
  margin: 0;
  color: var(--muted);
}
section {
  background: white;
  border: 1px solid var(--line);
  padding: 26px;
  border-radius: 10px;
  margin: 22px 0;
}
h2 {
  font-size: 19px;
  margin: 0 0 22px;
  letter-spacing: -0.3px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
input,
select,
button {
  font: inherit;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid #a9b8c4;
  padding: 9px 12px;
  background: white;
  color: var(--ink);
}
input {
  min-width: 0;
  width: 100%;
}
button {
  cursor: pointer;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.18s;
}
button:hover {
  background: #11523f;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
:focus-visible {
  outline: 3px solid #36a4ba;
  outline-offset: 3px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
small {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 9px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 25px;
}
.stats article {
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.stats small {
  font-size: 10px;
  letter-spacing: 1px;
  margin: 0;
  font-weight: 700;
}
.stats strong {
  display: block;
  font-size: 30px;
  margin-top: 6px;
}
.stats span {
  font-size: 12px;
  color: var(--muted);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  margin-top: 12px;
}
.check input {
  width: 16px;
  min-height: 16px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px 10px;
  font-size: 14px;
}
.hit,
.doc {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}
.hit h3 {
  font-size: 15px;
  margin: 0 0 8px;
}
.hit p {
  white-space: pre-wrap;
  font-size: 14px;
}
.hit small {
  color: var(--accent);
}
#meta {
  font-size: 12px;
  color: var(--muted);
}
.doc {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.actions {
  display: flex;
  gap: 8px;
}
.doc button {
  font-size: 12px;
  padding: 6px 12px;
}
.doc .delete {
  color: #a12a2a;
  background: white;
  border-color: #bd8989;
}
.status {
  font-size: 11px;
  padding: 3px 7px;
  background: #edf5f1;
  color: #155d48;
  border-radius: 4px;
  margin-left: 8px;
}
#documents {
  margin-top: 22px;
}
#notice {
  border-radius: 6px;
  color: #9c2525;
}
#notice:not(:empty) {
  padding: 12px 16px;
  background: #fff1ef;
  border: 1px solid #e2bbb4;
  margin-bottom: 16px;
}
footer {
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 20px;
}
dialog {
  width: min(850px, 94vw);
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 85vh;
  padding: 25px;
}
dialog::backdrop {
  background: #0e243980;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}
dialog button {
  float: right;
}
[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }
  aside {
    padding: 18px 24px;
    display: block;
  }
  .brand {
    font-size: 24px;
  }
  .brand span,
  .badge,
  .aside-foot,
  nav {
    display: none;
  }
  main {
    padding: 24px;
  }
  .stats {
    gap: 8px;
  }
  .stats article {
    padding: 14px;
  }
}
@media (max-width: 600px) {
  .row {
    flex-wrap: wrap;
  }
  .row input {
    flex-basis: 100%;
  }
  .row select,
  .row button {
    flex: 1;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stats article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .stats strong {
    font-size: 23px;
    margin: 0;
  }
  .stats span {
    display: none;
  }
  section {
    padding: 18px;
  }
  .doc {
    align-items: start;
    flex-direction: column;
  }
  select {
    max-width: 100%;
  }
  header {
    align-items: start;
  }
  h1 {
    font-size: 27px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
