/* ==========================================================================
   Meron Farm — Map & Check — Design Tokens
   Nguồn: .claude/rules/design-system.md — không hardcode hex ngoài block này
   ========================================================================== */
:root {
  /* Brand */
  --color-brand-orange: #E4500A;
  --color-brand-orange-dark: #B33F08;
  --color-brand-green: #0B6B2E;
  --color-brand-green-dark: #084F22;
  --color-map-green: #1D6D3E;
  --color-map-green-dark: #14502E;

  /* Status */
  --color-success: #2E7D32;
  --color-warning: #F9A825;
  --color-danger: #D32F2F;
  --color-info: #1565C0;

  /* Neutral */
  --color-black: #0a0a0a;
  --color-white: #ffffff;
  --color-cream: #FFF8F0;
  --color-sand: #F5F0E8;

  /* Text */
  --color-text: #1A1A1A;
  --color-muted: #6B6B6B;
  --color-border: #E0E0E0;
  --color-bg: #FAFAF8;

  /* Type */
  --font-family: 'Be Vietnam Pro', Arial, sans-serif;
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-md: 1.125rem;
  --font-lg: 1.25rem;
  --font-xl: 1.5rem;
  --font-2xl: 2rem;
  --font-3xl: 2.75rem;
  --font-hero: 3.5rem;

  /* Spacing (8px grid) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius & shadow */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  --container-max: 1200px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  font-size: var(--font-base);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-6); }
@media (min-width: 960px) {
  .container { padding: 0 var(--space-10); }
}

.section { padding: var(--space-16) 0; }
.section--cream { background: var(--color-cream); }
.section--map { background: var(--color-map-green); color: var(--color-white); }

.eyebrow {
  display: inline-block;
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-brand-orange);
  margin-bottom: var(--space-2);
}

.section-heading { font-size: var(--font-2xl); font-weight: 700; margin-bottom: var(--space-3); }
.section-lead { font-size: var(--font-md); color: var(--color-muted); max-width: 640px; }

.text-muted { color: var(--color-muted); }
.mt-0 { margin-top: 0; }

/* ==========================================================================
   Cảnh báo mở file trực tiếp (file://) thay vì qua HTTP server
   ========================================================================== */
.file-protocol-warning {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--color-danger);
  color: #fff;
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-sm);
  text-align: center;
  line-height: 1.5;
}
.file-protocol-warning code {
  background: rgba(255,255,255,0.2);
  padding: 0 var(--space-1);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
}
.site-header__logo { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; }
.site-header__logo img { height: 40px; width: auto; }
.site-header__logo .logo-full-img { display: none; height: 44px; }
@media (min-width: 720px) {
  .site-header__logo .logo-icon-img { display: none; }
  .site-header__logo .logo-full-img { display: block; }
}

.nav { display: flex; align-items: center; gap: var(--space-2); }
.nav__link {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--color-text);
}
.nav__link:hover { background: var(--color-sand); }
.nav__link.is-active { background: var(--color-map-green); color: var(--color-white); }

.nav__dropdown { position: relative; }
.nav__dropdown-toggle {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  font-weight: 600; font-size: var(--font-sm); background: transparent; border: none; cursor: pointer;
}
.nav__dropdown-toggle:hover { background: var(--color-sand); }
.nav__dropdown-menu {
  display: none;
  position: absolute; right: 0; top: calc(100% + var(--space-2));
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); min-width: 200px; overflow: hidden;
}
.nav__dropdown.is-open .nav__dropdown-menu { display: block; }
.nav__dropdown-menu a {
  display: block; padding: var(--space-3) var(--space-4); font-size: var(--font-sm); font-weight: 500;
}
.nav__dropdown-menu a:hover { background: var(--color-sand); }

.nav__toggle { display: none; background: none; border: none; font-size: var(--font-xl); cursor: pointer; }
@media (max-width: 720px) {
  .nav__toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-white); border-bottom: 1px solid var(--color-border);
    flex-direction: column; align-items: stretch; padding: var(--space-3) var(--space-6);
  }
  .nav.is-open { display: flex; }
  .nav__dropdown-menu { position: static; box-shadow: none; border: none; display: block; padding-left: var(--space-4); }
  .nav__dropdown-toggle { width: 100%; justify-content: space-between; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--color-map-green-dark); color: rgba(255,255,255,0.85); padding: var(--space-12) 0; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-8); }
.site-footer__brand { display: flex; align-items: center; gap: var(--space-3); }
.site-footer__brand img { height: 36px; }
.site-footer__note { font-size: var(--font-sm); max-width: 420px; color: rgba(255,255,255,0.7); }
.site-footer__links { display: flex; gap: var(--space-8); flex-wrap: wrap; }
.site-footer__links h4 { font-size: var(--font-sm); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-3); color: rgba(255,255,255,0.6); }
.site-footer__links a { display: block; padding: var(--space-1) 0; font-size: var(--font-sm); color: rgba(255,255,255,0.9); }
.site-footer__links a:hover { text-decoration: underline; }
.site-footer__bottom { margin-top: var(--space-10); padding-top: var(--space-6); border-top: 1px solid rgba(255,255,255,0.15); font-size: var(--font-xs); color: rgba(255,255,255,0.55); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-md);
  font-weight: 600; font-size: var(--font-sm); border: 2px solid transparent; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--color-brand-orange); color: var(--color-white); }
.btn-primary:hover { background: var(--color-brand-orange-dark); }
.btn-map { background: var(--color-map-green); color: var(--color-white); }
.btn-map:hover { background: var(--color-map-green-dark); }
.btn-outline { border-color: var(--color-map-green); color: var(--color-map-green); background: transparent; }
.btn-outline:hover { background: var(--color-map-green); color: var(--color-white); }
.btn-outline-orange { border-color: var(--color-brand-orange); color: var(--color-brand-orange); background: transparent; }
.btn-outline-orange:hover { background: var(--color-brand-orange); color: var(--color-white); }
.btn-danger { background: var(--color-danger); color: var(--color-white); }
.btn-danger:hover { background: #a82424; }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--font-xs); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--color-brand-orange); }

/* ==========================================================================
   Badges (trạng thái NCC / QR)
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  border-radius: var(--radius-full); padding: var(--space-1) var(--space-3);
  font-size: var(--font-xs); font-weight: 700; white-space: nowrap;
}
.badge--da-duyet  { background: rgba(46,125,50,0.12); color: var(--color-success); }
.badge--cho-duyet { background: rgba(249,168,37,0.16); color: #8a6100; }
.badge--tu-choi,
.badge--tam-khoa  { background: rgba(211,47,47,0.12); color: var(--color-danger); }
.badge--info      { background: rgba(21,101,192,0.12); color: var(--color-info); }
.badge--cert      { background: var(--color-sand); color: var(--color-text); border: 1px solid var(--color-border); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card { background: var(--color-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.card-body { padding: var(--space-6); }

.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Module intro cards (index.html) */
.module-card { border-top: 6px solid var(--color-border); display: flex; flex-direction: column; height: 100%; }
.module-card--map { border-top-color: var(--color-map-green); }
.module-card--check { border-top-color: var(--color-brand-orange); }
.module-card__icon {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--color-white);
  margin-bottom: var(--space-4);
}
.module-card--map .module-card__icon { background: var(--color-map-green); }
.module-card--check .module-card__icon { background: var(--color-brand-orange); }
.module-card h3 { font-size: var(--font-xl); margin-bottom: var(--space-2); }
.module-card ul { margin: var(--space-4) 0; display: flex; flex-direction: column; gap: var(--space-2); }
.module-card li { font-size: var(--font-sm); color: var(--color-muted); padding-left: var(--space-5); position: relative; }
.module-card li::before { content: "✓"; position: absolute; left: 0; color: var(--color-success); font-weight: 700; }
.module-card .btn { margin-top: auto; align-self: flex-start; }

/* Stat strip */
.stat-strip { display: flex; flex-wrap: wrap; gap: var(--space-8); justify-content: center; text-align: center; }
.stat-strip__item .stat-strip__value { font-size: var(--font-3xl); font-weight: 700; color: var(--color-map-green); }
.stat-strip__item .stat-strip__label { font-size: var(--font-sm); color: var(--color-muted); }
.stat-strip__tag { font-size: var(--font-xs); color: var(--color-muted); text-align: center; margin-top: var(--space-4); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: var(--space-20) 0; background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-bg) 100%); }
.hero__inner { max-width: 720px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, var(--font-3xl)); font-weight: 700; line-height: 1.15; margin-bottom: var(--space-5); }
.hero p { font-size: var(--font-md); color: var(--color-muted); margin-bottom: var(--space-8); }
.hero__actions { display: flex; gap: var(--space-4); justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   Bản đồ (ban-do.html, mini-map)
   ========================================================================== */
.map-layout { display: flex; flex-direction: column; height: calc(100vh - 65px); }
@media (min-width: 880px) {
  .map-layout { flex-direction: row; }
}
.map-sidebar {
  width: 100%; background: var(--color-white); border-right: 1px solid var(--color-border);
  padding: var(--space-5); overflow-y: auto; flex-shrink: 0;
}
@media (min-width: 880px) { .map-sidebar { width: 400px; } }
.map-sidebar h2 { font-size: var(--font-lg); margin-bottom: var(--space-4); }
.map-canvas { flex: 1; min-height: 360px; }

.field { margin-bottom: var(--space-5); }
.field label { display: block; font-size: var(--font-sm); font-weight: 600; margin-bottom: var(--space-2); }
.field input[type="text"],
.field input[type="search"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%; padding: var(--space-3); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-white); color: var(--color-text);
}
.field textarea { resize: vertical; min-height: 90px; }
.checkbox-list { display: flex; flex-direction: column; gap: var(--space-2); }
.checkbox-list label { display: flex; align-items: center; gap: var(--space-2); font-weight: 400; font-size: var(--font-sm); }

.map-result-count { font-size: var(--font-sm); color: var(--color-muted); margin-bottom: var(--space-4); }

/* Sản lượng inline hiện ngay dưới mỗi bộ lọc (vùng / NCC / sản phẩm) khi có lựa chọn */
.filter-yield {
  font-size: var(--font-xs); font-weight: 600; color: var(--color-map-green);
  background: var(--color-cream); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3); margin: calc(-1 * var(--space-3)) 0 var(--space-5);
}

/* Panel chi tiết bên phải — hiện khi click marker/polygon trên Meron Map */
.map-canvas { position: relative; }
.map-detail-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 440px;
  max-width: 92vw;
  background: var(--color-white);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 1100;
  overflow-y: auto;
}
.map-detail-panel.is-open { transform: translateX(0); }
.map-detail-panel__header {
  position: sticky; top: 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-3);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}
.map-detail-panel__close {
  background: var(--color-sand); border: none; border-radius: var(--radius-full);
  width: 32px; height: 32px; font-size: var(--font-lg); line-height: 1; cursor: pointer; color: var(--color-muted);
  flex-shrink: 0;
}
.map-detail-panel__body { padding: var(--space-5); }
.map-detail-panel__img { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: var(--space-4); }
.map-detail-panel__crop { font-size: var(--font-xl); font-weight: 700; margin-bottom: var(--space-1); }
.map-detail-panel__ncc { font-size: var(--font-sm); color: var(--color-muted); margin-bottom: var(--space-3); }
.map-detail-panel__facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin: var(--space-4) 0; }
.map-detail-panel__facts dt { font-size: var(--font-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); margin-bottom: var(--space-1); }
.map-detail-panel__facts dd { margin: 0; font-weight: 700; }
.map-detail-panel__section-title { font-size: var(--font-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-muted); margin: var(--space-5) 0 var(--space-2); }
.map-detail-panel__batches { display: flex; flex-direction: column; gap: var(--space-2); }
.map-detail-panel__batch-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-3); background: var(--color-sand); border-radius: var(--radius-md); font-size: var(--font-sm);
}

@media (max-width: 720px) {
  .map-detail-panel { width: 100%; max-width: 100%; top: auto; height: 70%; transform: translateY(100%); }
  .map-detail-panel.is-open { transform: translateY(0); }
}

/* Thống kê sản lượng (theo sản phẩm / theo NCC) trong sidebar Meron Map */
.map-stats__list { margin-bottom: var(--space-4); }
.map-stats__row { margin-bottom: var(--space-3); }
.map-stats__row-label {
  display: flex; justify-content: space-between; gap: var(--space-2);
  font-size: var(--font-xs); margin-bottom: var(--space-1); color: var(--color-text);
}
.map-stats__row-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-stats__bar-track { height: 6px; background: var(--color-border); border-radius: var(--radius-full); overflow: hidden; }
.map-stats__bar-fill { height: 100%; border-radius: var(--radius-full); }

/* Nhật ký mùa vụ trong panel chi tiết */
.nhat-ky-list { list-style: none; margin: 0 0 var(--space-2); padding: 0; border-left: 2px solid var(--color-border); }
.nhat-ky-list li { position: relative; padding: 0 0 var(--space-3) var(--space-4); font-size: var(--font-sm); }
.nhat-ky-list li::before {
  content: ""; position: absolute; left: -5px; top: 4px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--color-map-green);
}
.nhat-ky-list__date { display: block; font-size: var(--font-xs); color: var(--color-muted); font-weight: 600; }

.leaflet-popup-content { font-family: var(--font-family); min-width: 200px; }

/* Marker icon theo loại sản phẩm (crop emoji) trên Meron Map */
.crop-marker-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1; border: 2px solid #fff; box-shadow: var(--shadow-sm);
}
.map-popup__img { width: 100%; height: 90px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: var(--space-2); }
.map-popup__title { font-weight: 700; margin-bottom: var(--space-1); }
.map-popup__meta { font-size: var(--font-xs); color: var(--color-muted); margin-bottom: var(--space-2); }
.map-popup__actions { margin-top: var(--space-2); }

.mini-map { height: 220px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border); }

/* ==========================================================================
   Hồ sơ NCC
   ========================================================================== */
.profile-banner { height: 260px; background-size: cover; background-position: center; border-radius: var(--radius-lg); margin-bottom: var(--space-8); }
.profile-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.profile-title { font-size: var(--font-2xl); font-weight: 700; }
.profile-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; color: var(--color-muted); font-size: var(--font-sm); margin-bottom: var(--space-6); }
.profile-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-10); }
@media (max-width: 880px) { .profile-grid { grid-template-columns: 1fr; } }
.cert-list { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }

.batch-table { width: 100%; border-collapse: collapse; margin-top: var(--space-4); }
.batch-table th, .batch-table td { text-align: left; padding: var(--space-3); border-bottom: 1px solid var(--color-border); font-size: var(--font-sm); }
.batch-table th { color: var(--color-muted); font-weight: 600; text-transform: uppercase; font-size: var(--font-xs); letter-spacing: 0.04em; }

.empty-state { text-align: center; padding: var(--space-20) var(--space-6); color: var(--color-muted); }
.empty-state h2 { color: var(--color-text); margin-bottom: var(--space-3); }

/* ==========================================================================
   Admin — bảng, tab, modal
   ========================================================================== */
.admin-banner {
  background: rgba(211,47,47,0.08); border: 1px solid rgba(211,47,47,0.25); color: var(--color-danger);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-md); font-size: var(--font-sm);
  margin-bottom: var(--space-6);
}
.admin-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.tabs { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.tab {
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-full); font-size: var(--font-sm);
  font-weight: 600; background: var(--color-sand); border: none; cursor: pointer; color: var(--color-text);
}
.tab.is-active { background: var(--color-map-green); color: var(--color-white); }

.data-table { width: 100%; border-collapse: collapse; background: var(--color-white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.data-table th, .data-table td { text-align: left; padding: var(--space-4); border-bottom: 1px solid var(--color-border); font-size: var(--font-sm); vertical-align: middle; }
.data-table th { background: var(--color-sand); font-size: var(--font-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); }
.data-table tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(10,10,10,0.5);
  align-items: center; justify-content: center; z-index: 1000; padding: var(--space-4);
}
.modal-overlay.is-open { display: flex; }
.modal { background: var(--color-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--color-border); }
.modal-header h3 { font-size: var(--font-lg); }
.modal-close { background: none; border: none; font-size: var(--font-xl); cursor: pointer; color: var(--color-muted); line-height: 1; }
.modal-body { padding: var(--space-6); }
.modal-footer { padding: var(--space-5) var(--space-6); border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: var(--space-3); }

.draw-panel { display: grid; grid-template-columns: 280px 1fr; gap: var(--space-6); align-items: start; }
@media (max-width: 780px) { .draw-panel { grid-template-columns: 1fr; } }
.draw-panel .map-canvas-inline { height: 420px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border); }

/* ==========================================================================
   Cấp QR
   ========================================================================== */
.qr-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-10); align-items: start; }
@media (max-width: 880px) { .qr-layout { grid-template-columns: 1fr; } }
.qr-preview { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); padding: var(--space-8); text-align: center; }
.qr-preview__code { padding: var(--space-4); background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.qr-preview__code img, .qr-preview__code canvas { display: block; }
.qr-preview__meta { font-size: var(--font-sm); color: var(--color-muted); }

/* ==========================================================================
   Truy xuất (Meron Check)
   ========================================================================== */
.trace-result { border-left: 4px solid var(--color-border); }
.trace-result--valid { border-left-color: var(--color-success); }
.trace-result--warn  { border-left-color: var(--color-danger); background: rgba(211,47,47,0.05); }
.trace-warning-banner {
  display: flex; gap: var(--space-3); align-items: flex-start;
  background: rgba(211,47,47,0.08); border: 1px solid rgba(211,47,47,0.3); color: var(--color-danger);
  padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); margin-bottom: var(--space-6); font-size: var(--font-sm);
}
.trace-header { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-6); }
.trace-header img { width: 72px; height: 72px; border-radius: var(--radius-md); object-fit: cover; }
.trace-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-5); margin: var(--space-6) 0; }
.trace-facts dt { font-size: var(--font-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); margin-bottom: var(--space-1); }
.trace-facts dd { margin: 0; font-weight: 600; }
.trace-shop-stub {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  background: var(--color-sand); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); margin-top: var(--space-6);
}

/* ==========================================================================
   Utility
   ========================================================================== */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.text-center { text-align: center; }
.hidden { display: none !important; }
