/* ==========================================================
   PhoneStore - style.css
   Thay thế theme.css và sanpham.css
   ========================================================== */

:root {
  --ink: #14171f;
  --ink-soft: #5b6270;
  --line: #e6e8ec;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --accent: #0a6cff;
  --accent-dark: #0856cc;
  --price: #d6232f;
  --menu-bg: #14171f;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(20, 23, 31, 0.08);
  --font:
    "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  /* Đẩy footer xuống đáy, không để khoảng trắng thừa */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 3px solid rgba(10, 108, 255, 0.45);
  outline-offset: 2px;
}

/* Ghi đè .container của Bootstrap nếu còn dùng ở trang khác */
.container {
  max-width: 1200px;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.page {
  padding-top: 20px;
  padding-bottom: 40px;
}

/* ---------- Top bar ---------- */
.topbar {
  background: #0b0d12;
  color: #c9ced8;
  font-size: 13px;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 7px;
  padding-bottom: 7px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.logo:hover {
  text-decoration: none;
}
.logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  border-radius: 10px;
}
.logo-text {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.search {
  display: flex;
  max-width: 560px;
  width: 100%;
  justify-self: center;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 999px;
  overflow: hidden;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.search:focus-within {
  background: #fff;
  border-color: var(--accent);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 18px;
  font: inherit;
  outline: none;
}
.search button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 0 16px;
  cursor: pointer;
}
.search button:hover {
  color: var(--accent);
}

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.cart-link:hover {
  text-decoration: none;
  border-color: var(--ink);
}
.cart-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  background: var(--price);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
}

/* ---------- Menu ---------- */
.menu {
  background: var(--menu-bg);
}
.menu-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.menu ul::-webkit-scrollbar {
  display: none;
}
.menu li {
  flex: 0 0 auto;
}
.menu a {
  display: block;
  color: #e8ebf1;
  padding: 13px 16px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.menu a:hover {
  color: #fff;
  text-decoration: none;
  border-bottom-color: var(--accent);
}
.menu-sub a {
  font-size: 13px;
  color: #9aa2b1;
  padding: 13px 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  text-align: center;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
}
.btn-outline {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover {
  border-color: var(--ink);
}
.btn-light {
  background: #fff;
  color: var(--ink);
}
.btn-light:hover {
  background: #e9ecf2;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
.btn-lg {
  padding: 12px 24px;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
  gap: 24px;
  padding: 36px 40px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(120deg, #14171f 0%, #1c2a4a 60%, #0a6cff 140%);
  overflow: hidden;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 0 0 20px;
  color: #cfd6e6;
}

.hero-art {
  position: relative;
  height: 170px;
}
.device {
  position: absolute;
  background: #0b0d12;
  border: 3px solid #3a4258;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.device::after {
  /* màn hình */
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: linear-gradient(160deg, #3d86ff, #1b2a52);
}
.device-tablet {
  width: 230px;
  height: 150px;
  right: 70px;
  bottom: 0;
  border-radius: 16px;
}
.device-phone {
  width: 84px;
  height: 160px;
  right: 0;
  bottom: -8px;
  border-radius: 18px;
}
.device-phone::after {
  background: linear-gradient(160deg, #ff9a56, #2a1b52);
}

/* ---------- Tiêu đề ---------- */
.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 28px 0 14px;
}
.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 4px 0 16px;
}

/* ---------- Lưới sản phẩm ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.sanpham {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}
.sanpham:hover {
  box-shadow: var(--shadow);
  border-color: #d3d7de;
}

/* Khung ảnh vuông, kích thước đồng đều */
.sanpham-img {
  aspect-ratio: 1 / 1;
  background: #f7f8fa;
  display: grid;
  place-items: center;
  padding: 14px;
}
.sanpham-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.no-img {
  color: var(--ink-soft);
  font-size: 13px;
}

.sanpham-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 14px 14px;
}
.sanpham-name {
  margin: 0 0 6px;
  font-weight: 600;
  line-height: 1.35;
  /* Tối đa 2 dòng, giữ chiều cao đồng đều */
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2; /* THÊM DÒNG NÀY ĐỂ FIX CẢNH BÁO */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sanpham-price {
  margin: 0 0 12px;
  color: var(--price);
  font-weight: 700;
  font-size: 17px;
}
.sanpham-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}
.sanpham-actions .btn {
  padding: 8px 10px;
}

/* ---------- Giỏ hàng ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}
.cart-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
.cart-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fafbfc;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.cart-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.cart-table tr:last-child td {
  border-bottom: 0;
}
.cart-table .center {
  text-align: center;
}
.cart-thumb {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #f7f8fa;
  border-radius: 8px;
}
.cart-name {
  font-weight: 600;
}
.cart-total {
  font-weight: 700;
  color: var(--price);
  white-space: nowrap;
}
.qty {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  text-align: center;
}
.link-delete {
  color: var(--price);
  font-weight: 500;
}
.cart-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 28px 12px !important;
}
.cart-action td {
  text-align: right;
  background: #fafbfc;
}

/* ---------- Form đặt hàng ---------- */
.order-form {
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  scroll-margin-top: 90px;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 108, 255, 0.15);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto; /* luôn nằm sát đáy khi nội dung ngắn */
  background: var(--menu-bg);
  color: #9aa2b1;
  font-size: 14px;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 20px;
}
.footer-inner strong {
  color: #fff;
  display: block;
  margin-bottom: 6px;
}
.footer-inner p {
  margin: 0;
}
.footer-copy {
  text-align: center;
  padding: 12px 16px;
  border-top: 1px solid #262b36;
  font-size: 13px;
}

/* ---------- Trang quản lý sản phẩm (admin) ---------- */
.admin-page {
  max-width: 1200px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 23, 31, 0.04);
  padding: 20px 24px 24px;
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.form-grid .field {
  margin-bottom: 0;
}
.field-full {
  grid-column: 1 / -1;
}

.admin-page .field label,
.form-sp label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-sp input[type="text"],
.form-sp input[type="number"],
.form-sp select,
.form-sp textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.form-sp textarea {
  resize: vertical;
  min-height: 84px;
}
.form-sp input:focus,
.form-sp select:focus,
.form-sp textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 108, 255, 0.15);
}

/* Ô chọn tệp */
.form-sp input[type="file"] {
  width: 100%;
  padding: 8px;
  font: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  background: #fafbfc;
  border: 1.5px dashed #c8ceda;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.form-sp input[type="file"]:hover {
  border-color: var(--accent);
}
.form-sp input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: #e8f1ff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.form-sp input[type="file"]::file-selector-button:hover {
  background: #d6e6ff;
}

.hint,
.form-sp small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

.anh-hientai {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.anh-hientai small {
  margin: 0;
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.btn-huy {
  padding: 12px 20px;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.btn-huy:hover {
  border-color: var(--ink);
  text-decoration: none;
}

/* Bảng danh sách */
.tbl {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}
.tbl th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fafbfc;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tbody tr:last-child td {
  border-bottom: 0;
}
.tbl tbody tr {
  transition: background 0.12s;
}
.tbl tbody tr:hover {
  background: #f5f8ff;
}

.thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
}
.khong-anh {
  font-size: 12px;
  color: var(--ink-soft);
}

.cot-ten {
  font-weight: 600;
  min-width: 160px;
}
.cot-gia {
  font-weight: 700;
  color: var(--price);
  white-space: nowrap;
}
.cot-mota {
  max-width: 260px;
  color: var(--ink-soft);
  font-size: 13px;
}

.thaotac {
  white-space: nowrap;
}
.thaotac form {
  margin: 0;
}
.btn-sua,
.btn-xoa {
  display: inline-block;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.btn-sua {
  color: var(--accent);
  background: #e8f1ff;
  margin-right: 6px;
}
.btn-sua:hover {
  color: #fff;
  background: var(--accent);
  text-decoration: none;
}
.btn-xoa {
  color: var(--price);
  background: #fdeaec;
}
.btn-xoa:hover {
  color: #fff;
  background: var(--price);
}

/* ---------- Trang danh mục (dùng lại .card, .tbl, .table-wrap ở trên) ---------- */
.admin-narrow {
  max-width: 820px;
}
.tbl-sm {
  min-width: 0;
}
.tbl-sm .col-stt {
  width: 80px;
}
.tbl-sm .col-id {
  width: 110px;
}
.badge-id {
  display: inline-block;
  min-width: 34px;
  padding: 3px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg);
  border-radius: 999px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 28px 24px;
  }
  .hero-art {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar-hide-sm {
    display: none;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo cart"
      "search search";
    gap: 10px 12px;
  }
  .logo {
    grid-area: logo;
  }
  .cart-link {
    grid-area: cart;
    padding: 8px 12px;
  }
  .cart-label {
    display: none;
  }
  .search {
    grid-area: search;
    max-width: none;
  }

  .menu-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }
  .menu ul {
    padding: 0 8px;
  }
  .menu-sub {
    border-top: 1px solid #262b36;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 16px;
  }
}

@media (max-width: 560px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .sanpham-body {
    padding: 10px;
  }
  .sanpham-price {
    font-size: 15px;
  }
  .sanpham-actions {
    grid-template-columns: 1fr;
  }
  .page {
    padding-top: 14px;
  }
  .hero {
    padding: 22px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.auth-card {
  max-width: 440px;
  margin: 24px auto 0;
  padding: 28px 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auth-sub {
  margin: 0 0 20px;
  color: var(--ink-soft);
}
.auth-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}
.auth-submit {
  width: 100%;
  margin-top: 4px;
}
.auth-foot {
  margin: 18px 0 0;
  text-align: center;
  color: var(--ink-soft);
}
.auth-foot a {
  font-weight: 600;
}

.auth-alert {
  margin-bottom: 16px;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.auth-err {
  color: #9b1c25;
  background: #fdeaec;
  border-color: #f6c6cb;
}
.auth-ok {
  color: #14683a;
  background: #e6f6ed;
  border-color: #b9e3c9;
}

/* Lời chào trên menu khi đã đăng nhập */
.menu-user {
  display: block;
  padding: 13px 10px;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .auth-card {
    padding: 22px 18px 20px;
    margin-top: 8px;
  }
}
.search-count {
  margin: 0 0 16px;
  color: var(--ink-soft);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.empty-state p {
  margin: 0 0 8px;
  color: var(--ink-soft);
}
.empty-state .empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.empty-state .btn {
  margin-top: 12px;
}
.sanpham-img {
  position: relative;
}
.sanpham-link {
  position: absolute;
  inset: 0;
} /* phủ lên ảnh để bấm được */
.sanpham-name a {
  color: inherit;
}
.sanpham-name a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Trang chi tiết sản phẩm ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ink-soft);
}
.breadcrumb .current {
  color: var(--ink);
  font-weight: 500;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.detail-img {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f7f8fa;
  border-radius: var(--radius);
}
.detail-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-tag {
  display: inline-block;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: #e8f1ff;
  border-radius: 999px;
}
.detail-name {
  margin: 10px 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.detail-price {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 700;
  color: var(--price);
}
.detail-perks {
  margin: 0 0 20px;
  padding: 14px 16px 14px 32px;
  font-size: 14px;
  color: var(--ink-soft);
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.detail-desc h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}
.detail-desc p {
  margin: 0;
  line-height: 1.7;
}
.detail-desc .muted {
  color: var(--ink-soft);
}

@media (max-width: 720px) {
  .detail {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 16px;
  }
  .detail-actions .btn {
    flex: 1;
  }
}

.reviews {
  margin-top: 24px;
  scroll-margin-top: 90px;
}
.reviews-title {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.reviews-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.stars {
  color: #f5a623;
  letter-spacing: 2px;
  line-height: 1;
}

.rv-summary,
.rv-form,
.rv-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Điểm trung bình */
.rv-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.rv-score {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.rv-summary .stars {
  font-size: 18px;
  margin-bottom: 4px;
}
.rv-count {
  font-size: 13px;
  color: var(--ink-soft);
}

/* Form */
.rv-form {
  padding: 20px;
}
.rv-form h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
}
.rv-form .field {
  margin-bottom: 14px;
}
.rv-form label,
.rv-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
.rv-form input[type="text"],
.rv-form textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.rv-form input[readonly] {
  background: #f4f5f7;
  color: var(--ink-soft);
}
.rv-form textarea {
  resize: vertical;
  min-height: 96px;
}
.rv-form input[type="text"]:focus,
.rv-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 108, 255, 0.15);
}
.rv-submit {
  width: 100%;
}

/* Chọn sao: radio ẩn, nhãn ★ đổi màu (thứ tự DOM 5→1, hiển thị 1→5 nhờ row-reverse) */
.star-input {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 2px;
}
.star-input input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.star-input label {
  margin: 0;
  font-size: 30px;
  line-height: 1;
  color: #d0d4dc;
  cursor: pointer;
  transition: color 0.12s;
}
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label {
  color: #f5a623;
}
.star-input input:focus-visible + label {
  outline: 3px solid rgba(10, 108, 255, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Thông báo */
.rv-alert {
  margin-bottom: 14px;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.rv-ok {
  color: #14683a;
  background: #e6f6ed;
  border-color: #b9e3c9;
}
.rv-err {
  color: #9b1c25;
  background: #fdeaec;
  border-color: #f6c6cb;
}

/* Danh sách đánh giá */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rv-card {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
}
.rv-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
  background: #e8f1ff;
  border-radius: 50%;
}
.rv-body {
  min-width: 0;
  flex: 1;
}
.rv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 4px;
}
.rv-date {
  font-size: 12px;
  color: var(--ink-soft);
}
.rv-text {
  margin: 8px 0 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .reviews-grid {
    grid-template-columns: 1fr;
  }
}
.menu a.active {
  color: #fff;
  border-bottom-color: var(--accent);
}
.cart-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
  scroll-margin-top: 90px;
}

.vc-box,
.sum-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.vc-box h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.vc-form {
  display: flex;
  gap: 8px;
}
.vc-form input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  text-transform: uppercase;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.vc-form input[type="text"]::placeholder {
  text-transform: none;
}
.vc-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 108, 255, 0.15);
}

.vc-applied {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.vc-applied strong {
  color: var(--ink);
}
.vc-applied .link-delete {
  margin-left: 8px;
  font-size: 13px;
}

.vc-alert {
  margin-bottom: 12px;
  padding: 9px 12px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.vc-ok {
  color: #14683a;
  background: #e6f6ed;
  border-color: #b9e3c9;
}
.vc-err {
  color: #9b1c25;
  background: #fdeaec;
  border-color: #f6c6cb;
}

.sum-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.sum-discount {
  color: #14683a;
}
.sum-total {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  font-weight: 700;
}
.sum-total span:last-child {
  color: var(--price);
}

@media (max-width: 720px) {
  .cart-summary {
    grid-template-columns: 1fr;
  }
}
.st-badge {
  display: inline-block;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}
.st-cho {
  color: #8a5a00;
  background: #fff3d6;
}
.st-giao {
  color: var(--accent);
  background: #e8f1ff;
}
.st-xong {
  color: #14683a;
  background: #e6f6ed;
}
.st-huy {
  color: #9b1c25;
  background: #fdeaec;
}

/* ---------- Chi tiết đơn hàng ---------- */
.order-info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 20px;
  margin-bottom: 8px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.order-info .oi-full {
  grid-column: 1 / -1;
}
.oi-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--ink-soft);
}
.oi-value {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.order-sum {
  max-width: 380px;
  margin: 16px 0 16px auto;
}

@media (max-width: 720px) {
  .order-info {
    grid-template-columns: 1fr 1fr;
  }
  .order-sum {
    max-width: none;
  }
}
.st-xacnhan {
  color: #5b3cc4;
  background: #efe9ff;
}
.st-dagiao {
  color: #0b6b6b;
  background: #def5f3;
}

/* ---------- Trang quản lý đơn hàng ---------- */
.admin-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.admin-filter label {
  font-weight: 500;
}
.admin-filter select,
.tt-form select {
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.admin-filter select:focus,
.tt-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 108, 255, 0.15);
}
.admin-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-soft);
}

.kh-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.kh-guest {
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg);
  border-radius: 999px;
}

/* Ô trạng thái: nhãn hiện tại + form đổi trạng thái */
.tt-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.tt-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tt-form select {
  padding: 6px 8px;
  font-size: 13px;
}
/* ---------- Dashboard thống kê ---------- */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.dash-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 23, 31, 0.04);
}
.dash-orders {
  border-left-color: #14a35a;
}
.dash-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.dash-value {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.dash-revenue .dash-value {
  color: var(--price);
}
.dash-orders .dash-value {
  color: #14683a;
}
.dash-sub {
  font-size: 13px;
  color: var(--ink-soft);
}
.dash-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

/* Huy hiệu thứ hạng */
.rank {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--bg);
  border-radius: 50%;
}
.rank-1 {
  color: #7a5200;
  background: #ffe39a;
}
.rank-2 {
  color: #44505f;
  background: #e1e6ec;
}
.rank-3 {
  color: #7b3f12;
  background: #f3d2b6;
}

/* Thanh tỉ lệ số lượng */
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 160px;
}
.bar-row strong {
  min-width: 28px;
}
.bar {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

@media (max-width: 720px) {
  .dash-cards {
    grid-template-columns: 1fr;
  }
}
.btn-danger {
  color: var(--price);
  background: #fdeaec;
  border-color: #f6c6cb;
}
.btn-danger:hover {
  color: #fff;
  background: var(--price);
  border-color: var(--price);
}

/* Nhóm nút cạnh nhau (xem chi tiết + hủy) */
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.row-actions form {
  margin: 0;
}

/* Tiêu đề trang + nút "Tạo mới" nằm cùng hàng */
.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

/* Ô ngày trong form voucher (đồng bộ với các ô nhập khác) */
.form-sp input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.form-sp input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 108, 255, 0.15);
}
.input-upper {
  text-transform: uppercase;
}

.vc-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}
.muted {
  color: var(--ink-soft);
}
.inline-form {
  display: inline;
  margin: 0;
}
.btn-mo {
  display: inline-block;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 7px 14px;
  color: #14683a;
  background: #e6f6ed;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.btn-mo:hover {
  color: #fff;
  background: #14a35a;
}
