:root {
  --bg: #0b111a;
  --bg-elevated: #101822;
  --card: #141b24;
  --card-hover: #182130;
  --ink: #f3f6fa;
  --muted: #8b95a5;
  --line: #243041;
  --line-soft: #1b2533;
  --teal: #2dd4a8;
  --teal-bg: rgba(45, 212, 168, 0.12);
  --teal-border: rgba(45, 212, 168, 0.28);
  --rose: #fb7185;
  --rose-bg: rgba(251, 113, 133, 0.12);
  --rose-border: rgba(251, 113, 133, 0.28);
  --gold: #fbbf24;
  --gold-dim: #4b5563;
  --shadow: none;
  --radius: 16px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
}

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 1.25rem auto 4rem;
}

.page-title {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.top {
  width: min(1080px, calc(100% - 32px));
  margin: 1.4rem auto 0;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
}

.brand small { color: var(--muted); }

.mark {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--teal-bg);
  border: 1px solid var(--teal-border);
  color: var(--teal);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.hero { margin: 2rem 0 1.2rem; }
.hero h1, .item-head h1, .list-title, .card h2 {
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.hero p, .lede { color: var(--muted); margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.1rem;
  box-shadow: var(--shadow);
}

.grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* Hàng 1 chỉ 1 card; card vẫn cùng width cột như các card dưới */
.grid > li:nth-child(2) {
  grid-column-start: 1;
}

.item-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.item-card:hover {
  background: var(--card-hover);
  border-color: #2c3a4f;
}

.item-card .card-top {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.item-card .card-top .mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 1.15rem;
}

.item-card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink);
}

.item-card .lede {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line-soft);
}

.score-row .score-meta {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}

.score-row .score-meta strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.score-row .score-meta span {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.item-card .open-review {
  align-self: stretch;
  margin: 0.55rem 0 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--teal-bg);
  color: var(--teal);
  border: 1px solid var(--teal-border);
  padding: 0.55rem 0.85rem;
  font-weight: 650;
}

.item-card .open-review:hover {
  background: rgba(45, 212, 168, 0.2);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.82rem;
}

.card-foot .accent {
  color: var(--rose);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.meta, .hint, .crumb, .foot, time {
  color: var(--muted);
  font-size: 0.88rem;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.95rem;
}

.search { flex: 1; }

.search span, label, legend {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input, textarea, button { font: inherit; }

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  color: var(--ink);
}

textarea { resize: vertical; }

input::placeholder,
textarea::placeholder { color: #5d6878; }

input:focus, textarea:focus {
  outline: 0;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(45, 212, 168, 0.15);
}

button {
  margin-top: 0.85rem;
  background: var(--teal);
  color: #04120e;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-weight: 650;
  cursor: pointer;
}

button:hover { filter: brightness(1.06); }

button.ghost, button.danger {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

button.ghost:hover {
  background: var(--bg-elevated);
}

button.danger {
  color: var(--rose);
  border-color: var(--rose-border);
  background: var(--rose-bg);
}

button.danger:hover {
  filter: brightness(1.08);
}

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.35rem;
}

.admin-bar h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}
.admin-bar button { margin-top: 0; }

.admin-panel { margin-bottom: 1rem; }

.admin-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.7rem;
}
.admin-actions button { margin-top: 0; }

.review-dialog {
  width: min(440px, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.review-dialog::backdrop {
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(3px);
}

.dialog-close-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0 0 0.35rem;
}

.dialog-close-row strong {
  font-size: 1.05rem;
  font-weight: 650;
}

.dialog-close-row button {
  margin: 0;
  padding: 0.4rem 0.75rem;
}

.dialog-item {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.review-dialog .review-form { margin: 0; }
.review-dialog .stars-input { margin-bottom: 0.85rem; }

.reviews {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow: auto;
  padding-right: 0.15rem;
}

.stats .score {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0 0.55rem;
}

.stats strong {
  font-size: 1.15rem;
  font-weight: 700;
}

.review {
  padding: 0.6rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.review header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: center;
  margin-bottom: 0.2rem;
}

.review header strong {
  color: var(--ink);
  font-weight: 650;
}

.review p {
  margin: 0;
  white-space: pre-wrap;
  color: #c8d0dc;
  font-size: 0.92rem;
}

.add-item, .review-form { margin-bottom: 1rem; }

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}

.stars {
  color: var(--gold-dim);
  letter-spacing: 0.08em;
}

.stars i { font-style: normal; }
.stars i.on, .stars i.half { color: var(--gold); }
.stars i.half { opacity: 0.7; }

.stars-input {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.stars-input input { display: none; }

.stars-input label {
  font-size: 1.7rem;
  line-height: 1;
  color: var(--gold-dim);
  cursor: pointer;
  margin: 0 0.05rem;
  text-transform: none;
  letter-spacing: 0;
}

.stars-input input:checked ~ label,
.stars-input:not(:checked) label:hover,
.stars-input:not(:checked) label:hover ~ label {
  color: var(--gold);
}

.empty {
  color: var(--muted);
  padding: 0.35rem 0.1rem;
  margin: 0;
  font-size: 0.9rem;
}

.err {
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid var(--rose-border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  margin: 0 0 0.8rem;
}

.foot {
  text-align: center;
  padding: 0 1rem 2.5rem;
  color: var(--muted);
}

@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
}
