/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* ── Tokens ── */
:root {
  --bg:      #F9F6EF;
  --surface: #EFEADE;
  --ink:     #1C1710;
  --mid:     #756A59;
  --faint:   #C4B89E;
  --accent:  #C07D0A;
  --red:     #A63020;
  --green:   #3C6B33;
  --border:  #DDD5C4;
  --radius:  8px;
  --shadow:  0 2px 12px rgba(28,23,16,.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:      #120F08;
    --surface: #1D1912;
    --ink:     #EDE8DE;
    --mid:     #8A8070;
    --faint:   #3C3830;
    --accent:  #D99420;
    --red:     #C04030;
    --green:   #4E7B45;
    --border:  #2C2820;
    --shadow:  0 2px 12px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg:      #120F08;
  --surface: #1D1912;
  --ink:     #EDE8DE;
  --mid:     #8A8070;
  --faint:   #3C3830;
  --accent:  #D99420;
  --red:     #C04030;
  --green:   #4E7B45;
  --border:  #2C2820;
  --shadow:  0 2px 12px rgba(0,0,0,.3);
}

/* ── Base ── */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

/* ── Nav ── */
.sitenav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 100;
}
.sitenav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 5vw;
  display: flex;
  align-items: center;
  gap: 24px;
}
.sitenav__logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}
.sitenav__links {
  display: flex;
  gap: 4px;
  list-style: none;
}
.sitenav__links a {
  display: block;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--mid);
  text-decoration: none;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.sitenav__links a:hover, .sitenav__links a.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.sitenav__auth { display: flex; gap: 8px; align-items: center; }
.sitenav__user {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--mid);
}
.sitenav__burger {
  display: none;
  background: none; border: none;
  font-size: 1.2rem; color: var(--ink); cursor: pointer;
  padding: 4px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: opacity .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { opacity: .85; }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--red { background: var(--red); color: #fff; border-color: var(--red); }
.btn--sm { padding: 6px 14px; font-size: 0.78rem; }
.btn--full { width: 100%; justify-content: center; }

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow .15s;
}
.card:hover { box-shadow: var(--shadow); }
.card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--border);
}
.card__img--placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--faint);
}
.card__body { padding: 16px; }
.card__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.card__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
}
.card__desc {
  font-size: 0.85rem;
  color: var(--mid);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.card__meta {
  font-size: 0.78rem;
  color: var(--mid);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Page header ── */
.page-header {
  padding: 48px 5vw 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-header__eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.page-header__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
}
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 5vw;
}

/* ── Forms ── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 40px;
}
.form-section__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group--full { grid-column: 1 / -1; }
.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mid);
  letter-spacing: .05em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.75rem; color: var(--mid); }

/* Password toggle */
.pass-wrap { position: relative; }
.pass-wrap .form-input { padding-right: 42px; }
.pass-toggle {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--mid); cursor: pointer; font-size: 0.85rem;
}

/* Dish rows (fast food) */
.dish-rows { display: flex; flex-direction: column; gap: 10px; }
.dish-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
}
.dish-row__remove {
  background: none; border: none;
  color: var(--red); cursor: pointer;
  font-size: 1.1rem; padding: 4px;
}

/* ── Auth pages ── */
.auth-wrap {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
}
.auth-box__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-box__sub { font-size: 0.88rem; color: var(--mid); margin-bottom: 24px; }
.auth-box__form { display: flex; flex-direction: column; gap: 14px; }
.auth-box__alt { font-size: 0.82rem; color: var(--mid); text-align: center; margin-top: 16px; }
.auth-box__alt a { color: var(--accent); }

/* ── Flash messages ── */
.flash {
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
}
.flash--ok  { background: color-mix(in srgb, var(--green) 12%, var(--bg)); color: var(--green); }
.flash--err { background: color-mix(in srgb, var(--red)   12%, var(--bg)); color: var(--red);   }

/* ── Chips / tags ── */
.chip {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--mid);
  background: var(--bg);
}
.chip--accent { border-color: var(--accent); color: var(--accent); }
.chip--red    { border-color: var(--red);    color: var(--red);    }
.chip--green  { border-color: var(--green);  color: var(--green);  }

/* ── Price badge ── */
.price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.filter-btn {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--mid);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.filter-btn.active, .filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg));
}
.fb-toggle {
  margin-left: auto;
  flex-shrink: 0;
  gap: 4px;
}
.fb-toggle--open {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
  border-color: var(--accent);
  color: var(--accent);
}
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  animation: fbIn .16s ease;
}
@keyframes fbIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--mid);
}
.empty-state__icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state__title { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.empty-state__sub { font-size: 0.9rem; }

/* ── Footer ── */
.sitefooter {
  padding: 28px 5vw;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.sitefooter__name { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 0.95rem; }
.sitefooter__copy { font-size: 0.78rem; color: var(--mid); }

/* ── Social links ── */
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--mid);
  transition: all .15s;
}
.social-link:hover { border-color: var(--accent); color: var(--accent); }
.social-link--fb  { border-color: #1877F2; color: #1877F2; }
.social-link--zalo { border-color: #0068FF; color: #0068FF; }

/* ── Edit/Delete Modal ── */
dialog.edit-modal {
  border: none; border-radius: 14px; padding: 0;
  max-width: 580px; width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
  background: var(--bg); color: var(--ink);
}
dialog.edit-modal::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head__title { font-family:'Cormorant Garamond',serif; font-size:1.25rem; font-weight:700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: var(--mid); padding: 4px 8px;
  border-radius: 4px; line-height: 1;
}
.modal-close:hover { background: var(--surface); }
.modal-body { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.modal-foot {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}
.card-actions { display: flex; gap: 6px; margin-top: 8px; }
.btn--danger { background: none; border: 1px solid var(--red); color: var(--red); }
.btn--danger:hover { background: var(--red); color: #fff; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sitenav__links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    flex-direction: column;
  }
  .sitenav__links.open { display: flex; }
  .sitenav__burger { display: block; }
  .sitenav__auth .btn { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .dish-row { grid-template-columns: 1fr 1fr; }
  .dish-row > *:nth-child(3) { grid-column: 1; }
  .dish-row__remove { grid-column: 2; justify-self: end; grid-row: 1; }
  .page-header { padding: 28px 5vw 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
