:root {
  --ink: #1c1c1c;
  --gold: #80651f;
  --paper: #f8f5f0;
  --line: #e4dfd4;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.5 system-ui,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  background: var(--ink);
  color: white;
  border: 0;
  border-radius: 7px;
  padding: 10px 16px;
  text-decoration: none;
  display: inline-block;
}
button:hover {
  background: var(--gold);
}
button:disabled {
  opacity: 0.5;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #c5beb0;
  border-radius: 6px;
  background: white;
  color: var(--ink);
}
textarea {
  min-height: 120px;
  resize: vertical;
}
input[type="checkbox"] {
  width: auto;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 15px 0 5px;
}
h1,
h2,
h3 {
  line-height: 1.15;
}
h1 {
  font:
    38px/1.1 Georgia,
    serif;
  margin: 0 0 12px;
}
h2 {
  font:
    26px Georgia,
    serif;
}
small,
.muted {
  color: #666;
}
a {
  color: var(--gold);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: #20201f;
  color: #fff;
  padding: 26px 18px;
  overflow: auto;
}
.brand {
  font:
    23px Georgia,
    serif;
  color: #d7b96f;
  margin-bottom: 28px;
}
.sidebar a {
  display: block;
  color: #c6c4bf;
  text-decoration: none;
  border-radius: 5px;
  padding: 9px 12px;
  margin: 2px 0;
}
.sidebar a.active,
.sidebar a:hover {
  background: #35332e;
  color: #e4c984;
}
.sidebar small {
  display: block;
  color: #b8b5ad;
  margin: 18px 10px;
}
.main {
  margin-left: 240px;
  padding: 42px;
  max-width: 1600px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 25px;
}
.panel,
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin: 16px 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat {
  margin: 0;
}
.stat strong {
  display: block;
  font:
    38px Georgia,
    serif;
}
.status {
  display: inline-block;
  border-radius: 5px;
  background: #ede8de;
  padding: 3px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.good {
  background: #e4eee6;
  color: #275d36;
}
.bad {
  background: #f9e9e4;
  color: #893c25;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}
.secondary {
  background: #eee9df;
  color: #292720;
}
.danger {
  background: #812d27;
}
.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
td,
th {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  max-width: 400px;
  overflow-wrap: anywhere;
}
th {
  background: #f0ece4;
  font-weight: 600;
  white-space: nowrap;
}
td button {
  font-size: 12px;
  padding: 6px 10px;
}
tr:last-child td {
  border: 0;
}
.filters {
  display: flex;
  gap: 12px;
  margin: 22px 0;
}
.filters input {
  max-width: 440px;
}
.filters select {
  max-width: 200px;
}
.login {
  max-width: 460px;
  margin: 10vh auto;
  padding: 34px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.login button {
  margin-top: 22px;
  width: 100%;
}
.error {
  color: #9b3027;
  margin-top: 12px;
}
.notice {
  background: #f1e9d6;
  padding: 15px;
  border-left: 3px solid #b8973a;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  font-size: 12px;
  max-height: 500px;
  overflow: auto;
}
dialog {
  width: min(850px, 94vw);
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 30px;
}
dialog::backdrop {
  background: #14141399;
  backdrop-filter: blur(4px);
}
.close {
  float: right;
  background: #eee9df;
  color: #222;
}
.full {
  grid-column: 1/-1;
}
#toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #222;
  color: white;
  border-radius: 8px;
  padding: 14px 22px;
  display: none;
  z-index: 20;
}
.empty {
  padding: 50px;
  text-align: center;
}
.legal textarea {
  min-height: 420px;
}
.badge {
  color: #d9b767;
  font-size: 11px;
  letter-spacing: 0.15em;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #b8973a;
  outline-offset: 3px;
}
@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 16px;
  }
  .brand {
    margin: 0;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
  }
  .sidebar a {
    white-space: nowrap;
  }
  .sidebar small {
    display: none;
  }
  .main {
    margin: 0;
    padding: 24px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .panel,
  .stat {
    animation: enter 0.35s ease-out;
  }
  @keyframes enter {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
