/* Cashbackzy — theo hệ thiết kế của dashboard web-hoan-tien-2:
   nền kem đào, thẻ trắng viền mỏng, một màu nhấn đỏ cam duy nhất,
   bo góc lớn, chữ Be Vietnam Pro, không gradient, không bóng đổ, không hiệu ứng. */
:root {
  --bg: #fff7f2;
  --surface: #ffffff;
  --surface-alt: #ffede4;
  --text: #2b1b16;
  --dim: #7a5c52;
  --border: #f0d7ca;
  --accent: #e8442e;
  --accent-ink: #ffffff;
  --green: #1e9e6a;
  --amber: #b97a06;
  --green-tint: rgba(30, 158, 106, 0.16);
  --amber-tint: rgba(185, 122, 6, 0.16);
  --accent-tint: rgba(232, 68, 46, 0.14);
  --accent-tint-soft: rgba(232, 68, 46, 0.07);
  --error: #8a1f1f;
  --error-bg: #fbeeee;
  --error-border: #e5b4b4;
  --note: #3f5a2e;
  --note-bg: #eef4e6;
  --note-border: #bcd3a8;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d120e;
    --surface: #2a1a14;
    --surface-alt: #382219;
    --text: #f7e8e0;
    --dim: #c4a294;
    --border: #4a2e24;
    --accent: #ff6b4a;
    --accent-ink: #241009;
    --green: #3ecf8e;
    --amber: #e8a33d;
    --green-tint: rgba(62, 207, 142, 0.16);
    --amber-tint: rgba(232, 163, 61, 0.16);
    --accent-tint: rgba(255, 107, 74, 0.14);
    --accent-tint-soft: rgba(255, 107, 74, 0.07);
    --error: #ff9a8a;
    --error-bg: rgba(255, 100, 80, 0.12);
    --error-border: rgba(255, 100, 80, 0.3);
    --note: #8fd6a8;
    --note-bg: rgba(62, 207, 142, 0.12);
    --note-border: rgba(62, 207, 142, 0.3);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
.wrap { max-width: 768px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
a { color: var(--accent); }
img { max-width: 100%; }

/* ---------- Header (sticky, nền cùng màu trang) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 12px;
  padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; text-decoration: none; color: var(--text); }
.brand-logo {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--border); background: var(--surface);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.brand-text small { color: var(--dim); font-size: 0.8rem; }
.main-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-btn {
  background: transparent; border: none; cursor: pointer; font-family: inherit;
  font-size: 0.9rem; font-weight: 700; color: var(--text);
  padding: 8px 12px; border-radius: 999px; min-height: 36px;
}
.nav-btn:hover { background: var(--surface-alt); }
.user-chip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-name { font-weight: 700; font-size: 0.95rem; }
.user-code {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; word-break: break-all;
}

/* ---------- Tiêu đề ---------- */
h1 {
  font-size: 1.875rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 12px;
}
@media (min-width: 640px) { h1 { font-size: 2.25rem; } }
h2 { font-size: 1.5rem; line-height: 1.3; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 12px; }
h3 { font-size: 1.1rem; font-weight: 800; margin: 20px 0 8px; }
.accent-text { color: var(--accent); }
.lead { color: var(--dim); font-size: 1rem; margin: 0 0 20px; }
.hero { padding-top: 16px; }
.section-gap { margin-top: 48px; }

/* ---------- Thẻ ---------- */
main { padding: 20px 0 64px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  padding: 20px; margin-bottom: 16px;
}
@media (min-width: 640px) { .card-pad { padding: 28px; } }
.card-sm { border-radius: var(--radius); padding: 16px; }
.stack > * + * { margin-top: 40px; }
.stack > * { margin-bottom: 0; }

/* ---------- Nút ---------- */
.btn {
  display: inline-block; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 800; line-height: 1.3;
  padding: 14px 20px; border-radius: var(--radius); text-align: center;
  text-decoration: none; font-family: inherit; min-height: 36px;
}
.btn-block { display: block; width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); opacity: 0.92; }
.btn-secondary { background: var(--surface-alt); color: var(--text); }
.btn-ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); padding: 12px 18px; }
.btn-approve { background: var(--green); color: #fff; }
.btn-danger { background: var(--surface-alt); color: var(--accent); }
.btn-small { padding: 8px 14px; font-size: 0.9rem; border-radius: 12px; min-height: 36px; }
.btn-pill { border-radius: 999px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.row-btns .btn { flex: 1 1 140px; }

/* ---------- Form ---------- */
label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 12px; }
input, select {
  display: block; width: 100%; margin-top: 6px;
  padding: 10px 14px; font-size: 1rem; font-family: inherit;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); min-height: 44px;
}
input:focus, select:focus { outline: 3px solid rgba(232, 68, 46, 0.35); border-color: var(--accent); }
.hint { color: var(--dim); font-size: 0.875rem; margin: 8px 0; }
.form-error {
  color: var(--error); background: var(--error-bg); border: 1px solid var(--error-border);
  border-radius: 12px; padding: 10px 12px; font-size: 0.95rem;
}
.form-note {
  color: var(--note); background: var(--note-bg); border: 1px solid var(--note-border);
  border-radius: 12px; padding: 10px 12px; font-size: 0.95rem;
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1; padding: 12px; font-size: 1rem; font-weight: 700; font-family: inherit;
  background: var(--surface-alt); color: var(--text);
  border: 2px solid var(--border); border-radius: 999px; cursor: pointer; min-height: 44px;
}
.tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- Chọn sàn ---------- */
.platforms { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.platform {
  flex: 1 1 100px; padding: 12px 8px; font-size: 1rem; font-weight: 700; font-family: inherit;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--border); border-radius: 999px; cursor: pointer; min-height: 44px;
}
.platform.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.platform-soon { opacity: 0.5; border-style: dashed; }
.soon-tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  background: var(--surface-alt); color: var(--text);
  border-radius: 999px; padding: 2px 8px; margin-left: 4px;
}

/* ---------- Kết quả tạo link ---------- */
.result { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.result h3 { margin-top: 0; }
.result-link {
  word-break: break-all; background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: 0.95rem;
}
.result-meta { margin: 12px 0; }
.result-meta div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.result-meta div:last-child { border-bottom: none; }
.result-meta dt { color: var(--dim); font-size: 0.95rem; }
.result-meta dd { margin: 0; font-weight: 800; text-align: right; }

/* ---------- Ví ---------- */
.wallet-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .wallet-grid { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.wallet-hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  padding: 20px; display: flex; flex-direction: column; justify-content: center;
}
.wallet-hero-label { font-size: 0.875rem; font-weight: 600; color: var(--dim); }
.wallet-hero-amount {
  font-size: 2.25rem; line-height: 1.1; font-weight: 800; color: var(--green);
  font-variant-numeric: tabular-nums; margin: 4px 0;
}
.wallet-hero-sub { font-size: 0.75rem; color: var(--dim); }
.wallet-minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.wallet-mini {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 8px; text-align: center;
}
.wallet-mini span { display: block; font-size: 0.8rem; color: var(--dim); line-height: 1.3; }
.wallet-mini strong {
  display: block; font-size: 1.125rem; font-weight: 800;
  font-variant-numeric: tabular-nums; margin-top: 4px; word-break: break-word;
}
.wallet-mini .num-amber { color: var(--amber); }

/* ---------- Danh sách đơn / link / rút ---------- */
.item-list { display: grid; gap: 8px; }
.item {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  background: var(--surface);
}
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.item-title { font-weight: 800; }
.item-meta { margin: 8px 0 0; font-size: 0.875rem; color: var(--dim); line-height: 1.6; }
.item-meta .money { color: var(--green); font-weight: 800; }
.item-link {
  display: block; margin-top: 8px; font-size: 0.75rem; color: var(--dim);
  text-decoration: underline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-lines { margin: 8px 0; font-size: 0.95rem; }
.item-lines div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.item-lines span:first-child { color: var(--dim); flex: 0 0 auto; }
.item-lines span:last-child { text-align: right; word-break: break-word; }
.item-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.item-actions .btn { flex: 1 1 120px; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.empty { color: var(--dim); font-size: 0.875rem; margin: 4px 0; }
.truncate { word-break: break-all; }
.bank-full { font-weight: 700; word-break: break-all; }

/* ---------- Chip trạng thái ---------- */
.status {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  border-radius: 999px; padding: 2px 10px; white-space: nowrap; flex: 0 0 auto;
}
.status-placed { background: var(--amber-tint); color: var(--amber); }
.status-approved { background: var(--green-tint); color: var(--green); }
.status-rejected { background: var(--surface-alt); color: var(--dim); }
.status-created { background: var(--surface-alt); color: var(--dim); }
.status-due { background: var(--accent-tint); color: var(--accent); }

/* ---------- Cách dùng ---------- */
.steps-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.05rem; margin-bottom: 10px;
}
.step-card h3 { margin: 0 0 6px; font-size: 1rem; }
.step-card p { margin: 0; font-size: 0.875rem; color: var(--dim); line-height: 1.55; }
.dont-list { margin: 0; padding-left: 20px; font-size: 0.95rem; line-height: 1.7; }
.dont-list li { margin-bottom: 6px; }
.dont-list li::marker { color: var(--accent); font-weight: 800; }

/* ---------- Bảng tỉ lệ ---------- */
.table-wrap { overflow-x: auto; }
.fee-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 480px; }
.fee-table th, .fee-table td { border: 1px solid var(--border); padding: 12px 16px; text-align: left; vertical-align: top; }
.fee-table thead th { background: var(--surface-alt); font-weight: 800; }
.fee-table td:first-child { font-weight: 800; }
.fee-table tr.dimmed { opacity: 0.5; }

/* ---------- FAQ ---------- */
.faq details { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; background: var(--surface); }
.faq summary { font-weight: 800; cursor: pointer; }
.faq p { margin: 8px 0 0; font-size: 0.95rem; color: var(--dim); }

/* ---------- Đối tác ---------- */
.partners-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .partners-grid { grid-template-columns: repeat(3, 1fr); } }
.partner-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.partner-card h3 { margin: 0 0 6px; }
.partner-card p { margin: 0; font-size: 0.875rem; color: var(--dim); line-height: 1.55; }
.partner-card.dimmed { opacity: 0.55; }

/* ---------- Quản trị ---------- */
.admin-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.due-card { border: 2px solid var(--accent); background: var(--accent-tint-soft); }
.due-card h2 { color: var(--accent); }
.reset-box { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; }
.reset-box label { margin-bottom: 8px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 32px; color: var(--dim); font-size: 0.875rem; margin-top: 48px; }
.site-footer p { margin: 6px 0; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1rem; }
.footer-brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.footer-links a { color: var(--dim); text-decoration: none; font-weight: 700; }
.footer-links a:hover { color: var(--accent); }
