/* 21101.css — Giao diện dùng chung của app 21101.
   Màu lấy từ biến theme (--c-primary, --c-secondary, --c-accent, --c-bg, --c-text);
   mỗi trang ghi đè các biến này bằng theme của hệ thống đang xem. */

:root {
  --c-primary: #b45309;
  --c-secondary: #0f172a;
  --c-accent: #f59e0b;
  --c-bg: #f8fafc;
  --c-text: #1e293b;
  --c-surface: #ffffff;
  --c-muted: #475569;
  --c-border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--c-text); background: var(--c-bg); line-height: 1.6; }
img, svg { max-width: 100%; }
a { color: var(--c-primary); }
h1, h2, h3 { color: var(--c-secondary); line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.muted { color: var(--c-muted); }
.center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: .5rem; top: -4rem; z-index: 50; background: var(--c-secondary); color: #fff; padding: .6rem 1rem; border-radius: 8px; }
.skip-link:focus { top: .5rem; }
.icon { vertical-align: middle; flex: none; }

/* ---------- Header / menu ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-border); }
.header-inner { display: flex; align-items: center; gap: 1rem; height: 4rem; }
.brand { font-weight: 800; font-size: 1.1rem; color: var(--c-secondary); text-decoration: none; }
.nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.nav a { color: var(--c-text); text-decoration: none; padding: .45rem .7rem; border-radius: 8px; font-size: .95rem; font-weight: 500; }
.nav a:hover { background: var(--c-bg); color: var(--c-primary); }
.nav .btn { color: #fff; margin-left: .35rem; }
.nav .btn:hover { color: #fff; background: var(--c-secondary); }
.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nav-burger { display: none; margin-left: auto; width: 2.75rem; height: 2.75rem; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--c-border); background: #fff; color: var(--c-secondary); cursor: pointer; }
.nav-toggle:focus-visible + .nav-burger { outline: 3px solid var(--c-accent); outline-offset: 2px; }

@media (max-width: 880px) {
  .nav-burger { display: inline-flex; }
  .nav { display: none; position: absolute; top: 4rem; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
         margin: 0; padding: .5rem 1rem 1rem; background: #fff; border-bottom: 1px solid var(--c-border); box-shadow: var(--shadow); }
  .nav a { padding: .8rem .5rem; }
  .nav .btn { margin: .5rem 0 0; text-align: center; }
  .nav-toggle:checked ~ .nav { display: flex; }
}

/* ---------- Buttons / badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .7rem 1.3rem; border-radius: 999px; border: 2px solid var(--c-primary);
       background: var(--c-primary); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.btn:hover { background: var(--c-secondary); border-color: var(--c-secondary); color: #fff; }
.btn-outline { background: transparent; color: var(--c-primary); }
.btn-outline:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-sm { padding: .45rem .95rem; font-size: .9rem; }
.btn-disabled { background: var(--c-border); border-color: var(--c-border); color: var(--c-muted); cursor: not-allowed; }
.btn-disabled:hover { background: var(--c-border); border-color: var(--c-border); color: var(--c-muted); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e2e8f0; color: #334155; }
.badge-live { background: #dcfce7; color: #14532d; }
.badge-beta { background: #dbeafe; color: #1e3a8a; }
.badge-soon { background: #e2e8f0; color: #334155; }
.badge-offer { background: #fef3c7; color: #78350f; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1rem; padding: .3rem .85rem; border-radius: 999px;
           background: #eef2f7; background: color-mix(in srgb, var(--c-primary) 12%, #fff); color: var(--c-primary); font-weight: 700; font-size: .85rem; }

/* ---------- Hero / sections ---------- */
.hero { padding: 4rem 0 3.5rem; background: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--c-primary) 10%, #fff), #fff 65%); border-bottom: 1px solid var(--c-border); }
.hero .lead { font-size: 1.15rem; color: var(--c-muted); max-width: 40rem; }
.crumbs { font-size: .9rem; color: var(--c-muted); margin-bottom: 1rem; }
.crumbs a { color: var(--c-muted); }
.section { padding: 3.5rem 0; }
.section-alt { background: #fff; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.section-title { margin-bottom: .4rem; }
.section-lead { color: var(--c-muted); max-width: 42rem; margin-bottom: 2rem; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); }

/* ---------- Card ---------- */
.card { display: flex; flex-direction: column; gap: .5rem; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow); }
.card h3 { margin: .25rem 0 0; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--c-primary); }
.card p { margin: 0; }
.card .actions { margin-top: auto; padding-top: .75rem; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.icon-box { display: inline-flex; width: 2.75rem; height: 2.75rem; align-items: center; justify-content: center; border-radius: 12px;
            background: #eef2f7; background: color-mix(in srgb, var(--c-primary) 12%, #fff); color: var(--c-primary); }
.price { font-weight: 800; color: var(--c-primary); font-size: 1.05rem; }
.meta { font-size: .85rem; color: var(--c-muted); }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); text-align: center; }
.stat strong { display: block; font-size: 2rem; color: var(--c-primary); line-height: 1.2; }

/* ---------- Nội dung văn bản (Markdown) ---------- */
.prose { max-width: 46rem; }
.prose h2 { margin-top: 1.5rem; }
.prose h3, .prose h4 { margin-top: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.prose blockquote { margin: 0 0 1rem; padding: .25rem 1rem; border-left: 4px solid var(--c-accent); color: var(--c-muted); }
.prose code { background: #e2e8f0; padding: .1rem .35rem; border-radius: 6px; font-size: .92em; }

/* ---------- FAQ / CTA ---------- */
.faq details { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: .75rem; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--c-secondary); }
.faq details p { margin: .6rem 0 0; color: var(--c-muted); }
.cta-box { text-align: center; padding: 2.5rem 1.5rem; border-radius: 20px; background: var(--c-secondary); color: #e2e8f0; }
.cta-box h2 { color: #fff; }
.cta-box p { max-width: 36rem; margin: 0 auto 1rem; }
.cta-box .actions { justify-content: center; }
.cta-box .btn { background: var(--c-accent); border-color: var(--c-accent); color: #0f172a; }
.cta-box .btn:hover { background: #fff; border-color: #fff; color: #0f172a; }
.cta-box .btn-outline { background: transparent; border-color: #fff; color: #fff; }
.cta-box .btn-outline:hover { background: #fff; color: #0f172a; }

/* ---------- Form ---------- */
.form { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); max-width: 42rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field textarea { font: inherit; padding: .65rem .8rem; border: 1px solid #94a3b8; border-radius: 10px; background: #fff; color: var(--c-text); width: 100%; }
.field textarea { min-height: 8rem; resize: vertical; }
.field .err { color: #991b1b; font-size: .88rem; }
.req { color: #991b1b; }
.alert { padding: .85rem 1.1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 500; }
.alert-ok { background: #dcfce7; color: #14532d; }
.alert-err { background: #fee2e2; color: #7f1d1d; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 3rem; padding: 2.5rem 0; background: var(--c-secondary); color: #e2e8f0; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer .brand { color: #fff; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ======================================================================
   Quản trị (21101.admin.php)
   ====================================================================== */
body.adm { background: var(--c-bg); }
.adm-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .6rem 1rem; background: var(--c-secondary); color: #e2e8f0; }
.adm-bar .brand { color: #fff; }
.adm-bar .adm-user { margin-left: auto; font-size: .9rem; }
.adm-bar .btn-outline { border-color: #fff; color: #fff; }
.adm-bar .btn-outline:hover { background: #fff; border-color: #fff; color: var(--c-secondary); }
.adm-wrap { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: calc(100vh - 3.5rem); }
.adm-side { background: #fff; border-right: 1px solid var(--c-border); padding: .75rem; }
.adm-side h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); margin: 1rem .5rem .3rem; font-weight: 700; }
.adm-side a { display: block; padding: .45rem .6rem; border-radius: 8px; color: var(--c-text); text-decoration: none; font-size: .95rem; }
.adm-side a:hover { background: var(--c-bg); }
.adm-side a[aria-current="page"] { background: var(--c-primary); color: #fff; }
.adm-main { padding: 1.5rem; min-width: 0; }
.adm-main h1 { font-size: 1.6rem; margin-bottom: 1rem; }
@media (max-width: 880px) {
  .adm-wrap { grid-template-columns: 1fr; }
  .adm-side { border-right: 0; border-bottom: 1px solid var(--c-border); display: flex; flex-wrap: wrap; gap: .25rem; }
  .adm-side h2 { width: 100%; margin-top: .5rem; }
  .adm-main { padding: 1rem; }
}
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.toolbar form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.toolbar input, .toolbar select, .field select { font: inherit; padding: .5rem .65rem; border: 1px solid #94a3b8; border-radius: 8px; background: #fff; color: var(--c-text); }
.field select { width: 100%; padding: .65rem .8rem; border-radius: 10px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .6rem .8rem; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
table.data th { background: #f1f5f9; font-weight: 700; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
form.inline { display: inline; margin: 0; }
.pager { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); margin-bottom: 1.5rem; }
.kpi { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1rem; }
.kpi strong { display: block; font-size: 1.8rem; line-height: 1.2; color: var(--c-primary); }
.kpi a { text-decoration: none; }
.alert-info { background: #dbeafe; color: #1e3a8a; }
.swatch { display: inline-block; width: 1rem; height: 1rem; border-radius: 4px; border: 1px solid #94a3b8; vertical-align: middle; }
.form-wide { max-width: 60rem; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 600; }
.ro { padding: .45rem 0; white-space: pre-wrap; word-break: break-word; }
.help { font-size: .82rem; color: var(--c-muted); }
.card-list { list-style: none; margin: 0; padding: 0; }
.card-list li { padding: .5rem 0; border-bottom: 1px solid var(--c-border); }
.card-list li:last-child { border-bottom: 0; }
pre.json { background: #0f172a; color: #e2e8f0; padding: .75rem; border-radius: 10px; overflow-x: auto; font-size: .8rem; margin: .5rem 0 0; }
.panel { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: 1.15rem; }
.btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-danger:hover { background: #7f1d1d; border-color: #7f1d1d; color: #fff; }

/* ---------- Thẻ điều hướng khu quản lý cá nhân (21101.manage.php) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.5rem; border-bottom: 1px solid var(--c-border); }
.tabs a { padding: .6rem .9rem; text-decoration: none; color: var(--c-text); border-bottom: 3px solid transparent; font-weight: 600; font-size: .95rem; }
.tabs a:hover { color: var(--c-primary); }
.tabs a[aria-current="page"] { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* ---------- Trang hướng dẫn (21101.landing1.php) ---------- */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1rem; max-width: 52rem; }
.steps li { counter-increment: step; position: relative; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
            padding: 1.1rem 1.25rem 1.1rem 4.1rem; box-shadow: var(--shadow); }
.steps li::before { content: counter(step); position: absolute; left: 1.1rem; top: 1.1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%;
                    background: var(--c-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.steps h3 { margin: 0 0 .3rem; }
.steps p { margin: 0 0 .5rem; }
.steps .actions { margin-top: .6rem; }
.note { border-left: 4px solid var(--c-accent); background: #fff; padding: .75rem 1rem; border-radius: 0 10px 10px 0; margin: 1rem 0; }
