:root {
  --brand-dark: #00483d;
  --brand-darker: #003830;
  --brand: #009981;
  --brand-soft: #e6f5f2;
  --accent-red: #e02f3f;
  --accent-red-hover: #c52231;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c242b;
  --muted: #5f6c7b;
  --border: #e3e7ec;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

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

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.9rem; }
.full-width { width: 100%; }

/* Topbar */
.topbar {
  background: var(--brand-darker);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
}
.topbar-links {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}
.topbar-links a:hover, .link-btn:hover { text-decoration: underline; }
.link-btn {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

/* Header */
.header {
  background: var(--brand-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: #fff;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.logo-text strong { font-size: 1.05rem; letter-spacing: 0.4px; }
.logo-text small { font-size: 0.74rem; color: rgba(255, 255, 255, 0.78); }

.search-box {
  flex: 1;
  max-width: 520px;
  display: flex;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  padding: 3px 4px 3px 16px;
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.94rem;
  color: var(--text);
}
.search-box button {
  border: none;
  background: var(--brand-dark);
  color: #fff;
  width: 38px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.search-box button:hover { background: var(--brand); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 8px 13px;
  cursor: pointer;
  font-size: 0.9rem;
  position: relative;
  transition: background 0.15s;
}
.header-btn:hover { background: rgba(255, 255, 255, 0.22); }
.cart-badge {
  background: var(--accent-red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
}

/* Category Navigation */
.cat-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cat-list {
  display: flex;
  gap: 8px;
  padding: 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-list::-webkit-scrollbar { display: none; }
.cat-item {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-item:hover { border-color: var(--brand); color: var(--brand-dark); }
.cat-item.active {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

/* Main */
.main-content { padding-top: 20px; padding-bottom: 48px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.hero-main {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #fff;
  border-radius: 14px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-pill {
  display: inline-block;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.hero-main h1 {
  margin: 0 0 10px;
  font-size: 1.65rem;
  line-height: 1.25;
}
.hero-main p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 540px;
  font-size: 0.95rem;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.promo-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.promo-card strong { font-size: 1rem; color: var(--brand-dark); margin-bottom: 4px; }
.promo-card p { margin: 0; font-size: 0.88rem; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--brand-dark); color: #fff; }
.btn-primary:hover { background: var(--brand); }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { background: var(--accent-red-hover); }
.btn-outline {
  background: #fff;
  color: var(--brand-dark);
  border: 1px solid var(--brand-dark);
}
.btn-outline:hover { background: var(--brand-soft); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.25); }
.btn-sm { padding: 6px 12px; font-size: 0.84rem; }

/* Catalog */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 1.3rem; color: var(--brand-dark); }
.sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.sort-wrap select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 72, 61, 0.09);
  border-color: #c8ded9;
}
.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f7faf9;
  display: grid;
  place-items: center;
  padding: 14px;
  cursor: pointer;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.badge {
  background: var(--brand-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.badge-sale {
  background: var(--accent-red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
}
.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-cat {
  font-size: 0.75rem;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 4px;
}
.card-title {
  margin: 0 0 8px;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}
.card-title:hover { color: var(--brand-dark); }
.card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tag {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.74rem;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 500;
}
.price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.price {
  color: var(--accent-red);
  font-size: 1.1rem;
  font-weight: 700;
}
.old-price {
  color: #8c96a2;
  font-size: 0.85rem;
  text-decoration: line-through;
}
.empty-state {
  text-align: center;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 40px 20px;
  color: var(--muted);
}

/* Modals & Drawer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 30, 0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.modal-lg { max-width: 820px; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: #f1f3f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}
.modal-close:hover { background: #e2e6ea; }

.prod-detail {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
  align-items: start;
}
.detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-img {
  position: relative;
  background: #f7faf9;
  border-radius: 12px;
  padding: 20px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}
.detail-img img { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-dark);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.gallery-nav:hover { background: var(--brand-dark); color: #fff; }
.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }
.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.gallery-thumb {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #f7faf9;
  padding: 3px;
  cursor: pointer;
  overflow: hidden;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.gallery-thumb.active { border-color: var(--brand-dark); }
.admin-gallery-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.admin-gallery-item {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7faf9;
  padding: 3px;
}
.admin-gallery-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.admin-gallery-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: none;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
}
.detail-info h2 { margin: 4px 0 8px; font-size: 1.35rem; }
.option-group { margin: 14px 0; }
.option-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-pill {
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.86rem;
  cursor: pointer;
}
.opt-pill.active {
  border-color: var(--brand-dark);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}
.qty-row {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.qty-row button {
  border: none;
  background: #f4f6f8;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-weight: 700;
}
.qty-row span { min-width: 36px; text-align: center; font-weight: 600; }
.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

/* Drawer */
#cartDrawer { justify-content: flex-end; padding: 0; }
.drawer {
  background: #fff;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.16);
}
.drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.drawer-head h3 { margin: 0; font-size: 1.15rem; color: var(--brand-dark); }
.drawer-body {
  padding: 16px 20px 28px;
  overflow-y: auto;
  flex: 1;
}
.cart-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #f7faf9;
  border-radius: 8px;
  padding: 4px;
}
.cart-item-title { font-weight: 600; font-size: 0.92rem; }
.cart-item-meta { font-size: 0.8rem; color: var(--muted); margin: 2px 0 6px; }
.cart-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.cart-total .price { font-size: 1.25rem; }

/* Forms */
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 0.86rem; font-weight: 600; }
.form-row input, .form-row select, .form-row textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.94rem;
  outline: none;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--brand);
}

.order-success {
  background: var(--brand-soft);
  border: 1px solid #b8e3da;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.order-code {
  display: inline-block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--brand-dark);
  background: #fff;
  padding: 6px 16px;
  border-radius: 8px;
  margin: 8px 0;
  letter-spacing: 1px;
}

.lookup-result { margin-top: 16px; }
.lookup-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fafcfb;
}
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-pending { background: #fff4db; color: #9c6500; }
.status-printing { background: #e1f3ff; color: #005c99; }
.status-shipping { background: #ede7ff; color: #5429a3; }
.status-completed { background: #e3f7eb; color: #0d7a3c; }
.status-cancelled { background: #fde7e9; color: #b71c2b; }

/* Footer */
.footer {
  background: #fff;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 32px 16px;
  font-size: 0.9rem;
}
.footer h4 { margin: 0 0 10px; color: var(--brand-dark); }
.footer p { margin: 0; color: var(--muted); }
.footer ul { list-style: none; padding: 0; margin: 0; color: var(--muted); }
.footer li { margin-bottom: 6px; }
.footer-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand-dark);
  cursor: pointer;
  text-decoration: underline;
}
.footer-bottom {
  background: var(--brand-dark);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  padding: 10px 0;
  text-align: center;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c242b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Admin Layout */
.admin-wrap { padding-top: 24px; padding-bottom: 48px; }
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.admin-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.card-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-box h3 { margin: 0 0 14px; color: var(--brand-dark); }
.form-row { min-width: 0; }
.form-row input, .form-row select, .form-row textarea { width: 100%; max-width: 100%; }
.action-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.order-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th { background: #f8faf9; color: var(--brand-dark); font-weight: 600; }
.thumb-sm {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #f7faf9;
  border-radius: 6px;
  padding: 2px;
}
.upload-preview {
  width: 100%;
  height: 140px;
  background: #f7faf9;
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 8px;
}
.upload-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.login-box {
  max-width: 380px;
  margin: 60px auto;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tab-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.aff-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.aff-stat {
  background: var(--brand-soft);
  border: 1px solid #c8e5de;
  border-radius: 10px;
  padding: 12px;
}
.aff-stat small { display: block; color: var(--muted); font-size: 0.8rem; }
.aff-stat strong { font-size: 1.15rem; color: var(--brand-dark); }
.aff-banner {
  background: #fff8e6;
  border: 1px solid #f5dfa0;
  color: #7c5800;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.86rem;
  margin: 10px 0;
}
.btn-zalo {
  background: #0068ff;
  color: #fff;
}
.btn-zalo:hover { background: #0054d1; }

.floating-contact {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fab-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.82rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s, box-shadow 0.15s;
}
.fab-circle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
.fab-zalo { background: #0068ff; }
.fab-fb { background: #1877f2; }

/* Responsive */
@media (max-width: 992px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .hero-side { flex-direction: row; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .search-box { order: 3; max-width: none; width: 100%; }
}

@media (max-width: 680px) {
  .topbar { display: none; }
  .header-btn span:not(.cart-badge) { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero-side { flex-direction: column; }
  .prod-detail { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }

  /* Admin mobile tối ưu: tab 2x2 đều nhau, form 1 cột, bảng chuyển thành thẻ cân đối */
  .admin-wrap { padding-top: 14px; padding-bottom: 36px; }
  .card-box { padding: 14px; }
  .admin-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .admin-tabs .btn {
    width: 100%;
    padding: 9px 8px;
    font-size: 0.84rem;
    text-align: center;
  }
  .order-filter-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .order-filter-bar .btn { width: 100%; padding: 7px 6px; font-size: 0.8rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .aff-stats { grid-template-columns: 1fr; }

  .data-table.mobile-cards thead { display: none; }
  .data-table.mobile-cards,
  .data-table.mobile-cards tbody { display: block; width: 100%; }
  .data-table.mobile-cards tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #fcfdfd;
  }
  .data-table.mobile-cards td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 1px dashed #e7eceb;
    word-break: break-word;
  }
  .data-table.mobile-cards td:last-child { border-bottom: none; padding-bottom: 2px; }
  .data-table.mobile-cards td::before {
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    padding-top: 2px;
  }
  .data-table.mobile-cards td.td-actions,
  .data-table.mobile-cards td.td-empty {
    display: block;
    padding-top: 10px;
  }
  .data-table.mobile-cards td.td-actions::before,
  .data-table.mobile-cards td.td-empty::before { display: none; }
  .data-table.mobile-cards .action-btns {
    display: flex;
    gap: 6px;
  }
  .data-table.mobile-cards .action-btns .btn { flex: 1; padding: 7px 6px; font-size: 0.8rem; }
}
