:root {
  --bg: #f3eee6;
  --panel: #fffdf8;
  --ink: #16110f;
  --wine: #7c2f3a;
  --gold: #c4a36a;
  --line: #e6ddd0;
  --muted: #6f6258;
  --dark: #100c0b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Outfit, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; }
.hidden { display: none !important; }
.kicker { letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.7rem; color: var(--wine); margin: 0 0 6px; }
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--dark);
  color: #f6efe6;
}
.login form {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  color: var(--ink);
  padding: 24px 18px;
  display: grid;
  gap: 10px;
}
.login h1 { margin: 0 0 4px; font-size: 2.2rem; }
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
aside {
  background: var(--dark);
  color: #f6efe6;
  padding: 24px 16px;
}
aside h1 { font-size: 1.5rem; margin: 0 0 8px; }
.aside-note { color: #cfc3b8; font-size: 0.82rem; margin: 0 0 22px; }
aside button, .aside-link {
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  padding: 11px 12px;
  cursor: pointer;
  font: inherit;
  display: block;
}
aside button.on, aside button:hover, .aside-link:hover { background: rgba(255,255,255,0.08); }
.aside-link { color: var(--gold); text-decoration: none; margin-top: 18px; }
#logout { margin-top: 8px; opacity: 0.75; }
main { padding: 28px; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 18px; }
.toolbar h2 { margin: 0; font-size: 2rem; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { border-bottom: 1px solid var(--line); padding: 12px; text-align: left; vertical-align: middle; }
img.thumb { width: 64px; height: 64px; object-fit: cover; background: #eee; }
input, textarea, select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
.btn { background: var(--wine); color: #fff; border: 0; padding: 10px 16px; cursor: pointer; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; }
.btn.ghost { background: transparent; color: var(--wine); border: 1px solid var(--wine); }
.modal {
  position: fixed; inset: 0; background: rgba(16,12,11,0.45);
  display: grid; place-items: center; padding: 16px; overflow: auto;
}
.modal form, .store-form {
  width: min(640px, 100%);
  background: #fff;
  padding: 22px;
  display: grid;
  gap: 10px;
}
.store-form { width: min(760px, 100%); }
.store-form h3 { margin: 18px 0 0; }
.error { color: #b42318; min-height: 1.2em; }
.ok { color: #2f6b3a; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-field { display: grid; gap: 8px; }
.preview { width: 120px; height: 120px; object-fit: cover; background: #eee; display: none; }
.preview.on { display: block; }
.hint { color: var(--muted); font-size: 0.82rem; margin: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  aside { padding: 14px 12px 8px; }
  aside h1 { font-size: 1.2rem; margin-bottom: 4px; }
  .aside-note { display: none; }
  aside {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
  }
  aside h1 { width: 100%; }
  aside button, .aside-link {
    width: auto;
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  #logout { margin-top: 0; margin-left: auto; }
  .aside-link { margin-top: 0; }
  main { padding: 16px 12px 28px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .btn { width: 100%; }
  .login { padding: 16px; }
  .login form { padding: 22px 16px; }
  .modal { padding: 8px; align-items: start; }
  .modal form, .store-form { width: 100%; padding: 16px; }
  table { min-width: 560px; }
}
