/* ShopHub — giao diện chính */
:root {
  --bg: #f5f6fb; --card: #fff; --text: #141826; --muted: #6b7280; --line: #eceef5; --soft: #f3f4fa;
  --brand: #7c3aed; --brand-2: #db2777; --brand-soft: #f3edff; --grad: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  --ok: #059669; --ok-soft: #e7f8f1; --err: #dc2626; --err-soft: #fdecec; --warn: #b45309; --warn-soft: #fff6e5; --info-soft: #eef4ff;
  --r: 14px; --r-sm: 10px; --shadow: 0 1px 2px rgba(20, 24, 38, .03), 0 6px 24px rgba(20, 24, 38, .06); --r: 16px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--text); background: var(--bg); }
body:not(.admin) { min-height: 100vh; display: flex; flex-direction: column; }
body:not(.admin) > .main { flex: 1 0 auto; width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.25; margin: 6px 0 14px; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 18px 0 10px; }
h3 { font-size: 16px; margin: 12px 0 8px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
img { max-width: 100%; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.r { text-align: right; }
.ok { color: var(--ok); }
.err { color: var(--err); }
.req { color: var(--err); }
.break { word-break: break-word; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.big { font-size: 1.25em; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; margin: 0 auto; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 14px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(124, 58, 237, .32); }
.logo-mark svg { display: block; }
.logo-text { letter-spacing: -.02em; }
.search { flex: 1; max-width: 460px; }
.search input { width: 100%; height: 40px; border-radius: 999px; background: var(--soft); border: 1px solid transparent; padding: 0 16px; }
.search input:focus { background: #fff; border-color: var(--brand); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--soft); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; }
.pill-money { background: var(--ok-soft); color: var(--ok); }
.pill:hover { text-decoration: none; filter: brightness(.97); }
.icon-btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; background: var(--soft); font-size: 17px; }
.icon-btn:hover { text-decoration: none; }
.dot { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand-2); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 40px rgba(20, 24, 38, .14); padding: 6px; z-index: 60; }
.menu-pop.wide { min-width: 300px; padding: 12px; }
.menu:not(.menu-right) .menu-pop.wide { left: 0; right: auto; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--soft); text-decoration: none; }
.menu-admin { color: var(--brand) !important; font-weight: 700; }

.navbtns { border-top: 1px solid var(--line); background: #fff; }
.navbtns-in { display: flex; gap: 6px; overflow-x: auto; padding-top: 9px; padding-bottom: 9px; scrollbar-width: none; -ms-overflow-style: none; }
.navbtns-in::-webkit-scrollbar { display: none; }
.navbtn { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 8px 15px; border-radius: 999px; background: var(--soft); color: #343a4d; font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.navbtn-ic { font-size: 15px; line-height: 1; }
.navbtn:hover { text-decoration: none; background: var(--brand-soft); color: var(--brand); }
.navbtn.active { background: var(--text); color: #fff; }
.navbtn.active:hover { color: #fff; }

.main { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }
.footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 0; font-size: 14px; }
.perf { padding-top: 10px; text-align: center; }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; color: var(--text); font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; transition: .15s; }
.btn:hover { text-decoration: none; border-color: #cfd2de; background: #fafbff; }
.btn-primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(124, 58, 237, .28); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.06); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--err); border-color: #f3c1c1; }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { color: var(--err); background: var(--err-soft); }
form.inline { display: inline; margin: 0; }

/* ---------- Cards / alerts ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card:hover { }
.card.list { padding: 6px; }
.empty { text-align: center; color: var(--muted); padding: 34px 18px; }
.alert { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 14px; border: 1px solid transparent; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: var(--ok-soft); color: #065f46; border-color: #b9ebd6; }
.alert-error { background: var(--err-soft); color: #991b1b; border-color: #f5c2c2; }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: #f6dfb0; }
.alert-info { background: var(--info-soft); color: #1e40af; border-color: #cfdcfb; }
.announce { background: var(--warn-soft); border: 1px solid #f6dfb0; color: #7c4a03; padding: 10px 16px; border-radius: var(--r-sm); margin-bottom: 14px; }
.empty-state { text-align: center; padding: 60px 16px; }
.empty-state .big { font-size: 64px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Tags / chips / avatars ---------- */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--muted); vertical-align: middle; }
.tag-shop { background: #e0f2fe; color: #0369a1; }
.tag-koc { background: #fce7f3; color: #be185d; }
.tag-kol { background: #fef3c7; color: #a16207; }
.tag-admin { background: #ede9fe; color: #6d28d9; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-bad { background: var(--err-soft); color: var(--err); }
.tag-pin { background: var(--warn-soft); color: var(--warn); margin-left: auto; }
.verified { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 10px; margin-left: 4px; vertical-align: middle; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 8px; background: var(--soft); font-size: 13px; margin: 3px 4px 3px 0; }
.meta { margin: 8px 0; }
.avatar { flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.av0 { background: linear-gradient(135deg, #7c3aed, #a855f7); } .av1 { background: linear-gradient(135deg, #db2777, #f472b6); }
.av2 { background: linear-gradient(135deg, #0891b2, #22d3ee); } .av3 { background: linear-gradient(135deg, #059669, #34d399); }
.av4 { background: linear-gradient(135deg, #ea580c, #fb923c); } .av5 { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.av6 { background: linear-gradient(135deg, #4f46e5, #818cf8); } .av7 { background: linear-gradient(135deg, #be123c, #fb7185); }
.avatars { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }

.st { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-pending { background: var(--warn-soft); color: var(--warn); }
.st-processing { background: var(--info-soft); color: #1d4ed8; }
.st-completed { background: var(--ok-soft); color: var(--ok); }
.st-rejected { background: var(--err-soft); color: var(--err); }
.pst { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--soft); vertical-align: middle; }
.pst-pending { background: var(--warn-soft); color: var(--warn); }
.pst-accepted { background: var(--ok-soft); color: var(--ok); }
.pst-declined, .pst-cancelled { background: var(--err-soft); color: var(--err); }

/* ---------- Layout ---------- */
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.col-main, .col-side { min-width: 0; }
.col-side { position: sticky; top: 130px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid2 > .full { grid-column: 1 / -1; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; margin: 0; color: var(--text); }
.stat b { font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat:hover { text-decoration: none; }
.stat-cta { align-items: center; justify-content: center; background: var(--brand-soft); border-color: #ddd0fb; }
.stat-cta b { color: var(--brand); }

/* ---------- Hero / tabs / filters ---------- */
.hero { position: relative; overflow: hidden; border-radius: 20px; margin-bottom: 16px; padding: 26px 24px;
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 45%, #db2777 100%); color: #fff;
  box-shadow: 0 10px 34px rgba(124, 58, 237, .28); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero::before { content: ""; position: absolute; right: 40px; bottom: -80px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero-text { position: relative; z-index: 1; }
.hero h1 { margin: 0 0 6px; font-size: 27px; line-height: 1.15; letter-spacing: -.02em; color: #fff; }
.hero p { margin: 0 0 18px; color: rgba(255,255,255,.9); font-size: 15px; max-width: 640px; }
.hero-cta { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 12px; border-radius: 13px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); color: #fff; font-weight: 700; font-size: 14px; text-align: center; transition: transform .12s, background .15s; }
.cta:hover { text-decoration: none; background: rgba(255,255,255,.26); transform: translateY(-2px); }
.cta-ic { font-size: 18px; line-height: 1; }
.cta-primary { background: #fff; color: #7c3aed; border-color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.cta-primary:hover { background: #fff; color: #6d28d9; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.tab { white-space: nowrap; padding: 9px 15px; border-radius: 999px; color: #4b5162; font-weight: 600; font-size: 14px; background: #fff; border: 1px solid var(--line); }
.tab span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.tab:hover { text-decoration: none; border-color: #cdbcf7; color: var(--brand); }
.tab.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(124,58,237,.28); }
.tab.active span { color: rgba(255,255,255,.8); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input, .filters select { height: 40px; width: auto; flex: 1 1 160px; }
.filters .btn { flex: none; }
.board-desc { margin-top: -4px; }

/* ---------- Posts ---------- */
.post-card, .post-full { border-left: 4px solid transparent; }
.board-general { border-left-color: #c4b5fd; }
.board-shop_find { border-left-color: #38bdf8; }
.board-koc_find { border-left-color: #f472b6; }
.board-cross { border-left-color: #34d399; }
.post-card.pinned { background: linear-gradient(0deg, #fff, #fffaf0); }
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.post-who { min-width: 0; }
.post-who .name, .comment .name { font-weight: 700; color: var(--text); }
.post-title { display: block; font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.post-h1 { font-size: 24px; }
.post-excerpt { margin: 0 0 6px; color: #3b4152; }
.post-body { margin: 12px 0; font-size: 15.5px; word-break: break-word; }
.post-foot { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.act { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 8px; background: none; border: 0; color: var(--muted); font: 600 13px var(--font); cursor: pointer; list-style: none; }
.act:hover { background: var(--soft); color: var(--text); text-decoration: none; }
.act.on { color: var(--brand-2); }
summary.act::-webkit-details-marker { display: none; }
.cross-link { display: inline-block; margin: 6px 0; padding: 8px 12px; border-radius: 10px; background: var(--ok-soft); color: #047857; font-weight: 600; font-size: 14px; word-break: break-all; }
.cross-link.big { display: block; padding: 12px 14px; font-size: 15px; }
.cross-box { border: 1px dashed #6ee7b7; background: #f6fefb; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment:last-of-type { border-bottom: 0; }
.c-body { margin-top: 2px; word-break: break-word; }
.hidden-c { opacity: .5; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.comment-form textarea { flex: 1; }
.prop-row, .member-row, .notif { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: var(--text); }
.prop-row:hover, .member-row:hover, .notif:hover { background: var(--soft); text-decoration: none; }
.notif.unread { background: var(--brand-soft); font-weight: 600; }
.todo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.side-card h3 { margin-top: 0; }
.me-row { display: flex; align-items: center; gap: 10px; }
.balance-big { font-size: 26px; font-weight: 800; margin: 12px 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.board-list { list-style: none; padding: 0; margin: 0; }
.board-list a { display: flex; gap: 10px; padding: 8px; border-radius: 10px; color: var(--text); }
.board-list a:hover { background: var(--soft); text-decoration: none; }
.board-list small { display: block; }
.profile-head { display: flex; gap: 18px; align-items: flex-start; }
.profile-head h1 { margin: 0 0 4px; }
.bio { white-space: normal; }
.links { margin-top: 6px; }
.contact-box { background: var(--ok-soft); border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
.member-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; color: var(--text); }
.member-card:hover { text-decoration: none; border-color: #cfc3f5; }

.chat .msg { display: flex; flex-direction: column; align-items: flex-start; margin: 8px 0; }
.chat .msg.mine { align-items: flex-end; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 14px; background: var(--soft); word-break: break-word; }
.msg.mine .bubble { background: var(--brand-soft); }

/* ---------- Forms ---------- */
.form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.form label small { display: block; font-weight: 400; margin-top: 4px; }
input, select, textarea { width: 100%; font: 15px/1.4 var(--font); color: var(--text); background: #fff; border: 1px solid #d8dbe6; border-radius: var(--r-sm); padding: 9px 12px; margin-top: 5px; outline: none; transition: border-color .15s, box-shadow .15s; }
.filters input, .filters select, .search input, .bulk-bar input, .bulk-bar select { margin-top: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 58, 237, .15); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 6px 0 0; accent-color: var(--brand); }
textarea { resize: vertical; }
textarea.code { font: 13px/1.5 var(--mono); background: #0f172a; color: #e2e8f0; border-color: #0f172a; tab-size: 2; }
.form .check { display: flex; align-items: center; font-weight: 500; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 6px 0 12px; }
.checks.col { flex-direction: column; gap: 4px; }
.checks .check { margin: 0; }
.check-chip { display: inline-flex !important; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500 !important; margin: 0 !important; cursor: pointer; }
.check-chip:has(input:checked) { background: var(--brand-soft); border-color: #cdb8fb; }
.lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px 4px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }
.board-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-bottom: 12px; }
.board-opt { display: flex !important; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; margin: 0 !important; }
.board-opt span { display: flex; flex-direction: column; }
.board-opt small { font-weight: 400; color: var(--muted); }
.board-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.board-opt input { margin-top: 4px; }
.err { font-size: 13px; }
.otp { font: 700 24px var(--mono); letter-spacing: .3em; text-align: center; }
.total-row { padding: 12px 14px; background: var(--soft); border-radius: 10px; margin-bottom: 12px; }
.total-row b { font-size: 18px; color: var(--brand); }
.price { font-weight: 800; color: var(--brand); }
.price.big { font-size: 22px; }
.svc-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); margin: 0; transition: .15s; }
.svc-card:hover { text-decoration: none; transform: translateY(-2px); border-color: #cfc3f5; }

/* ---------- Auth ---------- */
.auth-box { max-width: 440px; margin: 24px auto; padding: 28px; }
.auth-box h1 { margin-top: 0; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 12px; }
.secret { font: 700 18px var(--mono); letter-spacing: .08em; padding: 12px; background: var(--soft); border-radius: 10px; margin: 8px 0; text-align: center; cursor: pointer; word-break: break-all; }
.copy { cursor: pointer; border-bottom: 1px dashed currentColor; }
.copy.copied::after { content: " ✓"; color: var(--ok); }
.hl { color: var(--brand-2); font-size: 1.1em; }

/* ---------- Tables / dl ---------- */
.table-wrap { overflow-x: auto; }
.table-wrap.card { padding: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfe; }
.table tr:last-child td { border-bottom: 0; }
.table.small td { padding: 7px 10px; }
.dl { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: 14px; }
.dl dd { margin: 0; word-break: break-word; }
.result-box { background: var(--soft); border-radius: 10px; padding: 14px; word-break: break-word; }
.result-card { border-color: #d9ccfb; }
.res-list { margin: 0; padding-left: 18px; }
.res-img { max-height: 240px; border-radius: 10px; }
.res-pre { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 10px; overflow: auto; max-height: 420px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 18px 0; }
.pager a, .pager span { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; }
.pager .cur { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- Deposit ---------- */
.deposit-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: center; margin-bottom: 14px; }
.qr { width: 240px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }

/* ---------- Custom page frame ---------- */
.linkcell { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkwrap a { word-break: break-all; }
.linkcell a { display: inline; }
.gate-note { margin: 6px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--info-soft); color: #1e40af; font-size: 13.5px; }
.result-note { background: var(--ok-soft); color: #065f46; border-radius: 8px; padding: 6px 10px; font-size: 13.5px; margin: 0 0 6px; }
.page-frame { display: block; width: 100%; min-height: 420px; border: 0; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); }

/* ---------- Admin ---------- */
body.admin { background: #f3f4f9; }
.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: #111427; color: #c9cbe0; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.admin-side .logo { color: #fff; margin: 0 8px 18px; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: #c9cbe0; font-weight: 500; font-size: 14px; }
.admin-side nav a:hover { background: #1d2140; text-decoration: none; color: #fff; }
.admin-side nav a.active { background: var(--grad); color: #fff; }
.admin-side nav em { margin-left: auto; font-style: normal; background: var(--brand-2); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.admin-side-foot { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-top: 1px solid #23284a; font-size: 13px; }
.admin-side-foot a { color: #c9cbe0; }
.admin-side-foot .link-btn { color: #f9a8d4; padding: 0; text-align: left; }
.admin-main { padding: 22px 26px 60px; min-width: 0; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 12px; }
.bulk-bar input { flex: 1 1 220px; height: 34px; }
.bulk-bar select { width: auto; height: 34px; }
.row-item { display: grid; gap: 6px; align-items: center; margin-bottom: 6px; }
.row-item input, .row-item select { margin: 0; padding: 7px 9px; font-size: 13.5px; }
.grid-row7 { display: grid; grid-template-columns: 1fr 1.3fr 1fr .9fr 1.2fr 1.2fr 1.2fr 28px; gap: 6px; }
.grid-row3 { display: grid; grid-template-columns: 1.2fr 2.4fr 1fr 28px; gap: 6px; }
.row-head { margin-bottom: 4px; }
.grid-url { display: grid; grid-template-columns: 120px minmax(0, 1fr) 120px; gap: 12px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(0deg, #f3f4f9 70%, rgba(243, 244, 249, 0)); padding: 14px 0 10px; z-index: 5; }
.raw { max-height: 360px; }
details.card > summary { cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .col-side { position: static; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; }
  .grid-row7 { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
  .row-head { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .topbar-in { height: 56px; gap: 8px; }
  .search { display: none; }
  .logo-text, .hide-sm { display: none; }
  .grid2, .grid3, .board-pick, .deposit-grid, .grid-url, .grid-row3 { grid-template-columns: 1fr; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 23px; }
  .hero-cta { grid-template-columns: 1fr 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .card { padding: 14px; }
  h1 { font-size: 22px; }
  .profile-head { flex-direction: column; }
  .comment-form { flex-direction: column; align-items: stretch; }
  .admin-main { padding: 16px 12px 60px; }
  .pill-money { padding: 0 10px; font-size: 13px; }
  .linkcell { max-width: 46vw; }
  .todo-row > .btn, .todo-row > form.inline { flex: 1 1 100%; }
  .todo-row > form.inline .btn { width: 100%; }
  .prop-row { flex-wrap: wrap; }
}


/* ================= Mobile bottom nav + sheet ================= */
.tabbar { display: none; }
.sheet, .sheet-backdrop { display: none; }
@media (max-width: 760px) {
  .navbtns { display: none; }                 /* top pill row -> replaced by bottom bar */
  body:not(.admin) > .main { padding-bottom: 76px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255,255,255,.96); backdrop-filter: saturate(150%) blur(8px);
    border-top: 1px solid var(--line); padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 16px rgba(20,24,38,.06);
  }
  .tabbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 12px; list-style: none; cursor: pointer; position: relative;
  }
  .tabbar-item span { font-size: 21px; line-height: 1; }
  .tabbar-item:hover { text-decoration: none; }
  .tabbar-item.active { color: var(--brand); }
  .tabbar-item .dot { position: absolute; top: 2px; left: calc(50% + 8px); background: var(--brand-2); color: #fff; font-size: 10px; font-style: normal; padding: 0 5px; border-radius: 8px; line-height: 15px; }
  .tabbar-more { position: static; }
  .tabbar-more > summary { list-style: none; }
  .tabbar-more > summary::-webkit-details-marker { display: none; }
  .tabbar-more[open] .sheet-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,18,30,.45); z-index: 70; animation: fade .2s ease; }
  .tabbar-more[open] .sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: #fff; border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
    max-height: 82vh; overflow-y: auto; box-shadow: 0 -8px 40px rgba(20,24,38,.2); animation: slideup .22s ease;
  }
  @keyframes fade { from { opacity: 0 } to { opacity: 1 } }
  @keyframes slideup { from { transform: translateY(100%) } to { transform: translateY(0) } }
  .sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: #d7dae6; margin: 6px auto 12px; }
  .sheet-me { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--soft); color: var(--text); margin-bottom: 12px; }
  .sheet-me:hover { text-decoration: none; }
  .sheet-cta { display: flex; gap: 8px; margin-bottom: 12px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sheet-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center;
    padding: 14px 6px; border-radius: 14px; background: var(--soft); color: var(--text); font-size: 12.5px; font-weight: 600; min-height: 76px; }
  .sheet-link span { font-size: 23px; }
  .sheet-link:hover { text-decoration: none; }
  .sheet-link.active { background: var(--brand-soft); color: var(--brand); }
  .sheet-logout { margin-top: 12px; }
}
/* ================= Giao diện Công cụ & TikTok Downloader (Mobile-First) ================= */
.tool-page { max-width: 620px; margin: 0 auto; }
.tool-topbar { margin-bottom: 10px; }
.tool-main-card { padding: 18px; border-radius: 18px; }
.tool-header { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; }
.tool-icon {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 22px;
  border: 1px solid #e2d6fc;
}
.tool-title-wrap { min-width: 0; flex: 1; }
.tool-title-wrap h1 { font-size: 20px; line-height: 1.25; margin: 0 0 4px; }
.tool-title-wrap p { margin: 0; line-height: 1.45; }

.tool-field { margin-bottom: 14px; }
.tool-label-row { margin-bottom: 6px; }
.tool-label-row .lbl { margin: 0; font-size: 14px; font-weight: 700; }
.tool-quick-btns { display: flex; gap: 6px; }
.tool-mini-btn {
  background: var(--soft); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 4px 10px; font: 600 12.5px/1.2 var(--font);
  cursor: pointer; transition: .15s;
}
.tool-mini-btn:hover, .tool-mini-btn:active { background: var(--brand-soft); color: var(--brand); border-color: #d5c5fa; }

.tool-input-lg {
  height: 48px; font-size: 16px !important; padding: 0 14px;
  border-radius: 12px; border: 1.5px solid #d5d9e8; background: #fafbfe;
  margin-top: 0;
}
.tool-input-lg:focus { background: #fff; border-color: var(--brand); }
.tool-submit-btn {
  height: 48px; font-size: 15.5px; font-weight: 700;
  border-radius: 12px; margin-top: 4px;
}

/* --- Thẻ kết quả TikTok --- */
.tool-result-card { padding: 16px; border-radius: 18px; border: 1.5px solid #e0d4fc; background: #fff; }
.tt-media-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px; border-radius: 14px; background: var(--soft);
  border: 1px solid var(--line); margin-bottom: 14px;
}
.tt-thumb-box {
  flex: none; width: 88px; height: 118px; border-radius: 11px;
  overflow: hidden; background: #141826; border: 1px solid rgba(0,0,0,.08);
}
.tt-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.tt-meta-box { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tt-author-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tt-author-name { font-weight: 800; font-size: 15.5px; color: var(--text); word-break: break-word; }
.tt-author-id {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #fce7f3; color: #be185d; font-size: 12px; font-weight: 700;
}
.tt-caption {
  font-size: 13.5px; color: #3b4152; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.tt-stats-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tt-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 8px; background: #fff;
  border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--text);
}
.tt-pill-ok { background: var(--ok-soft); color: var(--ok); border-color: #b9ebd6; }

/* --- Cụm nút tải xuống --- */
.tt-dl-list { display: flex; flex-direction: column; gap: 10px; }
.tt-dl-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 50px; padding: 10px 15px; border-radius: 13px;
  font-weight: 700; font-size: 14.5px; text-decoration: none !important;
  transition: transform .12s, filter .15s;
}
.tt-dl-btn:active { transform: scale(.99); }
.tt-dl-text { display: flex; align-items: center; gap: 8px; }
.tt-dl-badge {
  flex: none; padding: 4px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  background: rgba(255,255,255,.22); color: #fff;
}
.tt-dl-mp4 {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  color: #fff; box-shadow: 0 4px 14px rgba(124, 58, 237, .24);
}
.tt-dl-hd {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  color: #fff; box-shadow: 0 4px 14px rgba(5, 150, 105, .22);
}
.tt-dl-mp3 {
  background: #f8fafc; color: var(--text);
  border: 1.5px solid #d5d9e8;
}
.tt-dl-mp3 .tt-dl-badge { background: var(--brand-soft); color: var(--brand); }
.tt-slides-section { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }

/* --- Kết quả cho các công cụ khác (Tra link FB / SĐT) --- */
.tool-res-head { margin-bottom: 12px; }
.tool-res-head h2 { margin: 0; font-size: 18px; }
.tool-kv-list { display: flex; flex-direction: column; gap: 8px; }
.tool-kv-item {
  padding: 11px 13px; border-radius: 12px; background: var(--soft);
  border: 1px solid var(--line);
}
.tool-kv-label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .02em; }
.tool-kv-val { font-size: 14.5px; font-weight: 500; color: var(--text); word-break: break-word; }

@media (max-width: 680px) {
  .tool-main-card, .tool-result-card { padding: 14px; border-radius: 16px; }
  .tool-icon { width: 40px; height: 40px; font-size: 19px; border-radius: 12px; }
  .tool-title-wrap h1 { font-size: 18px; }
  .tt-media-card { padding: 10px; gap: 11px; }
  .tt-thumb-box { width: 80px; height: 108px; }
  .tt-author-name { font-size: 14.5px; }
  .tt-dl-btn { min-height: 48px; padding: 9px 13px; font-size: 14px; }
}