:root {
  color-scheme: light;
  --ink: #30262c;
  --soft: #665b62;
  --paper: #fbf8f6;
  --line: #e4d9dd;
  --berry: #78364f;
  --dark: #34212c;
  font:
    16px/1.48 'Inter',
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
header {
  background: var(--dark);
  color: white;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.8rem max(5vw, calc((100vw - 1100px) / 2));
  min-height: 68px;
}
.brand {
  font:
    bold 2rem Georgia,
    serif;
  letter-spacing: -0.08em;
}
.dot {
  color: #ed9cae;
}
.subbrand {
  font-size: 0.87rem;
}
header #exit {
  margin-left: auto;
  background: transparent;
  color: white;
  border-color: #967889;
}
main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 36px) 60px;
}
h1,
h2,
h3,
p {
  margin: 0 0 0.7rem;
}
h1 {
  font:
    500 clamp(2.2rem, 4vw, 3.8rem) / 1.12 Georgia,
    serif;
  letter-spacing: -0.045em;
}
h2 {
  font-size: 1.25rem;
  margin: 1.7rem 0 1rem;
}
h3 {
  font-size: 1.05rem;
}
small,
label {
  color: var(--soft);
  font-size: 0.84rem;
}
.heading,
nav,
.tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
nav {
  justify-content: flex-start;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin: 1.5rem 0;
}
nav button {
  background: transparent;
  color: var(--soft);
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  white-space: nowrap;
}
nav [aria-current='page'] {
  color: var(--berry);
  border-color: var(--berry);
}
button,
.link {
  background: var(--berry);
  color: white;
  border: 1px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
}
.quiet {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}
button:hover,
.link:hover {
  filter: brightness(0.93);
}
:focus-visible {
  outline: 3px solid #d2859c;
  outline-offset: 3px;
}
input,
select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: white;
  border: 1px solid #bdacb4;
  border-radius: 8px;
  min-height: 42px;
  padding: 0.45rem 0.6rem;
}
label {
  display: grid;
  gap: 0.22rem;
}
#filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}
#filters label {
  flex: 1;
  min-width: 120px;
}
.stats,
.cards {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(166px, 1fr));
}
.stat,
article,
.login,
dialog {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.15rem;
}
.stat strong {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  display: block;
}
.stat.primary {
  background: #f2e5e9;
  border-color: #e3c9d3;
}
.cards {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
}
article p {
  font-size: 0.92rem;
}
.table {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th,
td {
  text-align: left;
  padding: 0.63rem 0.8rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  background: #f3ecee;
  color: var(--soft);
  font-weight: 550;
}
.login {
  margin: 8vh auto 0;
  max-width: 410px;
  padding: 2rem;
}
.login h1 {
  font-size: 2.3rem;
}
.login form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}
.login p,
#message {
  color: var(--soft);
}
#message:empty {
  display: none;
}
#message {
  margin: 12px 0;
}
.tools {
  margin: 1rem 0;
}
.empty {
  color: var(--soft);
  padding: 1rem 0;
}
dialog {
  max-width: min(800px, 95vw);
  max-height: 85vh;
}
dialog::backdrop {
  background: #28192188;
}
dialog #close {
  float: right;
}
a {
  color: var(--berry);
}
@media (max-width: 600px) {
  main {
    padding-top: 22px;
  }
  header {
    gap: 0.65rem;
  }
  .subbrand {
    font-size: 0.75rem;
  }
  nav {
    gap: 0;
  }
  nav button {
    padding: 0.55rem 0.62rem;
    font-size: 0.86rem;
  }
  #filters label {
    min-width: 42%;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    padding: 0.8rem;
  }
  .stat strong {
    font-size: 1.25rem;
  }
  .login {
    padding: 1.4rem;
  }
  .tools {
    flex-wrap: wrap;
  }
}
