/* ===========================================================================
   AVA THUỲ NGUYỄN STUDIO — hệ thiết kế
   Mọi màu / bo góc / khoảng cách đều là biến ở :root.
   Đổi thương hiệu = đổi các biến bên dưới, không sửa chỗ khác.
   =========================================================================== */

:root {
  /* ---- Nền giấy kem, lấy đúng từ card thương hiệu ---- */
  --paper:    #fbf8f3;
  --paper-2:  #f1ece4;
  --paper-3:  #e7e0d4;

  /* ---- Chữ: đen than ngả ấm ---- */
  --ink:      #1f1c18;
  --ink-2:    #5c554c;
  --ink-3:    #8e8479;

  --line:     #e3dbce;
  --line-2:   #d3c8b8;

  /* ---- Nhấn: giữ đơn sắc như card — đen than trên nền kem ---- */
  --accent:       #2a2520;
  --accent-hover: #12100e;
  --accent-soft:  #efe9df;
  --accent-line:  #d8cdbc;
  --accent-warm:  #6f6558;  /* chỉ dùng cho mảng trang trí, không cho chữ nhỏ */
  --gold:         #9a8763;

  --ok:    #4f7a52;
  --warn:  #a4682a;
  --err:   #a34b45;

  /* ---- Hình khối ---- */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --shadow:      0 4px 18px rgba(90, 62, 48, 0.07);
  --shadow-pop:  0 20px 48px rgba(60, 40, 30, 0.18);

  /* ---- Chữ ---- */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* ---- Layout ---- */
  --maxw: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 62px;
  --bar-h: 60px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.25s;
}

/* ---------------------------------------------------------------- base --- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
figure, figcaption, blockquote { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hide { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- nút ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  font-weight: 600; font-size: 0.95rem; line-height: 1;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }

.btn--ghost { border-color: var(--line-2); color: var(--ink); background: var(--paper); }
.btn--ghost:hover { background: var(--paper-3); border-color: var(--ink-3); }

.btn--quiet { color: var(--ink-2); padding-inline: 12px; }
.btn--quiet:hover { color: var(--ink); background: var(--paper-3); }

.btn--sm { padding: 9px 16px; font-size: 0.87rem; }
.btn--lg { padding: 15px 30px; font-size: 1.02rem; }
.btn--block { width: 100%; }
.btn--danger { color: var(--err); border-color: var(--line-2); background: var(--paper); }
.btn--danger:hover { background: #fdf1f0; border-color: var(--err); }

/* ------------------------------------------------------------- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(255, 253, 251, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 14px; }

.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 600;
}
.brand-mark img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
/* Logo chữ nằm ngang (file PNG nền trong suốt) — bỏ khung tròn, để logo chạy tự do */
.brand-mark.is-wordmark {
  display: block;              /* KHÔNG dùng grid: height:100% của ảnh con sẽ
                                  không giải được trong hàng grid tự co */
  width: auto; height: auto; min-width: 0;
  border: 0; background: none; border-radius: 0;
}
.brand-mark.is-wordmark img {
  height: var(--logo-h, 34px); /* đặt thẳng bằng px, không dùng % */
  width: auto; max-width: 190px;
  border-radius: 0; object-fit: contain;
  /* Logo chữ đen trên nền trắng: multiply làm nền trắng tan vào nền kem,
     chỉ còn nét chữ. Đổi logoBlend trong config.js nếu logo đã trong suốt. */
  mix-blend-mode: var(--logo-blend, multiply);
}
.brand-text { min-width: 0; }
.brand-name {
  font-family: var(--font-display); font-size: 1.16rem; font-weight: 600;
  letter-spacing: 0.06em; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub {
  font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-3);
}

.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--paper);
  font-size: 0.8rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------- hero ---- */
.hero {
  padding-block: clamp(34px, 6vw, 66px) clamp(26px, 4vw, 44px);
  text-align: center;
  background:
    radial-gradient(ellipse 70% 100% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 14px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 500; line-height: 1.2; letter-spacing: 0.005em;
  margin: 0 auto; max-width: 20ch;
}
.hero-title span { display: block; }
.hero-title .l2 { color: var(--accent); font-style: italic; }
.hero-quote {
  margin: 18px auto 0; max-width: 46ch;
  color: var(--ink-2); font-size: 0.98rem;
}
.hero-meta {
  margin-top: 26px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
}
.meta-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--paper);
  font-size: 0.87rem; color: var(--ink-2);
}
.meta-chip b { color: var(--ink); font-weight: 600; }
.meta-chip--accent { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.meta-chip--warn { border-color: #ecdcc4; background: #fdf6ea; color: var(--warn); }

/* ------------------------------------------------------------ toolbar ---- */
.toolbar {
  position: sticky; top: var(--header-h); z-index: 35;
  background: rgba(255, 253, 251, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.toolbar .container {
  min-height: var(--bar-h);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-block: 9px;
}

.tabs { display: flex; gap: 6px; padding: 4px; background: var(--paper-3); border-radius: var(--r-pill); }
.tab {
  padding: 8px 17px;
  border: 0; border-radius: var(--r-pill);
  background: transparent;
  font-size: 0.88rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--paper); color: var(--accent); box-shadow: var(--shadow); }
.tab small { display: block; font-size: 0.7rem; font-weight: 500; opacity: 0.7; }

.counter {
  margin-left: auto;
  display: flex; align-items: baseline; gap: 7px;
  font-size: 0.88rem; color: var(--ink-2);
}
.counter b { font-size: 1.22rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.counter .over { color: var(--warn); font-weight: 600; }

.savestate {
  font-size: 0.76rem; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 0;
}
.savestate::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); flex: none;
}
.savestate[data-state="saving"]::before { background: var(--gold); }
.savestate[data-state="pending"]::before { background: var(--err); }
.savestate[data-state="demo"]::before { background: var(--ink-3); }

.tab-hint {
  width: 100%;
  font-size: 0.8rem; color: var(--ink-3);
  padding-bottom: 4px;
}

/* --------------------------------------------------------------- lưới ---- */
.gallery { padding-block: clamp(20px, 3vw, 32px) 96px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: clamp(10px, 1.6vw, 18px);
}

.photo {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper-3);
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
  cursor: zoom-in;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.photo:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.photo img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.photo img.loaded { opacity: 1; }

.photo-code {
  position: absolute; left: 8px; top: 8px;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: rgba(43, 36, 32, 0.55);
  backdrop-filter: blur(4px);
  color: #fff; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.photo-pick {
  position: absolute; right: 8px; bottom: 8px;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 253, 251, 0.92);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(60, 40, 30, 0.2);
  color: var(--accent); font-size: 1.2rem; line-height: 1;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.photo-pick:hover { transform: scale(1.09); }
.photo-pick:active { transform: scale(0.94); }

/* --- đóng dấu logo ------------------------------------------------------
   .wm phủ kín khung ảnh, <i> bên trong xoay nghiêng và lặp hoạ tiết.
   Giá trị --wm-* do app.js đặt theo CONFIG.watermark.                       */
.wm {
  position: absolute; inset: 0;
  overflow: hidden; pointer-events: none;
  user-select: none; -webkit-user-select: none;
  z-index: 1;
}
.wm i {
  position: absolute; inset: var(--wm-inset, -60%);
  display: block;
  background-image: var(--wm-tile);
  background-repeat: var(--wm-repeat, repeat);
  background-position: var(--wm-pos, 0 0);
  background-size: var(--wm-bg-size);
  opacity: var(--wm-opacity, 0.3);
  transform: rotate(var(--wm-rotate, -28deg));
}
/* Thẻ ảnh trong lưới nhỏ hơn nhiều nên dùng cỡ dấu riêng */
.photo .wm i {
  background-image: var(--wm-tile-sm, var(--wm-tile));
  background-size: var(--wm-bg-size-sm, var(--wm-bg-size));
}
.photo-code, .photo-pick, .photo-dl { z-index: 3; }
.photo.is-picked::after { z-index: 2; }

/* Chặn kéo ảnh ra ngoài khi album đang khoá file gốc */
body.no-save img { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }

.photo-dl {
  position: absolute; left: 8px; bottom: 8px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 253, 251, 0.92);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(60, 40, 30, 0.2);
  color: var(--ink-2); font-size: 0.95rem; line-height: 1;
  cursor: pointer; opacity: 0;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.photo:hover .photo-dl, .photo-dl:focus-visible { opacity: 1; }
.photo-dl:hover { transform: scale(1.09); color: var(--accent); }
@media (hover: none) { .photo-dl { opacity: 1; } }

.wm-notice {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.76rem; color: var(--ink-3);
}

.photo.is-picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.photo.is-picked .photo-pick { background: var(--accent); color: #fff; }
.photo.is-picked::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(141, 92, 84, 0.16), transparent 45%);
  pointer-events: none;
}
.photo.has-note .photo-code::after { content: " ✎"; }

.photo.is-loading {
  background: linear-gradient(100deg, var(--paper-3) 30%, var(--paper-2) 50%, var(--paper-3) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}
.photo.is-failed::before {
  content: "⟳";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--ink-3); font-size: 1.4rem;
}
.skeleton { background: linear-gradient(100deg, var(--paper-3) 30%, var(--paper-2) 50%, var(--paper-3) 70%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ------------------------------------------------------- thanh dưới ------ */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
  background: rgba(255, 253, 251, 0.95);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  transition: transform 0.35s var(--ease);
}
.actionbar.show { transform: translateY(0); }
.actionbar .container { display: flex; align-items: center; gap: 12px; }
.actionbar .sum { font-size: 0.86rem; color: var(--ink-2); margin-right: auto; }
.actionbar .sum b { color: var(--ink); }

/* ------------------------------------------------------------- modal ----- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: none;
  background: rgba(38, 30, 26, 0.62);
  backdrop-filter: blur(3px);
}
.modal.open { display: block; }

.sheet {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(720px, 100%);
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-pop);
  animation: slideUp 0.32s var(--ease);
}
@keyframes slideUp { from { transform: translate(-50%, 22px); opacity: 0; } }

.sheet-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.sheet-title {
  font-family: var(--font-display); font-size: 1.42rem; font-weight: 600;
  margin: 0; margin-right: auto;
}
.sheet-body { padding: 18px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  padding: 14px 22px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center;
  background: var(--paper-2);
  border-radius: 0;
}
.icon-btn {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%;
  background: var(--paper); color: var(--ink-2);
  cursor: pointer; font-size: 1rem;
}
.icon-btn:hover { background: var(--paper-3); color: var(--ink); }

/* --- bảng tóm tắt --- */
.sum-stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; margin-bottom: 20px;
}
.sum-stat { background: var(--paper); padding: 14px 16px; }
.sum-stat span { display: block; font-size: 0.76rem; color: var(--ink-3); letter-spacing: 0.02em; }
.sum-stat b { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-stat--extra b { color: var(--warn); }
.sum-stat--cost b { color: var(--accent); font-size: 1.2rem; }

.sum-group-title {
  font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin: 18px 0 10px;
}
.sum-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sum-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper);
}
.sum-item img { width: 46px; height: 58px; object-fit: cover; border-radius: var(--r-xs); flex: none; background: var(--paper-3); }
.sum-item .t { min-width: 0; flex: 1; }
.sum-item .t b { display: block; font-size: 0.88rem; font-weight: 600; }
.sum-item .t small { display: block; color: var(--ink-3); font-size: 0.76rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-hint { font-size: 0.83rem; color: var(--ink-3); margin: 16px 0 0; }
.empty-note { text-align: center; color: var(--ink-3); padding: 34px 10px; }

/* --- lightbox --- */
.lightbox {
  position: fixed; inset: 0; z-index: 70; display: none;
  background: #14110e;   /* đục hoàn toàn: nền trang lộ qua làm rối mắt khi ngắm ảnh */
}
.lightbox.open { display: flex; flex-direction: column; }
.lb-top {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px calc(8px + env(safe-area-inset-top));
  color: #f3ece6;
}
.lb-name { font-size: 0.88rem; margin-right: auto; opacity: 0.85;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-tag {
  font-size: 0.72rem; padding: 4px 10px; border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.28); flex: none;
}
.lb-close {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28); background: transparent;
  color: #f3ece6; cursor: pointer;
}
/* Dùng flex chứ không dùng grid: trong grid có hàng auto, max-height:100%
   của ảnh không giải được nên ảnh cao tràn xuống đè lên ô ghi chú. */
.lb-stage {
  flex: 1; position: relative; min-height: 0; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
}
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-xs); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(26, 21, 18, 0.45); color: #fff;
  font-size: 1.2rem; cursor: pointer;
}
.lb-nav:hover { background: rgba(26, 21, 18, 0.8); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
/* Khung điều khiển phải thật gọn: trên điện thoại mỗi pixel lấy được đều
   dồn cho ảnh. Ô ghi chú thu thành nút ✎, chỉ bung ra khi khách cần. */
.lb-bottom {
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  display: grid; gap: 8px;
  background: rgba(255, 253, 251, 0.06);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.lb-note-row { display: grid; }
.lb-note-row textarea {
  width: 100%; min-height: 46px; resize: vertical;
  padding: 9px 11px; border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07); color: #fff;
  font: inherit; font-size: 0.9rem;
}
.lb-note-row textarea::placeholder { color: rgba(243, 236, 230, 0.45); }

.lb-actions { display: flex; gap: 8px; }
.lb-actions .btn { flex: 1; padding-block: 11px; }
.btn--icon-lb {
  flex: 0 0 auto !important;
  width: 50px; padding: 11px 0;
  background: transparent; color: #f3ece6;
  border-color: rgba(255, 255, 255, 0.3);
  position: relative;
}
.btn--icon-lb:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn--icon-lb.is-on { background: rgba(255, 255, 255, 0.16); }
/* Chấm báo ảnh này đã có ghi chú */
.btn--icon-lb.has-note::after {
  content: ""; position: absolute; top: 8px; right: 11px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent-warm);
}
.lb-wm { position: absolute; }
.lb-baking { position: absolute; right: 14px; top: 14px; width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.8s linear infinite; }
.btn--pick-lb { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.btn--pick-lb.is-on { background: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------ khối dịch vụ ---- */
.services { background: var(--paper); border-top: 1px solid var(--line); padding-block: clamp(40px, 6vw, 72px); }
.services-head { text-align: center; max-width: 620px; margin: 0 auto 32px; }
.services-title { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 500; margin: 0 0 8px; }
.services-sub { color: var(--ink-2); margin: 0; font-size: 0.95rem; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.svc-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; background: var(--paper); }
.svc-ico { font-size: 1.2rem; color: var(--accent); margin-bottom: 8px; }
.svc-card h3 { margin: 0 0 14px; font-size: 1.06rem; font-weight: 600; }
.svc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.svc-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem;
  padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.svc-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.svc-list .price { font-weight: 600; color: var(--accent); white-space: nowrap; }
.svc-list .tagnote { display: block; font-size: 0.78rem; color: var(--gold); }
.services-note { text-align: center; color: var(--ink-3); font-size: 0.85rem; margin-top: 26px; }

/* ------------------------------------------------------------ footer ----- */
.site-footer { background: var(--ink); color: #e8ded6; padding-block: 40px 90px; text-align: center; }
.footer-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; margin: 0 0 18px; }
.contact-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 26px; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #f3ece6; font-size: 0.9rem; font-weight: 600;
}
.contact-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.contact-btn--primary { background: var(--accent); border-color: var(--accent); }
.contact-btn--primary:hover { background: var(--accent-hover); }
.footer-fine { font-size: 0.78rem; color: rgba(232, 222, 214, 0.5); }

/* ------------------------------------------------------------- state ----- */
.state {
  text-align: center; padding: clamp(50px, 12vw, 110px) 20px;
  max-width: 520px; margin-inline: auto;
}
.state-ico { font-size: 2.2rem; color: var(--accent-warm); margin-bottom: 14px; }
.state h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; margin: 0 0 10px; }
.state p { color: var(--ink-2); margin: 0 0 20px; }

.spinner {
  width: 30px; height: 30px; margin: 0 auto 16px;
  border: 2.5px solid var(--line-2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- toast ----- */
.toast {
  position: fixed; left: 50%; bottom: 84px; z-index: 90;
  transform: translate(-50%, 16px);
  padding: 11px 20px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; font-size: 0.88rem;
  box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================================
   ADMIN
   ========================================================================= */
.adm-wrap { padding-block: 28px 60px; }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 600;
  margin: 0 0 4px; display: flex; align-items: center; gap: 10px;
}
.card-sub { color: var(--ink-2); font-size: 0.88rem; margin: 0 0 18px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.83rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 0.78rem; color: var(--ink-3); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper-2); color: var(--ink);
  font: inherit; font-size: 0.94rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(141, 92, 84, 0.12);
  background: var(--paper);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* --- công tắc bật/tắt (đóng dấu · cho tải gốc) --- */
.switch-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 15px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper-2);
}
.switch-row .lbl { flex: 1; font-size: 0.9rem; font-weight: 600; }
.switch-row .lbl small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--ink-3); }
.switch {
  appearance: none; -webkit-appearance: none;
  width: 46px; height: 27px; flex: none; margin: 0;
  border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: var(--paper-3); position: relative; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 1px 4px rgba(60, 40, 30, 0.25);
  transition: transform var(--dur) var(--ease);
}
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(19px); }

.result-box {
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  border-radius: var(--r-md); padding: 16px; margin-top: 16px;
}
.result-link {
  display: block; word-break: break-all; font-size: 0.88rem;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 12px; margin: 10px 0 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.day-group { margin-bottom: 26px; }
.day-head {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.day-head b { font-size: 0.95rem; }
.day-head span { font-size: 0.8rem; color: var(--ink-3); }

.row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 14px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--paper); margin-bottom: 9px;
}
.row-main { min-width: 190px; flex: 1; }
.row-main b { display: block; font-size: 0.98rem; }
.row-main small { color: var(--ink-3); font-size: 0.79rem; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--r-pill);
  font-size: 0.78rem; font-weight: 600;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--paper-2);
}
.pill--ok { border-color: #cfe0cf; background: #f0f6f0; color: var(--ok); }
.pill--wait { border-color: #ecdcc4; background: #fdf6ea; color: var(--warn); }
.pill--extra { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.pill--owner { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

.login-box { max-width: 420px; margin: 12vh auto; text-align: center; }
.login-box .brand { justify-content: center; margin: 0 0 20px; }

/* --------------------------------------------------------- responsive --- */
@media (max-width: 780px) {
  .field-row { grid-template-columns: 1fr; }
  .toolbar .container { gap: 9px; }
  .counter { width: 100%; margin-left: 0; order: 3; justify-content: flex-start; }
  .savestate { order: 4; margin-left: auto; }
  .sheet { border-radius: var(--r-lg) var(--r-lg) 0 0; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .tabs { flex: 1; }
  .tab { flex: 1; text-align: center; padding-inline: 10px; }
  .lb-nav { width: 40px; height: 40px; }
  .actionbar .sum { font-size: 0.8rem; }
  .brand-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
