/* Roast — light cafe theme. Warm paper, espresso-brown ink, one serif face. */

:root {
  --bg: #faf6ee;
  --card: #fffdf8;
  --border: #e3d6bd;
  --border-strong: #c9b78d;
  --text: #2a1a0e;
  --muted: #7d6650;
  --accent: #5c3a1e;
  --accent-hover: #4a2c14;
  --danger: #a83a26;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  background: rgba(250, 246, 238, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { font-size: 2rem; }
.brand h1 { margin: 0; font-size: 1.5rem; letter-spacing: 0.5px; }
.tagline { margin: 0; color: var(--muted); font-size: 0.85rem; font-style: italic; }

.auth-area { display: flex; gap: 10px; align-items: center; }
.user-label { color: var(--muted); font-size: 0.9rem; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-menu { position: relative; }
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
}
.user-menu-btn:hover { border-color: var(--accent); }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}
.hamburger { color: var(--muted); font-size: 1rem; line-height: 1; }
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 150px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(42, 26, 14, 0.14);
  z-index: 20;
}
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.dropdown-item:hover { background: rgba(92, 58, 30, 0.08); }

.container { max-width: 1080px; margin: 0 auto; padding: 20px; }

.hero { text-align: center; padding: 60px 20px; }
.hero h2 { font-size: 2rem; margin-bottom: 8px; letter-spacing: -0.01em; }
.hero p { color: var(--muted); max-width: 540px; margin: 0 auto 20px; }

.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; background: var(--card); border: 1px solid var(--border-strong); }
.banner.error { border-left: 6px solid var(--danger); }
.banner.warning { border-left: 6px solid var(--accent); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar input[type="search"] {
  flex: 1 1 220px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text);
  font: inherit;
}
.toolbar select {
  padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text);
  font: inherit;
}
.toolbar input::placeholder { color: #ab9678; font-style: italic; }

.stats { color: var(--muted); font-size: 0.9rem; font-style: italic; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 2px 10px rgba(42, 26, 14, 0.06);
}
.card img.bean-photo { width: 100%; height: 180px; object-fit: cover; background: #efe6d3; }
.card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.2rem; letter-spacing: -0.01em; }
.meta { color: var(--muted); font-size: 0.88rem; }
.score-badge {
  align-self: flex-start; font-weight: 700; padding: 4px 14px; border-radius: 999px;
  background: var(--accent); color: #faf6ee; font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.score-badge.low { background: #a08d6c; }
.review { font-size: 0.98rem; line-height: 1.6; white-space: pre-wrap; margin: 0; }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.card-actions button { flex: 1; }

.empty { text-align: center; color: var(--muted); padding: 40px; font-style: italic; }

.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-head h2 { margin: 0; letter-spacing: -0.01em; }
.user-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.user-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(42, 26, 14, 0.06);
}
.user-info h3 { margin: 0 0 2px; font-size: 1.1rem; }
.user-info .meta { overflow-wrap: anywhere; }
.self-note { font-style: italic; }

.btn {
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; font-size: 0.95rem; font-weight: 600; font-family: inherit;
}
.btn.primary { background: var(--accent); color: #faf6ee; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.large { font-size: 1.1rem; padding: 14px 28px; }

dialog {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg); color: var(--text); padding: 24px;
  width: min(560px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(42, 26, 14, 0.2);
}
dialog::backdrop { background: rgba(42, 26, 14, 0.35); }
#beanForm { display: flex; flex-direction: column; gap: 12px; }
#beanForm h2 { margin: 0 0 4px; letter-spacing: -0.01em; }
#beanForm label { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
#beanForm input, #beanForm select, #beanForm textarea {
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text);
  font-size: 1rem; font-family: inherit;
}
#beanForm input::placeholder, #beanForm textarea::placeholder { color: #ab9678; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }
.form-error { color: var(--danger); margin: 0; }

.hidden { display: none !important; }
