:root {
  --bg: #f7f4ef;
  --card: #f4f6f8;
  --ink: #161616;
  --muted: #8d867c;
  --line: rgba(28, 24, 16, 0.12);
  --gold: #c4a15a;
  --danger: #8d3d32;
  --sans: "Manrope", "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 0 0, rgba(196, 161, 90, 0.16), transparent 28%),
    var(--bg);
}
button, input, select { font-family: inherit; color: inherit; font-size: 15px; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.boot { text-align: center; color: var(--muted); padding: 48px 16px; }
.eyebrow {
  margin: 0;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  text-indent: 0.38em;
  color: #8f8880;
  font-size: 12px;
  font-weight: 700;
}
h1 { margin: 8px 0 0; font-size: 32px; letter-spacing: -0.03em; font-weight: 650; }
h2 { margin: 0; font-size: 18px; }
h3 { margin: 18px 0 8px; font-size: 15px; }
.lede { color: #3f3b36; line-height: 1.5; }
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card, .panel, .tiles article {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 40px rgba(80, 60, 20, 0.06);
}
.card {
  width: min(420px, 100%);
  border-radius: 24px;
  padding: 28px 24px 24px;
}
label { display: block; margin-top: 16px; }
label span, .check span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
input, select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  padding: 11px 2px;
  outline: none;
}
input:focus, select:focus { border-bottom-color: var(--gold); }
.btn {
  margin-top: 20px;
  border: 0;
  background: var(--ink);
  color: #f7f4ef;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.back { display: block; margin-top: 16px; text-align: center; color: #8d7040; font-weight: 700; text-decoration: none; }
.or { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
#modForm { margin-top: 0; }
.who { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.role-badge {
  display: inline-block;
  border: 1px solid var(--gold);
  color: #8d7040;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.role-btn {
  border: 0;
  background: transparent;
  color: #8d7040;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}
#detailRole { margin-top: 10px; }
.form-error { color: var(--danger); font-size: 14px; }
#appView { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 64px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.chips { display: flex; gap: 8px; margin: 22px 0 8px; flex-wrap: wrap; }
.chips button, .check {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}
.chips button.is-on { border-color: var(--gold); background: rgba(196, 161, 90, 0.16); }
.filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr 0.7fr 0.7fr;
  gap: 12px 14px;
  align-items: end;
  margin-top: 8px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  text-transform: none;
  letter-spacing: 0;
  grid-column: 1 / -1;
  width: fit-content;
}
.check input { width: auto; }
.check span { margin: 0; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.tiles article { border-radius: 18px; padding: 14px 14px 16px; }
.tiles span { color: var(--muted); font-size: 12px; font-weight: 700; }
.tiles strong { display: block; margin-top: 6px; font-size: 28px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tiles small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.status { min-height: 1.2em; color: var(--muted); }
.panel { border-radius: 20px; padding: 16px; margin-top: 14px; }
.series { display: grid; gap: 7px; margin-top: 12px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.bar-track { height: 8px; border-radius: 99px; background: rgba(22, 22, 22, 0.06); overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #1c1c1c, var(--gold)); border-radius: inherit; }
.table-wrap { overflow: auto; margin-top: 14px; border-radius: 20px; background: rgba(255,255,255,0.72); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(28, 24, 16, 0.06); vertical-align: middle; }
th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); cursor: pointer; white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }
tbody tr:hover { background: rgba(196, 161, 90, 0.08); }
.name-btn { border: 0; background: transparent; padding: 0; font-weight: 750; text-align: left; }
.name-btn:hover { color: #8d7040; }
.scroll-hint { display: none; color: var(--muted); font-size: 12px; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; max-width: 640px; }
.edit-grid .wide { grid-column: 1 / -1; }
.stack-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid rgba(28,24,16,0.06); }
.line-actions, .photo-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mini {
  width: 96px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
}
.tiny { border: 0; background: transparent; color: #8d7040; font-weight: 700; padding: 6px 0; }
.tiny.danger { color: var(--danger); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.thumbs figure { margin: 0; }
.thumbs img { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; background: #ece7df; }
.thumbs figcaption { margin-top: 4px; font-size: 13px; }
.settings summary { cursor: pointer; font-weight: 750; }
.settings form { max-width: 520px; }
@media (max-width: 700px) {
  .edit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .filters, .tiles { grid-template-columns: 1fr 1fr; }
  .scroll-hint { display: block; }
  h1 { font-size: 26px; }
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .top { align-items: flex-start; }
}
