/* ==========================================================
   Gạo Bookstore — bảng màu xanh dương + hồng pastel
   ========================================================== */

:root {
  --blue-700: #35699e;
  --blue-600: #4a87c4;
  --blue-500: #5b9bd5;
  --blue-400: #86bbe6;
  --blue-300: #a8cdf0;
  --blue-200: #cfe4f7;
  --blue-100: #e8f1fb;
  --blue-050: #f3f8fd;

  --pink-600: #d1749a;
  --pink-500: #e88aae;
  --pink-400: #f0a2c0;
  --pink-300: #f5b8ce;
  --pink-200: #fbd3e0;
  --pink-100: #fdf1f5;

  --ink: #20303f;
  --ink-soft: #3f5265;
  --muted: #657a8c;
  --muted-2: #8798a8;
  --line: #e6ecf5;
  --line-soft: #f0f4f9;
  --bg: #f6f8fc;
  --card: #ffffff;

  --ok: #2f9e6f;
  --ok-bg: #e9f7f0;
  --warn: #c98a1a;
  --warn-bg: #fdf5e4;
  --err: #d2544f;
  --err-bg: #fdeceb;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(32, 48, 63, 0.04), 0 2px 8px rgba(32, 48, 63, 0.04);
  --shadow: 0 2px 4px rgba(32, 48, 63, 0.04), 0 8px 24px rgba(32, 48, 63, 0.07);
  --shadow-lg: 0 12px 40px rgba(32, 48, 63, 0.12);

  --wrap: 1140px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; }
h1 { font-size: clamp(26px, 4vw, 38px); }
h2 { font-size: clamp(20px, 2.6vw, 27px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 18px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding-inline: 18px; }

/* ---------------------------- Header ---------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-400), var(--pink-400));
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: var(--shadow-sm);
}
.logo-text { font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -0.02em; white-space: nowrap; }
.logo-text span { color: var(--pink-600); }

.header-search { flex: 1; min-width: 0; }
.header-search form { display: flex; align-items: center; gap: 8px; background: var(--blue-050); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 16px; }
.header-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 14.5px; }
.header-search input::placeholder { color: var(--muted-2); }
.header-search button { border: 0; background: var(--blue-500); color: #fff; border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 600; cursor: pointer; }
.header-search button:hover { background: var(--blue-600); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.cart-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 8px 16px;
  font-weight: 600; font-size: 14px; color: var(--ink);
}
.cart-btn:hover { border-color: var(--blue-300); background: var(--blue-050); color: var(--ink); }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--pink-500); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.cart-count[data-empty='1'] { display: none; }

.nav-row { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.nav-row::-webkit-scrollbar { display: none; }
.nav-chip {
  white-space: nowrap; padding: 6px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--muted);
}
.nav-chip:hover { background: var(--blue-100); color: var(--blue-700); }
.nav-chip[aria-current='page'] { background: var(--ink); color: #fff; }

/* Nút lọc / sắp xếp: viên thuốc nền trắng có viền.
   Đừng đặt background bằng style inline — inline sẽ thắng nền đậm của
   trạng thái "đang chọn" mà chữ vẫn bị đổi sang trắng, thành trắng trên trắng. */
.filter-chip {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}
.filter-chip:hover { background: var(--blue-050); border-color: var(--blue-300); color: var(--blue-700); }
.filter-chip[aria-current='page'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* ---------------------------- Hero ---------------------------- */

.hero {
  background:
    radial-gradient(900px 340px at 8% -10%, var(--pink-100), transparent 70%),
    radial-gradient(900px 340px at 92% -20%, var(--blue-100), transparent 70%),
    #fff;
  border-bottom: 1px solid var(--line);
  padding: 56px 0 60px;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4.6vw, 46px); letter-spacing: -0.03em; margin-bottom: 14px; }
.hero h1 em { font-style: normal; color: var(--pink-600); }
.hero p { color: var(--muted); font-size: 16.5px; max-width: 46ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-badges { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 32px; }
.hero-badge { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-soft); font-weight: 500; }
.hero-badge i { width: 30px; height: 30px; border-radius: 9px; background: var(--blue-100); display: grid; place-items: center; font-style: normal; font-size: 15px; }

.hero-stack { position: relative; height: 320px; }
.hero-stack .sheet {
  position: absolute; border-radius: 16px; box-shadow: var(--shadow-lg);
  background: linear-gradient(160deg, #fff, var(--blue-050));
  border: 1px solid var(--line); overflow: hidden;
}
.hero-stack .s1 { width: 168px; height: 240px; left: 4%;  top: 40px; transform: rotate(-8deg); }
.hero-stack .s2 { width: 184px; height: 262px; left: 33%; top: 18px; transform: rotate(2deg); z-index: 2; }
.hero-stack .s3 { width: 168px; height: 240px; left: 63%; top: 46px; transform: rotate(9deg); }
.hero-stack .sheet img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------- Buttons ---------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 11px 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-500); color: #fff; box-shadow: 0 4px 14px rgba(91, 155, 213, 0.34); }
.btn-primary:hover { background: var(--blue-600); color: #fff; }
.btn-pink { background: var(--pink-500); color: #fff; box-shadow: 0 4px 14px rgba(232, 138, 174, 0.34); }
.btn-pink:hover { background: var(--pink-600); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--blue-300); background: var(--blue-050); color: var(--ink); }
.btn-soft { background: var(--blue-100); color: var(--blue-700); }
.btn-soft:hover { background: var(--blue-200); color: var(--blue-700); }
.btn-danger { background: var(--err-bg); color: var(--err); border-color: #f6d4d2; }
.btn-danger:hover { background: #fbdedc; color: var(--err); }
.btn-sm { padding: 7px 15px; font-size: 13.5px; }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.55; pointer-events: none; }

/* ---------------------------- Book grid ---------------------------- */

.section { padding: 46px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head p { color: var(--muted); margin: 4px 0 0; font-size: 14.5px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.09em; font-size: 12px; font-weight: 700; color: var(--pink-600); margin-bottom: 6px; }

.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.book-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.book-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--blue-200); }

.cover { position: relative; aspect-ratio: 3 / 4; background: linear-gradient(160deg, var(--blue-100), var(--pink-100)); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { width: 100%; height: 100%; display: grid; place-items: center; padding: 18px; text-align: center; }
.cover-fallback span { font-weight: 700; font-size: 15px; color: var(--blue-700); line-height: 1.35; }

.badge-sale {
  position: absolute; top: 10px; left: 10px;
  background: var(--pink-500); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(232, 138, 174, 0.4);
}
.badge-format {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255, 255, 255, 0.94); color: var(--ink-soft);
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 6px; letter-spacing: 0.04em;
}

.book-body { padding: 15px 16px 17px; display: flex; flex-direction: column; flex: 1; gap: 4px; }
.book-cat { font-size: 12px; color: var(--pink-600); font-weight: 600; }
.book-title { font-weight: 700; font-size: 15.5px; color: var(--ink); line-height: 1.35; }
.book-card:hover .book-title { color: var(--blue-700); }
.book-author { font-size: 13px; color: var(--muted-2); }
.book-price-row { display: flex; align-items: baseline; gap: 9px; margin-top: 10px; }
.price { font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -0.02em; }
.price-old { font-size: 13.5px; color: var(--muted-2); text-decoration: line-through; }
.book-foot { display: flex; gap: 8px; margin-top: 13px; }
.book-foot .btn { flex: 1; }
.sold-note { font-size: 12px; color: var(--muted-2); margin-top: 8px; }

/* ---------------------------- Cards & panels ---------------------------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.card-tight { padding: 18px; }
.card-pink { background: var(--pink-100); border-color: var(--pink-200); }
.card-blue { background: var(--blue-050); border-color: var(--blue-200); }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 34px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* ---------------------------- Forms ---------------------------- */

.field { display: block; margin-bottom: 16px; }
.field > label, .label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--muted-2); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; outline: none; font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px var(--blue-100); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23657a8c' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14.5px; margin-bottom: 12px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--blue-500); }

.alert { border-radius: var(--r); padding: 13px 16px; font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-bg); color: #1d6b4b; border-color: #cdebdd; }
.alert-err { background: var(--err-bg); color: #a83f3b; border-color: #f6d4d2; }
.alert-warn { background: var(--warn-bg); color: #8d6011; border-color: #f4e2bd; }
.alert-info { background: var(--blue-100); color: var(--blue-700); border-color: var(--blue-200); }

/* ---------------------------- Tags & status ---------------------------- */

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag-blue { background: var(--blue-100); color: var(--blue-700); }
.tag-pink { background: var(--pink-100); color: var(--pink-600); }
.tag-ok { background: var(--ok-bg); color: #1d6b4b; }
.tag-warn { background: var(--warn-bg); color: #8d6011; }
.tag-err { background: var(--err-bg); color: #a83f3b; }
.tag-grey { background: var(--line-soft); color: var(--muted); }

/* ---------------------------- Book detail ---------------------------- */

.detail { display: grid; grid-template-columns: 330px 1fr; gap: 40px; align-items: start; padding: 40px 0; }
.detail-cover { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); position: relative; }
.detail h1 { font-size: clamp(24px, 3.4vw, 34px); margin-bottom: 8px; }
.detail-author { color: var(--muted); font-size: 15.5px; margin-bottom: 20px; }
.detail-price { display: flex; align-items: baseline; gap: 12px; margin: 22px 0; }
.detail-price .price { font-size: 32px; }
.buy-box { background: var(--blue-050); border: 1px solid var(--blue-200); border-radius: var(--r-lg); padding: 20px; margin-top: 8px; }
.spec-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 24px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec-list div { font-size: 14px; }
.spec-list dt { color: var(--muted-2); font-size: 12.5px; margin-bottom: 2px; }
.spec-list dd { margin: 0; font-weight: 600; }
.prose { color: var(--ink-soft); font-size: 15.5px; line-height: 1.75; }
.prose p { margin-bottom: 1em; }

/* ---------------------------- Cart & checkout ---------------------------- */

.checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 30px; align-items: start; padding: 34px 0 60px; }

.cart-line { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
.cart-line:last-child { border-bottom: 0; }
.cart-thumb { width: 58px; height: 78px; flex: 0 0 58px; border-radius: 8px; overflow: hidden; background: var(--blue-100); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }

.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14.5px; }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-size: 17px; font-weight: 800; }
.summary-row.total span:last-child { color: var(--pink-600); }
.summary-row .off { color: var(--ok); font-weight: 600; }

.coupon-form { display: flex; gap: 8px; }
.coupon-form .input { flex: 1; text-transform: uppercase; }

/* ---------------------------- QR payment ---------------------------- */

.pay-grid { display: grid; grid-template-columns: 320px 1fr; gap: 34px; align-items: start; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; text-align: center; box-shadow: var(--shadow-sm); }
.qr-canvas { width: 260px; height: 260px; margin: 0 auto; display: grid; place-items: center; background: #fff; border-radius: var(--r); }
.qr-canvas svg, .qr-canvas canvas, .qr-canvas img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 8px;
}
.bank-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.bank-line:last-child { border-bottom: 0; }
.bank-line b { font-weight: 700; text-align: right; word-break: break-word; }
.copy-btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; color: var(--blue-600); cursor: pointer; margin-left: 6px; }
.copy-btn:hover { background: var(--blue-050); border-color: var(--blue-300); }

.countdown { font-weight: 800; font-size: 22px; color: var(--pink-600); font-variant-numeric: tabular-nums; }
.pay-status { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--muted); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--blue-200); border-top-color: var(--blue-500); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.steps { counter-reset: s; display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 13px; font-size: 14.5px; color: var(--ink-soft); }
.steps li::before {
  content: counter(s); flex: 0 0 26px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--blue-100); color: var(--blue-700);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}

/* ---------------------------- Download list ---------------------------- */

.dl-line { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; background: #fff; }
.dl-line:last-child { margin-bottom: 0; }
.dl-icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px; background: var(--pink-100); display: grid; place-items: center; font-size: 18px; }

/* ---------------------------- Table ---------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
table.data th { text-align: left; padding: 12px 14px; background: var(--blue-050); color: var(--ink-soft); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--blue-050); }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }

/* ---------------------------- Pagination ---------------------------- */

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 38px; height: 38px; padding: 0 12px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.pager a:hover { border-color: var(--blue-300); background: var(--blue-050); }
.pager .on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .off { opacity: 0.4; pointer-events: none; }

/* ---------------------------- Empty state ---------------------------- */

.empty { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); }

/* ---------------------------- Footer ---------------------------- */

.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 50px; padding: 44px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-2); margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-grid a { color: var(--ink-soft); }
.footer-grid a:hover { color: var(--blue-600); }
.footer-bottom { border-top: 1px solid var(--line-soft); margin-top: 32px; padding-top: 20px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted-2); }

/* ---------------------------- Admin ---------------------------- */

.admin-shell { display: grid; grid-template-columns: 218px 1fr; min-height: 100vh; }
.admin-side { background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .logo { margin-bottom: 26px; padding-left: 6px; }
.admin-nav { display: flex; flex-direction: column; gap: 3px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-soft); }
.admin-nav a:hover { background: var(--blue-050); }
.admin-nav a[aria-current='page'] { background: var(--blue-100); color: var(--blue-700); font-weight: 700; }
.admin-nav .sep { height: 1px; background: var(--line); margin: 12px 4px; }
.admin-main { padding: 26px 28px 60px; min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-head h1 { font-size: 25px; margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.stat dt { font-size: 12.5px; color: var(--muted-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat dd { margin: 6px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.stat .sub { font-size: 12.5px; color: var(--muted-2); font-weight: 500; margin-top: 3px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(700px 300px at 50% 0%, var(--pink-100), transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 32px; box-shadow: var(--shadow); }

.uploader { border: 2px dashed var(--line); border-radius: var(--r); padding: 18px; background: var(--blue-050); }
.uploader input[type='file'] { width: 100%; font-size: 13.5px; }
.file-current { display: flex; align-items: center; gap: 10px; font-size: 13.5px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; margin-bottom: 10px; }

/* ---------------------------- Responsive ---------------------------- */

@media (max-width: 1000px) {
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .checkout-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: 260px 1fr; gap: 28px; }
}

@media (max-width: 820px) {
  .hero { padding: 40px 0 44px; }
  .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero-stack { display: none; }
  .pay-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav { flex-direction: row; overflow-x: auto; }
  .admin-nav .sep { display: none; }
  .admin-main { padding: 20px 16px 50px; }
}

@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .header-bar { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 12px; }
  .header-search { order: 3; flex-basis: 100%; }
  .book-grid, .book-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .book-body { padding: 12px 12px 14px; }
  .price { font-size: 16px; }
  .detail { grid-template-columns: 1fr; gap: 24px; padding: 24px 0; }
  .detail-cover { max-width: 240px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat dd { font-size: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .qr-canvas { width: 100%; max-width: 260px; }
  .card { padding: 18px; }
}

@media print {
  .site-header, .site-footer, .btn, .admin-side { display: none !important; }
  body { background: #fff; }
}
