:root {
  --ink: #16110e;
  --ink-2: #1c1612;
  --panel: #241c16;
  --line: rgba(250, 244, 235, 0.12);
  --cream: #f3eee4;
  --mute: #a39282;
  --dim: #7a6b5d;
  --brass: #c4783a;
  --ok: #8adf6a;
  --red: #d45a4a;
  --display: "Fraunces", Georgia, serif;
  --ui: "Outfit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--brass); text-decoration: none; }
a:hover { color: #e0c089; }
h1, h2, h3 { font-family: var(--display); margin: 0 0 0.35em; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0 0 1em; }

.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side {
  background: #100c0a;
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--cream); font-family: var(--display); font-weight: 700;
}
.brand-mark {
  width: 22px; height: 22px; background: #1b1612; border-radius: 6px;
  position: relative;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; background: var(--brass); border-radius: 2px;
}
.brand-mark::before { width: 12px; height: 4px; left: 3px; top: 9px; }
.brand-mark::after { width: 4px; height: 9px; left: 11px; top: 9px; }

.side-nav { display: grid; gap: 3px; }
.side-nav a {
  color: var(--mute); padding: 9px 12px; border-radius: 9px; font-weight: 500; font-size: 14.5px;
}
.side-nav a:hover, .side-nav a.is-active { background: rgba(201, 163, 106, .12); color: var(--brass); }
.side-user { margin-top: auto; font-size: 13px; color: var(--dim); }
.side-user a { color: var(--mute); }
.side-user a:hover { color: var(--red); }

.admin-main { padding: 32px 36px 64px; max-width: 1080px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 1.9rem; margin: 0; }
.muted { color: var(--mute); }
.hint { color: var(--mute); font-size: 13.5px; font-weight: 400; }

.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; border-radius: 10px;
  padding: 10px 16px; text-decoration: none; color: var(--cream);
  background: var(--panel); border: 1px solid var(--line);
}
.btn:hover { border-color: var(--brass); color: var(--brass); }
.btn-primary { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.btn-primary:hover { background: #e0c089; color: var(--ink); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { padding: 7px 11px; font-size: 13px; }

.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.flash-ok { background: rgba(138, 223, 106, .12); color: var(--ok); }
.flash-error { background: rgba(212, 90, 74, .14); color: #ff8a8a; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
}
.card h2 { font-size: 1.15rem; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--mute); font-weight: 600; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--cream);
  background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.form textarea { min-height: 88px; resize: vertical; }
.form label:has(input[type='checkbox']) { display: flex; align-items: center; gap: 10px; }
.form input[type='checkbox'] { width: auto; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--brass); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat b { display: block; font-family: var(--display); font-size: 1.8rem; line-height: 1; margin-bottom: 4px; color: var(--brass); }
.stat span { color: var(--mute); font-size: 13px; }
.stat .cmp { margin-top: 6px; font-size: 12px; color: var(--dim); }
.delta { font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: var(--ok); background: rgba(138,223,106,.12); }
.delta.down { color: #ff8a8a; background: rgba(212,90,74,.12); }
.delta.flat { color: var(--dim); }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; margin-top: 8px; }
.bars .bar { flex: 1; background: linear-gradient(180deg, #e0c089, var(--brass)); min-height: 2px; border-radius: 3px 3px 0 0; position: relative; }
.bars .bar span {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--ink-2); border: 1px solid var(--line); color: var(--cream);
  font-size: 11px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; opacity: 0; margin-bottom: 4px; pointer-events: none;
}
.bars .bar:hover span { opacity: 1; }
.barx { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; margin-top: 6px; }

.statrow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.statrow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statrow .ct { font-variant-numeric: tabular-nums; color: var(--brass); font-weight: 700; }

.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tablist { width: 100%; border-collapse: collapse; font-size: 14px; }
.tablist th, .tablist td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tablist th { color: var(--mute); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.tablist td.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.preview { width: 100%; max-width: 420px; border-radius: 12px; display: block; margin-top: 8px; object-fit: cover; max-height: 180px; }
.pill { font-size: 11px; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--mute); }
.pill.on { color: var(--brass); border-color: rgba(201,163,106,.4); }
.pill.off { opacity: .6; }

.hours-day {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 10px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.hours-day .day-name { font-weight: 600; color: var(--cream); padding-bottom: 10px; }
.slot { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.slot span { color: var(--dim); }

.donut-box { display: flex; align-items: center; gap: 22px; margin-top: 12px; }
.donut-chart { width: 168px; height: 168px; position: relative; flex-shrink: 0; }
.donut-ring { width: 100%; height: 100%; border-radius: 50%; }
.donut-hole {
  position: absolute; inset: 22%;
  background: var(--panel); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-hole b { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.donut-hole span { font-size: 11px; color: var(--mute); margin-top: 2px; }
.donut-legend { flex: 1; min-width: 0; }
.donut-legend .lg { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.donut-legend .lg:last-child { border-bottom: 0; }
.donut-legend .lg i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-legend .lg .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .lg .pct { color: var(--mute); font-size: 12px; white-space: nowrap; }
.donut-legend .lg .ct { color: var(--brass); font-weight: 600; white-space: nowrap; }

.demo-access {
  margin: 16px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(196, 120, 58, 0.08);
}
.demo-access > p {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 600;
}
.demo-access div { display: grid; gap: 2px; margin-top: 8px; }
.demo-access span { font-size: 11px; color: var(--mute); }
.demo-access code {
  font-family: ui-monospace, "IBM Plex Mono", monospace;
  font-size: 13.5px;
  color: var(--brass);
  word-break: break-all;
}

.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(700px 320px at 50% -10%, rgba(201,163,106,.12), transparent 60%), var(--ink);
}
.login-card {
  width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px 24px;
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { padding: 14px; }
  .side-nav { grid-template-columns: repeat(2, 1fr); }
  .side-user { margin-top: 8px; }
  .admin-main { padding: 20px 16px 48px; }
  .form-row, .form-row-3, .stats, .twocol, .hours-day { grid-template-columns: 1fr; }
  .donut-box { flex-direction: column; align-items: flex-start; }
  .page-head { flex-direction: column; align-items: start; }
}
