/* ÔnChắc — design system dùng chung cho mọi trang.
   Thương hiệu: Olive Ink #2F3A1D · Warm Lime #CFFF74 (lime chỉ đi với olive). Nền trung tính, bo góc nhỏ, bóng nhẹ.
   Biểu tượng: SVG nét mảnh (core.js → OC.icon), chỉ dùng cho thao tác; không dùng emoji trong giao diện. */
:root {
  --lime: #cfff74;
  --olive: #2f3a1d;
  --brand: #2f3a1d;          /* nút chính, điểm nhấn đậm */
  --on-brand: #cfff74;       /* chữ trên nền brand */
  --brand-600: #3f5021;      /* link, chữ nhấn trên nền sáng */
  --brand-50: #f1f5e6;       /* nền nhấn nhạt */
  --brand-100: #e2eacb;
  --accent: #cfff74;
  --on-accent: #2f3a1d;
  --momo: #a50064;
  --ink: #1b2111;
  --ink-2: #464c3b;
  --muted: #6b7161;
  --line: #e7e9e1;
  --line-strong: #d5d9cc;
  --bg: #f8f9f5;
  --surface: #ffffff;
  --surface-2: #f3f4ee;
  --ok: #15803d;
  --ok-bg: #ebf6ee;
  --bad: #c42b2b;
  --bad-bg: #fcefee;
  --warn: #9a5b00;
  --warn-bg: #fff5e2;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 26, 10, .05);
  --shadow: 0 1px 2px rgba(20, 26, 10, .04), 0 6px 20px rgba(20, 26, 10, .06);
  --shadow-lg: 0 18px 48px rgba(20, 26, 10, .16);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #cfff74; --on-brand: #1f2712; --brand-600: #d3f28f; --brand-50: #232a17; --brand-100: #2e381d;
    --ink: #edf1e4; --ink-2: #c4cab7; --muted: #8e9581; --line: #2a3120; --line-strong: #3a422e;
    --bg: #11150b; --surface: #171c10; --surface-2: #1e2416;
    --ok: #4ade80; --ok-bg: #11301c; --bad: #f87171; --bad-bg: #3a1717; --warn: #fbbf24; --warn-bg: #33270e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #cfff74; --on-brand: #1f2712; --brand-600: #d3f28f; --brand-50: #232a17; --brand-100: #2e381d;
  --ink: #edf1e4; --ink-2: #c4cab7; --muted: #8e9581; --line: #2a3120; --line-strong: #3a422e;
  --bg: #11150b; --surface: #171c10; --surface-2: #1e2416;
  --ok: #4ade80; --ok-bg: #11301c; --bad: #f87171; --bad-bg: #3a1717; --warn: #fbbf24; --warn-bg: #33270e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16px; line-height: 1.6;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
body > main { flex: 1 0 auto; }
img, svg { max-width: 100%; display: block; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.015em; font-weight: 700; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--lime) 70%, transparent); color: var(--olive); }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xsmall { font-size: .78rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.ok-t { color: var(--ok); }
.bad-t { color: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack { display: grid; gap: 16px; align-content: start; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mark { background: linear-gradient(transparent 58%, var(--lime) 58%, var(--lime) 92%, transparent 92%); padding: 0 .1em; color: inherit; }
:root[data-theme="dark"] .mark { color: var(--lime); background: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark { color: var(--lime); background: none; } }

/* ── Icon (SVG sprite, xem core.js) ── */
.i { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.i-fill { fill: currentColor; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .92rem; line-height: 1.2; cursor: pointer; text-decoration: none !important;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap; user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 86%, var(--ink)); }
.btn-accent { background: var(--lime); color: var(--olive); }
.btn-accent:hover:not(:disabled) { background: color-mix(in srgb, var(--lime) 88%, var(--olive)); }
.btn-ghost, .btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled), .btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn-danger:hover:not(:disabled) { background: var(--bad-bg); }
.btn-danger-solid { background: var(--bad); color: #fff; }
.btn-danger-solid:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 88%, #000); }
.btn-momo { background: var(--momo); color: #fff; }
.btn-momo:hover:not(:disabled) { background: color-mix(in srgb, var(--momo) 88%, #000); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: .85rem; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; white-space: normal; text-align: center; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand-600); font-weight: 600; font-size: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .35em; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none !important; flex: none; }
.logo img { width: 30px; height: 30px; }
.logo span b { font-weight: 800; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--ink-2); font-weight: 500; font-size: .93rem; padding: 6px 12px; border-radius: 8px; text-decoration: none; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .i { width: 20px; height: 20px; }
.menu-toggle { display: none; }
.user-menu { position: relative; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; }
.user-chip:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; }
.user-chip .i { width: 16px; height: 16px; color: var(--muted); }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; }
.user-dropdown-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin: -2px -2px 6px; display: grid; font-size: .9rem; line-height: 1.4; }
.user-dropdown-head span { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) {
  .site-header .container { gap: 12px; }
  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 12px 14px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; border-radius: 8px; }
  .menu-toggle { display: inline-grid; }
  .hide-sm { display: none !important; }
}

/* ── Dropdown menu (menu tài khoản, menu thao tác trong bảng) ── */
.menu { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 160; display: grid; min-width: 200px; }
.menu-item, .menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: none; background: none; color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.menu a:hover, .menu button:hover, .menu .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu .i { color: var(--muted); }
.menu .danger, .menu .danger .i { color: var(--bad); }
.menu-sep { height: 1px; background: var(--line); margin: 6px -6px; }
.menu-float { position: fixed; }

/* ── Footer ── */
.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: var(--surface); padding: 44px 0 24px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--ink-2); }
.footer-grid a:hover { color: var(--ink); }
.footer-grid .lbl { color: var(--muted); }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ── Surfaces ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 1rem; margin: 0; }
.card-body { padding: 20px; }
.section-title { font-size: 1.1rem; margin-bottom: 12px; }

.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 8px; border-radius: 6px; font-size: .75rem; font-weight: 600; line-height: 1.3; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.badge-accent { background: var(--lime); color: var(--olive); }
.badge-brand { background: var(--brand-50); color: var(--brand-600); }
.badge-green { background: var(--ok-bg); color: var(--ok); }
.badge-red { background: var(--bad-bg); color: var(--bad); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-gray { background: var(--surface-2); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

.notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: .92rem; color: var(--ink-2); }
.notice > .i { margin-top: .2em; color: var(--muted); }
.notice b { color: var(--ink); }
.notice-brand { background: var(--brand-50); border-color: var(--brand-100); }
.notice-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.notice-warn > .i { color: var(--warn); }
.notice-bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 25%, transparent); color: var(--bad); }
.notice-bad > .i { color: var(--bad); }
.notice-ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); }
.notice-ok > .i { color: var(--ok); }
.notice .grow { flex: 1; min-width: 0; }

/* ── Package monogram + cards ── */
.mono { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 10px; background: var(--c, var(--olive)); color: var(--c-ink, #fff); font-weight: 700; font-size: .78rem; letter-spacing: .04em; flex: none; }
.mono-lg { min-width: 56px; height: 56px; border-radius: 14px; font-size: .9rem; }
.mono-sm { min-width: 36px; height: 36px; border-radius: 8px; font-size: .7rem; padding: 0 7px; }

.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.pkg-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; position: relative; }
.pkg-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.pkg-card:focus-visible { outline: none; box-shadow: var(--ring); }
.pkg-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.pkg-cat { font-size: .78rem; font-weight: 600; color: var(--muted); }
.pkg-card h3 { font-size: 1.05rem; margin: 0; color: var(--ink); }
.pkg-card p { color: var(--ink-2); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pkg-meta { display: flex; gap: 6px 12px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; }
.pkg-meta span + span::before { content: "·"; margin-right: 12px; }
.pkg-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pkg-cta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .88rem; color: var(--brand-600); }
.pkg-card:hover .pkg-cta .i { transform: translateX(2px); }
.pkg-cta .i { transition: transform .15s; }
.price { font-weight: 700; font-size: 1.15rem; color: var(--ink); letter-spacing: -.01em; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: .85rem; margin-left: 6px; font-weight: 500; }

/* ── Forms ── */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .field .label { font-weight: 600; font-size: .88rem; }
.field .hint { font-size: .8rem; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
input[type="color"].input { padding: 4px; height: 42px; cursor: pointer; }
.input-sm, select.input.input-sm { min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: .88rem; border-radius: 8px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-wrap .input-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.input-wrap .input-btn:hover { background: var(--surface-2); color: var(--ink); }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px; }
.form-ok { background: var(--ok-bg); color: var(--ok); padding: 10px 14px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px; }
.checkbox { display: inline-flex; align-items: flex-start; gap: 10px; font-size: .9rem; cursor: pointer; line-height: 1.45; }
.checkbox input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--olive); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ── Segmented + chips ── */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: .86rem; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"], .seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg .n, .chip .n { font-size: .75rem; font-weight: 600; opacity: .65; margin-left: 2px; }
.seg .n:empty { display: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .85rem; cursor: pointer; white-space: nowrap; transition: border-color .15s, background-color .15s; }
.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip.active, .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip.active .n, .chip[aria-pressed="true"] .n { opacity: .8; }

/* ── Toast ── */
.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .9rem; animation: toast-in .2s ease; pointer-events: auto; }
.toast .i { margin-top: .15em; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ── Modal / dialog ── */
.modal-back { position: fixed; inset: 0; background: rgba(12, 16, 6, .45); backdrop-filter: blur(2px); z-index: 150; display: grid; place-items: center; padding: 16px; animation: fade-in .15s ease; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 24px; animation: pop-in .18s ease; }
.modal-lg { width: min(760px, 100%); }
.modal-sm { width: min(440px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h3, .modal > h3 { font-size: 1.1rem; margin: 0; }
.modal-head .icon-btn { margin: -6px -8px 0 0; }
.modal p { color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.99); } }
@media (max-width: 520px) { .modal-actions .btn { flex: 1; } }
@media (prefers-reduced-motion: reduce) { .modal-back, .modal, .toast { animation: none; } }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .78rem; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--surface); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table td .sub { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* ── Phân trang ── */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 4px; }
.pager-info { color: var(--muted); font-size: .86rem; }
.pager-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-btn { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .86rem; cursor: pointer; display: inline-grid; place-items: center; }
.pager-btn .i { width: 16px; height: 16px; }
.pager-btn:hover:not(:disabled):not(.active) { background: var(--surface-2); color: var(--ink); }
.pager-btn.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); cursor: default; }
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-gap { padding: 0 4px; color: var(--muted); }
.card .pager { padding: 12px 16px; border-top: 1px solid var(--line); }
@media (max-width: 520px) { .pager { justify-content: center; } .pager-info { width: 100%; text-align: center; } }

/* ── States ── */
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h2, .empty h3 { color: var(--ink); font-size: 1.1rem; }
.empty .btn { margin-top: 6px; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 32px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { pointer-events: none; }
.skel i { display: block; height: 12px; border-radius: 6px; background: var(--surface-2); animation: skel 1.2s ease-in-out infinite alternate; }
.skel i + i { margin-top: 10px; }
.skel i.short { width: 55%; }
.skel i.block { height: 44px; width: 44px; border-radius: 10px; margin-bottom: 8px; }
@keyframes skel { from { opacity: 1; } to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .skel i, .spinner { animation-duration: 2s; } }

.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: inherit; transition: width .3s; }

/* ── Page layout ── */
.page-head { padding: 36px 0 24px; }
.page-head h1 { font-size: clamp(1.5rem, 2.8vw, 1.9rem); margin-bottom: 6px; }
.page-head p { margin: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .i { width: 14px; height: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: none; background: none; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active, .tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.tab .count { font-size: .72rem; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); display: inline-grid; place-items: center; }

.kbd, kbd { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); font-family: inherit; font-size: .78em; text-align: center; color: var(--ink-2); }

.dl { display: grid; gap: 0; margin: 0; }
.dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); flex: none; }
.dl dd { margin: 0; text-align: right; font-weight: 500; }

/* Danh sách có dấu ✓ (vẽ bằng mask, không cần chèn icon vào từng dòng) */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.checks li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: .2em; background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
.checks.brand li::before { background: var(--brand-600); }

.prose { max-width: 760px; }
.prose h2 { font-size: 1.2rem; margin-top: 1.8em; }
.prose li { margin-bottom: .4em; }
.prose p, .prose li { color: var(--ink-2); }
