@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

:root {
  --brand: #C2410C; --brand-dark: #9A3412; --brand-soft: #FFF7ED; --brand-line: #FED7AA;
  --ink: #1C1917; --ink-2: #44403C; --muted: #57534E; --faint: #78716C;
  --line: #E7E5E4; --line-2: #D6D3D1; --bg: #FAFAF9; --bg-2: #F5F5F4; --white: #FFFFFF;
  --green: #15803D; --green-ink: #166534; --green-soft: #DCFCE7;
  --amber: #D97706; --amber-ink: #92400E; --amber-soft: #FEF3C7;
  --red: #B91C1C; --red-ink: #991B1B; --red-soft: #FEE2E2;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.lg { gap: 16px; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .grid3 { grid-template-columns: repeat(1, minmax(0, 1fr)); } }

/* nút */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--white); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:hover { background: var(--bg-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #166534; color: #fff; }
.btn-danger { color: var(--red-ink); border-color: #FCA5A5; }
.btn-danger:hover { background: var(--red-soft); color: var(--red-ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-lg { min-height: 54px; font-size: 16px; border-radius: 16px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; padding: 0; }

/* ô nhập */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font-weight: 400; font-size: 15px; }
.input:focus { outline: 2px solid var(--brand-line); border-color: var(--brand); }
textarea.input { resize: vertical; min-height: 70px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); flex-shrink: 0; }

/* thẻ, nhãn */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.badge.brand { background: #FFEDD5; color: var(--brand-dark); }
.badge.green { background: var(--green-soft); color: var(--green-ink); }
.badge.amber { background: var(--amber-soft); color: var(--amber-ink); }
.badge.red { background: var(--red-soft); color: var(--red-ink); }
.badge.dark { background: var(--ink); color: #fff; }
.pill { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-dark); font-size: 13px; font-weight: 600; white-space: nowrap; }
.count { display: inline-flex; min-width: 22px; height: 22px; padding: 0 7px; align-items: center; justify-content: center; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--ink); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; background: var(--green); }
.thumb { width: 84px; height: 84px; border-radius: 12px; background: #EDE0D4; color: var(--faint); font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; object-fit: cover; }

/* hộp thoại */
.overlay { position: fixed; inset: 0; background: rgba(28, 25, 23, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
@media (min-width: 720px) { .overlay { align-items: center; } }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; }
@media (min-width: 720px) { .sheet { border-radius: 20px; } }
.sheet-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; position: sticky; top: 0; background: #fff; z-index: 1; }
.sheet-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }
.sheet-foot { padding: 12px 20px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; position: sticky; bottom: 0; background: #fff; }

/* thông báo */
#toasts { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: tin .2s ease-out; }
.toast.error { background: var(--red-ink); }
.toast.ok { background: var(--green-ink); }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* lựa chọn dạng chip */
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.chip:disabled, .chip.off { opacity: .45; cursor: not-allowed; text-decoration: line-through; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.tbl-wrap { overflow-x: auto; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
