:root { --bg:#faf7f2; --card:#fff; --text:#2b2622; --muted:#7a7068; --line:#e8e0d6; --accent:#d9531e; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, "Segoe UI", sans-serif; }
main { max-width: 1280px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 18px; margin: 0; }
header, .add, .filters, .links, .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
header { justify-content: space-between; margin-bottom: 16px; }
input, select, textarea, button { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--card); }
button { cursor: pointer; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.danger { color: #b3261e; }
.small { padding: 1px 8px; font-size: 12px; }
.add input { flex: 1; min-width: 220px; padding: 12px; border: 2px solid var(--accent); }
.add button { padding: 12px 20px; }
.message { min-height: 1.4em; margin: 6px 0; color: #1c7c3c; overflow-wrap: anywhere; }
.error { color: #b3261e; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat { text-align: left; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.active { border: 2px solid var(--accent); }
.filters { margin-bottom: 12px; }
.filters input { flex: 1; min-width: 200px; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); }
th, td { text-align: left; vertical-align: top; padding: 10px; border-bottom: 1px solid var(--line); }
th { font-size: 13px; color: var(--muted); }
td:first-child { width: 34%; }
.product { display: flex; gap: 10px; }
.product img, .noimg { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex: none; }
.noimg { display: grid; place-items: center; background: var(--bg); font-size: 28px; }
.muted { color: var(--muted); font-size: 13px; }
.small-text { font-size: 12px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.warn { color: #a15c00; font-size: 12px; }
a { color: var(--accent); }
.pill { padding: 4px 8px; font-size: 13px; }
.verdict-nen { background: #e1f3e5; }
.verdict-cannhac { background: #fff0cc; }
.verdict-bo { background: #fbe0de; }
.status-colink { background: #e0ecfb; }
.status-video { background: #ede3fa; }
.status-dang { background: #e1f3e5; }
.empty { text-align: center; color: var(--muted); padding: 32px; }
.login { max-width: 340px; margin: 15vh auto; padding: 24px; display: grid; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label input, label select, label textarea { width: 100%; color: var(--text); font-size: 15px; }
dialog { width: min(640px, 94vw); max-height: 90vh; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.4); }
#editForm { display: grid; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 8px; }
.pw { display: flex; gap: 6px; }
.pw input { flex: 1; min-width: 0; }
.eye { flex: none; }
.textlink { border: 0; background: none; color: var(--accent); text-decoration: underline; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions span { flex: 1; }

/* Điện thoại: mỗi sản phẩm thành một thẻ */
@media (max-width: 800px) {
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100% !important; }
  table { border: 0; background: none; }
  tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
  td { border: 0; padding: 8px 12px; }
  td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
}
