/* Tính Số Nhanh — base, shell and shared components in the look of tinhtienso.com
   (SB Admin 2 / Bootstrap 4 structure; colours and sizes from research/ui/tts-dom.json).
   Page styles live in css/<page>.css. Class reference for page authors: UI-GUIDE.md. */

/* ================================================================== 1. tokens */
:root {
  /* shell (tts-*) */
  --tts-red: #b91e23;            /* active nav, Đăng xuất, red buttons */
  --tts-red-text: #b01f28;       /* active sidebar label */
  --tts-red-soft: #fff0f0;       /* active sidebar item */
  --tts-red-tint: #fbe5e6;       /* active Menu tile icon */
  --tts-yellow: #f8d114;
  --tts-header-bg: radial-gradient(at 68% -140%, rgba(248, 209, 20, .15), rgba(0, 0, 0, 0) 70%),
    linear-gradient(110deg, #c92329 0%, #bd2027 38%, #a51a21 72%, #921419 100%);
  --tts-ink: #23334e;            /* sidebar, breadcrumb active, titles */
  --tts-ink-2: #526078;          /* sidebar links */
  --tts-navy: #22356b;           /* page titles, region names */
  --tts-blue: #146db1;           /* Dò kết quả, Menu tile icons, support card */
  --tts-muted: #64748b;
  --tts-muted-2: #6b778a;
  --tts-icon: #8792a5;
  --tts-line: #e4e9f0;
  --tts-soft: #f4f6fa;
  /* Bootstrap / SB Admin 2 as customised by the site */
  --body: #3f4254;
  --content-bg: #f8f9fc;
  --primary: #4e73df;
  --secondary: #3f4254;
  --success: #259dba;            /* the site's "success" is teal (Phân loại, badge Đã xổ, tabs) */
  --info: #36b9cc;
  --warning: #f6c23e;
  --danger: #e74a3b;
  --light: #f8f9fc;
  --th-red: #b8030a;             /* table header */
  --th-total: #d8dce3;           /* TỔNG row */
  --td-line: #e3e6f0;
  --input-line: #d1d3e2;
  --link: #259dba;               /* message links in tables */
  --red: #ff0000;                /* numbers in red (Tiền Xác…, "thu") */
  --blue: #0000ff;               /* numbers in blue (tiền trúng, "trả") */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  /* the site's Bootstrap font stack: "Nunito" is named first but never loaded there, so the text is drawn in the
     system font (measured on the site: "06/11/2026 18:56" at 11px = 85px = Segoe UI); no web font here either */
  --font-nunito: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --header-h: 76px;              /* incl. the 3px yellow line */
  --sidebar-w: 252px;
  --bottom-h: 68px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;

  /* legacy names still used by page styles (kept until each page is restyled) */
  --brand: var(--tts-red);
  --brand-ink: var(--tts-red);
  --brand-50: var(--tts-red-soft);
  --bg: var(--content-bg);
  --surface: #fff;
  --surface-2: #f8f9fc;
  --surface-3: #eaecf4;
  --text: var(--body);
  --text-2: #5a5c69;
  --muted: #858796;
  --border: var(--td-line);
  --border-strong: var(--input-line);
  --pos: #1cc88a;
  --neg: var(--danger);
  --win-bg: #fff6d6;
  --hit-bg: #ffe066;
  --err-bg: #fdecea;
  --err-border: #f5c2bd;
  --err-ink: #a52a1f;
  --err-mark: #ffb3b3;
  --ok-bg: #e6f6fa;
  --ok-border: #b5e1ec;
  --ok-ink: #1b6f84;
  --info-bg: #eef3fd;
  --info-border: #c9d6f7;
  --info-ink: #2e4fa8;
  --warn-bg: #fff6e0;
  --warn-ink: #8a5a00;
  --radius: 8px;
  --radius-sm: 5.6px;
  --shadow: 0 .15rem 1.75rem 0 rgba(58, 59, 69, .08);
  --shadow-lg: 0 .5rem 2rem rgba(21, 33, 55, .2);
  --mono-font: var(--mono);
}
@media (max-width: 991.98px) {
  :root { --header-h: 68px; }
}

/* ================================================================== 2. base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-nunito);
  font-size: .75rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--body);
  background: var(--content-bg);
  -webkit-tap-highlight-color: transparent;
}
body.modal-open, body.tts-sheet-open { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; font-weight: 500; line-height: 1.2; }
p { margin: 0 0 1rem; }
b, strong { font-weight: 700; }
small { font-size: 80%; }
button, input, select, textarea { font-family: inherit; }
img, svg { vertical-align: middle; }
code { font-family: var(--mono); font-size: 87.5%; color: #e83e8c; word-break: break-word; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid rgba(78, 115, 223, .5); outline-offset: 1px; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; flex: none; overflow: visible; }
.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; }
.noscript { padding: 24px; text-align: center; }

/* text helpers (Bootstrap names + the site's pure red / blue numbers) */
.text-red { color: var(--red) !important; }
.text-blue { color: var(--blue) !important; }
.text-danger { color: var(--danger) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-muted { color: #858796 !important; }
.text-white-50 { color: rgba(255, 255, 255, .5) !important; }
.text-link { color: var(--link); }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-uppercase { text-transform: uppercase; }
.font-weight-bold { font-weight: 700 !important; }
.nowrap { white-space: nowrap; }

/* ================================================================== 3. shell */
/* ---------------------------------------------------------- header */
.tts-header {
  position: fixed; z-index: 1030; top: 0; left: 0; right: 0;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 24px 0 0;
  display: flex; align-items: center;
  background: var(--tts-header-bg);
  border-bottom: 3px solid var(--tts-yellow);
  box-shadow: 0 2px 10px rgba(90, 10, 16, .18);
  color: #fff; font-family: var(--font-sans);
}
.tts-brand { flex: none; width: var(--sidebar-w); height: 100%; display: flex; align-items: center; justify-content: center; }
.tts-brand img { display: block; width: 174px; height: 53px; }
.tts-menu-toggle {
  flex: none; margin-left: 20px; width: 40px; height: 40px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: .8px solid rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 16px; cursor: pointer;
}
.tts-menu-toggle:hover { background: rgba(255, 255, 255, .16); }
.tts-header-right { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.tts-header-help { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; line-height: 20px; }
.tts-header-help:hover { color: #fff; text-decoration: none; opacity: .9; }
.tts-header-help .ic { font-size: 17px; }
.tts-account { position: relative; }
.tts-account-toggle {
  display: flex; align-items: center; height: 48px; padding: 5px 12px 5px 6px;
  border-radius: 12px; border: .8px solid rgba(255, 255, 255, .2); background: rgba(97, 10, 19, .2);
  color: #fff; font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.tts-account-toggle:hover, .tts-account-toggle.is-open { background: rgba(97, 10, 19, .36); }
.tts-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff8db; color: #952029; border: 2px solid var(--tts-yellow);
  font-size: 16px; font-weight: 700; line-height: 1;
}
.tts-account-text { display: flex; flex-direction: column; margin-left: 10px; min-width: 53px; max-width: 140px; }
.tts-account-text span { font-size: 10px; line-height: 15px; color: #f8d7d8; }
.tts-account-text strong { font-size: 12px; line-height: 18px; font-weight: 700; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tts-account-chevron { margin-left: 22px; font-size: 10px; color: #f8d7d8; }

/* account dropdown (screen 19) */
.tts-account-menu {
  position: absolute; z-index: 1045; right: 0; top: calc(100% + 12px); width: 242px; padding: 8px;
  background: #fff; color: var(--tts-ink); border: .8px solid #e8eaf0; border-radius: 14px;
  box-shadow: 0 14px 34px rgba(21, 33, 55, .16), 0 2px 6px rgba(21, 33, 55, .06);
  font-family: var(--font-sans); font-size: 13px;
}
.tts-account-head { display: flex; flex-direction: column; padding: 10px 12px 4px; }
.tts-account-head span { font-size: 11px; line-height: 17px; color: #6a7587; }
.tts-account-head strong { font-size: 13px; line-height: 20px; font-weight: 700; color: var(--tts-ink); word-break: break-all; }
.tts-account-switch { margin: 22px 12px 18px; }
.tts-account-switch .custom-control-label { font-size: 13px; color: var(--tts-ink); }
.dropdown-divider { height: 0; margin: 4px 8px; overflow: hidden; border-top: .8px solid #edf0f4; }
.dropdown-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 11px 12px;
  border: 0; border-radius: 7px; background: none; color: #3b485e; font: inherit; font-size: 13px; line-height: 20px;
  text-align: left; cursor: pointer; text-decoration: none;
}
.dropdown-item:hover { background: #f5f7fa; text-decoration: none; }
.dropdown-item .ic { width: 16px; font-size: 13px; color: #8490a3; }
.dropdown-item.tts-sign-out, .dropdown-item.tts-sign-out .ic { color: var(--tts-red); }

/* ---------------------------------------------------------- sidebar */
.tts-sidebar {
  position: fixed; z-index: 1020; top: calc(var(--header-h) + var(--safe-top)); bottom: 0; left: 0;
  width: var(--sidebar-w); padding-bottom: 92px;
  display: flex; flex-direction: column;
  background: #fff; color: var(--tts-ink); font-family: var(--font-sans);
  box-shadow: 1px 0 0 #edf0f4;
  transition: transform .2s ease;
}
/* thin light scrollbar without arrows (6px, kept reserved so the items are always 217px wide as on the site) */
.tts-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 17px 12px 12px; scrollbar-gutter: stable; }
.tts-nav::-webkit-scrollbar { width: 6px; }
.tts-nav::-webkit-scrollbar-track { background: transparent; }
.tts-nav::-webkit-scrollbar-thumb { background: #dfe0e2; border-radius: 3px; }
.tts-nav::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
@supports not selector(::-webkit-scrollbar) { .tts-nav { scrollbar-width: thin; scrollbar-color: #dfe0e2 transparent; } }
.tts-nav-group + .tts-nav-group { margin-top: 23px; }
.tts-nav-group-title {
  margin: 0 0 9px; padding: 0 14px; font-size: 10px; line-height: 14px; font-weight: 700;
  color: var(--tts-muted); text-transform: uppercase; letter-spacing: .06em;
}
.tts-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tts-nav-link {
  position: relative; display: flex; align-items: center; height: 43px; padding: 9px 13px;
  border-radius: 9px; color: var(--tts-ink-2); font-size: 12px; text-decoration: none;
}
.tts-nav-link:hover { background: #f6f8fb; color: var(--tts-ink); text-decoration: none; }
.tts-nav-icon { flex: none; width: 21px; margin-right: 10px; display: inline-flex; justify-content: center; font-size: 15px; color: var(--tts-icon); }
.tts-nav-label { font-size: 13px; line-height: 20px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tts-active-dot { display: none; flex: none; margin-left: auto; width: 5px; height: 5px; border-radius: 50%; background: var(--tts-red); }
.tts-nav-link.active { background: var(--tts-red-soft); color: var(--tts-red-text); }
.tts-nav-link.active .tts-nav-label { font-weight: 650; }
.tts-nav-link.active .tts-nav-icon { color: var(--tts-red); }
.tts-nav-link.active .tts-active-dot { display: block; }
.tts-nav-link.active::before {
  content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--tts-red);
}
.tts-support {
  flex: none; margin: 18px 17px 0 16px; display: flex; align-items: center; gap: 10px; padding: 13px 11px;
  border-radius: 12px; border: .8px solid #deebf9; background: linear-gradient(115deg, #f2f8fe, #f9fbfe);
  text-decoration: none;
}
.tts-support:hover { text-decoration: none; border-color: #c9ddf3; }
.tts-support-icon {
  flex: none; width: 33px; height: 33px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--tts-blue); color: #fff; font-size: 18px;
}
.tts-support-icon .ic { margin-left: -2px; }
.tts-support-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tts-support-text strong { font-size: 12px; line-height: 18px; font-weight: 600; color: #243d63; }
.tts-support-text span { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; line-height: 15px; color: #216da8; }
.tts-support-text span .ic { font-size: 8px; }

/* ---------------------------------------------------------- content + breadcrumb */
#content-wrapper {
  min-height: 100vh; min-height: 100dvh;
  margin-left: var(--sidebar-w);
  padding-top: calc(var(--header-h) + var(--safe-top));
  background: var(--content-bg);
  display: flex; flex-direction: column;
  transition: margin-left .2s ease;
}
body.sidebar-collapsed .tts-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed #content-wrapper { margin-left: 0; }
.breadcrumb-tts {
  display: flex; flex-wrap: wrap; align-items: center; row-gap: 10px;
  min-height: 53px; margin: 0 0 18px; padding: 12px 24px; list-style: none;
  background: #fff; box-shadow: 0 .8px 0 #e9ebef;
  font-size: 12px; line-height: 18px;
}
.breadcrumb-tts .breadcrumb-item { color: #7b8698; }
.breadcrumb-tts .breadcrumb-item + .breadcrumb-item { padding-left: 8px; }
.breadcrumb-tts .breadcrumb-item + .breadcrumb-item::before { content: "›"; display: inline-block; padding-right: 8px; color: #9aa4b4; }
.breadcrumb-tts .breadcrumb-item a { color: #65748c; }
.breadcrumb-tts .breadcrumb-item a .ic { margin-right: 5px; font-size: 12px; vertical-align: -1px; color: #7b8698; }
.breadcrumb-tts .breadcrumb-item.active { color: var(--tts-ink); font-weight: 600; }
.breadcrumb-tts .huongdan-tts { margin-left: auto; color: #5d6b7e; }
.tts-expiry {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px;
  border: .8px solid #e8edf4; border-radius: 6px; background: #f8fafc;
  color: #5d6b7e; font-size: 11px; line-height: 17px; white-space: nowrap;
}
.tts-expiry .ic { font-size: 11px; color: #8491a6; }
.tts-expiry time { margin-left: -1px; }
#view { flex: 1 1 auto; outline: none; min-width: 0; }
.view { padding: 0 24px 28px; min-width: 0; }

/* ---------------------------------------------------------- phone bottom bar + logo chip */
.tts-bottombar { display: none; font-family: var(--font-sans); }
.tts-logo-chip { display: block; width: 54px; height: 54px; border-radius: 50%; box-shadow: 0 2px 8px rgba(110, 10, 16, .28); }
.tts-logo-chip img { display: block; width: 100%; height: 100%; }
.tts-bottom-tab {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 13px 0 6px; border: 0; background: none; cursor: pointer;
  color: var(--tts-muted-2); font: inherit; font-size: 11px; font-weight: 600; line-height: 13px; text-decoration: none;
}
.tts-bottom-tab:hover { text-decoration: none; color: var(--tts-ink); }
.tts-bottom-tab .ic { font-size: 22px; margin-bottom: 5px; }
.tts-bottom-tab span { white-space: nowrap; }
.tts-bottom-tab.is-active { color: var(--tts-red); }
.tts-bottom-tab.is-active::before {
  content: ""; position: absolute; top: -.8px; left: 21%; right: 21%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--tts-red);
}
.tts-bottom-tab .tab-ic-close { display: none; }
.tts-bottom-tab.is-open .tab-ic-menu { display: none; }
.tts-bottom-tab.is-open .tab-ic-close { display: inline-block; }

/* desktop: only the round logo stays, in the corner under the sidebar (as on the site) */
@media (min-width: 992px) {
  .tts-bottombar { display: block; }
  .tts-bottom-tab { display: none; }
  .tts-logo-chip { position: fixed; z-index: 1021; left: 22px; bottom: 23px; }
}

/* ---------------------------------------------------------- Menu sheet (phone, screen 21) */
.tts-menu-backdrop {
  position: fixed; z-index: 1036; inset: 0; background: rgba(21, 33, 55, .4);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); /* the page behind is blurred too (screen 21) */
}
.tts-sheet {
  position: fixed; z-index: 1038; left: 0; right: 0; bottom: calc(var(--bottom-h) + var(--safe-bottom));
  height: 72vh; height: 72dvh; max-height: calc(100% - var(--bottom-h) - var(--safe-bottom) - 40px);
  padding: 18px 16px 24px; overflow-y: auto; overscroll-behavior: contain;
  background: #f4f6f9; color: var(--tts-ink); border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 32px rgba(21, 33, 55, .2);
  font-family: var(--font-sans);
  animation: tts-sheet-in .22s ease-out;
}
@keyframes tts-sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.tts-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tts-sheet-head strong { font-size: 22px; line-height: 33px; font-weight: 750; }
.tts-sheet-close {
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: #e4e8ee; color: var(--tts-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer;
}
.tts-sheet-title { margin: 0 2px 9px; font-size: 12px; line-height: 14px; font-weight: 700; color: var(--tts-muted-2); text-transform: uppercase; letter-spacing: .04em; }
.tts-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 17px; }
.tts-shortcut {
  display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 112px; padding: 14px;
  border-radius: 12px; background: #fff; color: var(--tts-ink); text-decoration: none;
  box-shadow: 0 1px 2px rgba(21, 33, 55, .06), 0 4px 12px rgba(21, 33, 55, .04);
}
.tts-shortcut:hover { text-decoration: none; }
.tts-shortcut-icon {
  flex: none; width: 36px; height: 36px; margin-bottom: 9px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eef2f8; color: var(--tts-blue); font-size: 16px;
}
.tts-shortcut strong { font-size: 14px; line-height: 19px; font-weight: 700; }
.tts-shortcut strong + span { margin-top: 3px; font-size: 12px; line-height: 17px; color: var(--tts-muted-2); }
.tts-shortcut.active { box-shadow: inset 0 0 0 1.6px var(--tts-red), 0 1px 2px rgba(21, 33, 55, .06); }
.tts-shortcut.active .tts-shortcut-icon { background: var(--tts-red-tint); color: var(--tts-red); }
.tts-sheet-support { display: flex; align-items: center; gap: 8px; height: 36px; margin-top: -2px; font-size: 14px; font-weight: 600; color: #525f79; }
.tts-sheet-support:hover { text-decoration: none; color: var(--tts-ink); }
.tts-sheet-support .ic { font-size: 14px; color: #229ed9; }

/* ---------------------------------------------------------- phone / tablet shell */
@media (max-width: 991.98px) {
  .tts-header { padding: var(--safe-top) 12px 0 10px; }
  .tts-brand { width: auto; height: auto; }
  .tts-brand img { width: 118px; height: 36px; }
  .tts-menu-toggle { display: none; }
  .tts-header-right { gap: 8px; }
  .tts-header-help {
    width: 40px; height: 40px; justify-content: center; gap: 0; border-radius: 50%;
    border: .8px solid rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .1);
  }
  .tts-header-help span { display: none; }
  .tts-header-help .ic { font-size: 18px; }
  .tts-account-toggle { width: 40px; height: 40px; padding: 3px; border: 0; background: none; }
  .tts-account-toggle:hover, .tts-account-toggle.is-open { background: none; }
  .tts-account-text, .tts-account-chevron { display: none; }
  .tts-account-menu { top: calc(100% + 13px); }
  .tts-sidebar { display: none; }
  #content-wrapper { margin-left: 0 !important; padding-bottom: calc(var(--bottom-h) + var(--safe-bottom)); }
  .tts-bottombar {
    display: flex; position: fixed; z-index: 1040; left: 0; right: 0; bottom: 0;
    height: calc(var(--bottom-h) + var(--safe-bottom)); padding: 0 2px var(--safe-bottom) 74px;
    background: rgba(255, 255, 255, .97); border-top: .8px solid var(--tts-line);
    box-shadow: 0 -4px 16px rgba(21, 33, 55, .06);
  }
  .tts-logo-chip { position: absolute; left: 14px; top: 0; }
  .breadcrumb-tts { padding: 12px 16px; font-size: 11px; line-height: 17px; }
  .breadcrumb-tts .breadcrumb-item a .ic { font-size: 11px; }
  .tts-expiry { padding: 4px 8px; font-size: 10px; line-height: 15px; }
  .tts-expiry .ic { font-size: 10px; }
  .view { padding: 0 14px 24px; }
}
@media (max-width: 767.98px) {
  .breadcrumb-tts .huongdan-tts { flex: 0 0 100%; margin-left: 0; }
}

/* ---------------------------------------------------------- misc shell parts */
.boot { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.update-bar {
  position: fixed; z-index: 1060; left: 50%; transform: translateX(-50%); bottom: 24px;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 8px;
  background: #3f4254; color: #fff; box-shadow: var(--shadow-lg); font-size: 13px; white-space: nowrap;
}
@media (max-width: 991.98px) { .update-bar { bottom: calc(var(--bottom-h) + var(--safe-bottom) + 12px); } }

/* ================================================================== 4. shared components */
/* ---------------------------------------------------------- page cards / titles (new tts pages) */
.tts-card { background: #fff; border: .8px solid var(--tts-line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.tts-page-title { margin: 0 0 4px; font-family: var(--font-sans); font-size: 22px; line-height: 29px; font-weight: 750; color: var(--tts-navy); }
.tts-page-sub { margin: 0 0 12px; font-family: var(--font-sans); font-size: 12px; color: var(--tts-muted); }
.tts-soon { max-width: 560px; margin: 8px auto 0; text-align: center; padding: 28px 20px; font-family: var(--font-sans); color: var(--tts-ink); }
.tts-soon-icon {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: #eef2f8; color: var(--tts-blue); font-size: 26px;
}
.tts-soon-badge { display: inline-block; margin: 0 0 10px; padding: 3px 12px; border-radius: 999px; background: #fff4d1; color: #8a5a00; font-weight: 700; font-size: 12px; }
.tts-soon-text { margin: 0 0 14px; font-size: 13px; color: var(--tts-muted); }
.tts-soon-steps { display: inline-block; margin: 0; padding-left: 18px; text-align: left; font-size: 13px; line-height: 1.7; }
/* Tính năng mới (js/view-tinh-nang-moi.js): a 763px column centred in the content, title 38px under the breadcrumb,
   cards 34px right of a thin timeline with a grey dot level with each version pill (reference /release, 1265px) */
.rel-page { max-width: 763px; margin: 0 auto; padding: 38px 0 32px; font-family: var(--font-sans); color: var(--tts-ink); }
.rel-title { margin: 0 0 6px; font-size: 22px; line-height: 29px; font-weight: 750; color: var(--tts-navy); }
.rel-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; font-size: 13px; color: var(--tts-muted); }
.rel-count { padding: 2px 8px; border-radius: 6px; background: #eef2f8; color: var(--tts-navy); font-size: 12px; font-weight: 700; line-height: 18px; }
.rel-list { position: relative; margin: 0; padding: 0 0 0 34px; list-style: none; }
.rel-list::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; border-radius: 1px; background: #e4e9f0; }
.rel-item { position: relative; margin-bottom: 14px; }
.rel-item::before {
  content: ""; position: absolute; left: -31px; top: 21px; width: 12px; height: 12px; border-radius: 50%;
  background: #cbd2dc; box-shadow: 0 0 0 3px #f4f6f9;
}
.rel-card { padding: 16px; border: .8px solid var(--tts-line); border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(21, 33, 55, .04); }
.rel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 8px; }
.rel-version { padding: 2px 9px; border-radius: 6px; background: #eef2f8; color: var(--tts-navy); font-size: 12px; font-weight: 700; line-height: 20px; }
.rel-date { color: var(--tts-muted); font-size: 12px; }
.rel-points { margin: 0; padding-left: 18px; font-size: 14px; line-height: 23px; }
.rel-points li + li { margin-top: 2px; }
@media (max-width: 767.98px) {
  .rel-page { padding: 20px 2px 24px; }
  .rel-list { padding-left: 26px; }
  .rel-list::before { left: 5px; }
  .rel-item::before { left: -26px; }
  .rel-points { font-size: 13px; line-height: 21px; }
}
.tts-guide { font-family: var(--font-sans); color: var(--tts-ink); max-width: 860px; }
.tts-guide-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.tts-guide-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: .8px solid var(--tts-line); border-radius: 10px; background: #fbfcfe; }
.tts-guide-steps .tts-shortcut-icon { margin: 0; }
.tts-guide-steps a { color: var(--tts-ink); font-size: 14px; }
.tts-guide-steps p { margin: 2px 0 0; font-size: 13px; color: #4b5a72; }

/* ---------------------------------------------------------- buttons (Bootstrap 4 / SB Admin 2) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3em;
  padding: 6px 12px; border: .8px solid transparent; border-radius: 5.6px;
  background: transparent; color: var(--body);
  font-family: inherit; font-size: 12px; font-weight: 400; line-height: 1.5; text-align: center; white-space: nowrap;
  vertical-align: middle; user-select: none; cursor: pointer; text-decoration: none; position: relative;
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 .2rem rgba(78, 115, 223, .3); }
.btn:disabled, .btn.disabled { opacity: .65; cursor: not-allowed; }
.btn .ic { font-size: 12px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #2e59d9; border-color: #2653d4; color: #fff; }
.btn-secondary { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #2f3140; border-color: #2a2c39; color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #1f849c; border-color: #1d7b92; color: #fff; }
.btn-info { background: var(--info); border-color: var(--info); color: #fff; }
.btn-info:hover { background: #2c9faf; border-color: #2a96a5; color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover { background: #f4b619; border-color: #f4b30d; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #e02d1b; border-color: #d52a1a; color: #fff; }
.btn-light { background: var(--light); border-color: var(--light); color: #3a3b45; }
.btn-light:hover { background: #dde2f1; border-color: #d4daed; color: #3a3b45; }
.btn-dark { background: #5a5c69; border-color: #5a5c69; color: #fff; }
.btn-dark:hover { background: #484a54; color: #fff; }
.btn-tts { background: var(--tts-red); border-color: var(--tts-red); color: #fff; border-radius: 10px; padding: 8px 18px; font-family: var(--font-sans); font-size: 14px; font-weight: 650; box-shadow: 0 6px 14px rgba(185, 30, 35, .22); }
.btn-tts:hover { background: #a3191e; color: #fff; }
.btn-link { color: var(--primary); background: none; border: 0; }
.btn-sm { padding: 4px 8px; font-size: 12px; line-height: 1.5; border-radius: 3.2px; }
.btn-lg { padding: 8px 16px; font-size: 15px; border-radius: 4.8px; }
.btn-block { display: flex; width: 100%; }
/* "btnborder": white 0.8px border, square corners (Xem / Hôm qua / Hôm nay groups) */
.btnborder { border-color: #fff; }
.btnborder:not(.btn-icon-split) { border-radius: 0; }
.btn-group-tts { display: inline-flex; flex-wrap: wrap; align-items: stretch; }
/* "btn-icon-split": darker icon box + text (Thêm / Xoá / Phân loại) */
.btn-icon-split { padding: 0; overflow: hidden; align-items: stretch; gap: 0; }
.btn-icon-split .icon { display: inline-flex; align-items: center; padding: 6px 12px; background: rgba(0, 0, 0, .15); }
.btn-icon-split .text { display: inline-flex; align-items: center; padding: 6px 12px; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 14px; height: 14px; left: 50%; top: 50%; margin: -7px 0 0 -7px;
  border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-light.is-busy::after, .btn-link.is-busy::after, .btn-outline.is-busy::after, .btn-ghost.is-busy::after, .icon-btn.is-busy::after { border-color: var(--primary); border-right-color: transparent; }
/* table action icons (sửa / xoá / lịch sử / copy): plain dark icons like the site */
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent;
  color: var(--body); font-size: 13px; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { color: #000; background: rgba(63, 66, 84, .08); text-decoration: none; }
.icon-btn.danger { color: var(--danger); }
.icon-btn sup { position: absolute; top: -3px; right: -4px; font-size: 9px; font-weight: 700; color: var(--danger); }
.link-btn { border: 0; background: none; padding: 0; margin: 0; font: inherit; color: var(--link); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }

/* ---------------------------------------------------------- forms */
.form-group { margin-bottom: 16px; }
.form-group > label, label.form-label { display: inline-block; margin-bottom: 8px; font-weight: 500; }
.form-control, .input {
  display: block; width: 100%; height: 40px; padding: 10px;
  font-family: inherit; font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--body);
  background: #fff; background-clip: padding-box; border: .8px solid var(--input-line); border-radius: 5.6px;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  appearance: none; -webkit-appearance: none;
}
/* the site's placeholders ("Tên, SĐT", "Tìm tin nhắn", "Ngày/tháng/năm", "Từ ngày") are as dark as typed text */
.form-control::placeholder, .input::placeholder { color: var(--body); opacity: 1; }
.form-control:focus, .input:focus { color: #6e707e; border-color: #bac8f3; outline: 0; box-shadow: 0 0 0 .2rem rgba(78, 115, 223, .25); }
.form-control:disabled, .form-control[readonly], .input[readonly] { background: #eaecf4; }
textarea.form-control, textarea.input { height: auto; min-height: 80px; resize: vertical; }
select.form-control, select.input {
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%233f4254' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 8px 10px;
}
.form-control-sm { height: 31px; padding: 4px 8px; font-size: 12px; border-radius: 3.2px; }
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group > .form-control { flex: 1 1 auto; width: 1%; }
.invalid-feedback { display: block; margin-top: 4px; font-size: 80%; color: var(--danger); }
.form-control.is-invalid, .input.invalid { border-color: var(--danger); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

/* Bootstrap custom checkbox / switch (Hiện tổng…, Đài miền Trung) */
.custom-control { position: relative; display: block; min-height: 18px; padding-left: 24px; }
.custom-control-inline { display: inline-flex; margin-right: 16px; }
.custom-control-input { position: absolute; left: 0; z-index: -1; width: 16px; height: 18px; opacity: 0; margin: 0; }
.custom-control-label { position: relative; margin-bottom: 0; vertical-align: top; cursor: pointer; line-height: 18px; }
.custom-control-label::before, .custom-control-label::after {
  content: ""; position: absolute; top: 1px; left: -24px; display: block; width: 16px; height: 16px; pointer-events: none;
}
.custom-control-label::before { background: #fff; border: 1px solid #b7b9cc; border-radius: 5.6px; transition: background-color .15s, border-color .15s; }
.custom-control-label::after { background: 50% / 50% 50% no-repeat; }
.custom-control-input:checked ~ .custom-control-label::before { color: #fff; border-color: var(--primary); background-color: var(--primary); }
.custom-control-input:focus-visible ~ .custom-control-label::before { box-shadow: 0 0 0 .2rem rgba(78, 115, 223, .25); }
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3E%3C/svg%3E");
}
.custom-control-input:disabled ~ .custom-control-label { color: #858796; cursor: default; }
.custom-switch { padding-left: 36px; }
.custom-switch .custom-control-label::before { left: -36px; width: 28px; border-radius: 8px; pointer-events: all; }
.custom-switch .custom-control-label::after {
  top: 3px; left: -34px; width: 12px; height: 12px; border-radius: 8px; background-color: #b7b9cc;
  transition: transform .15s ease-in-out, background-color .15s ease-in-out;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::after { background-color: #fff; transform: translateX(12px); }
.check-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }

/* ---------------------------------------------------------- tabs (Tin nhắn: MIỀN NAM / MIỀN BẮC / …) */
.nav-tabs-tts { display: flex; margin: 0; padding: 0; list-style: none; background: #eaecf0; overflow-x: auto; scrollbar-width: none; }
.nav-tabs-tts::-webkit-scrollbar { display: none; }
.nav-tabs-tts .nav-link {
  position: relative; flex: 1 1 0; min-width: max-content; padding: 8px 16px; border: 0; background: #eaecf0;
  color: #505b72; font: inherit; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center;
  text-transform: uppercase; cursor: pointer; text-decoration: none;
}
.nav-tabs-tts .nav-link:hover { color: #2f3a52; text-decoration: none; }
.nav-tabs-tts .nav-link.active { color: #fff; background: linear-gradient(90deg, #259dba 0, #2574ab); }
.rightCircle {
  position: absolute; top: 7px; right: 5px; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f00; color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
}
.tab-content-tts { background: #fdfdfd; border-bottom: 5px solid #dddfeb; }

/* ---------------------------------------------------------- tables (red header, bordered) */
.table-responsive { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; margin-bottom: 16px; color: var(--body); border-collapse: collapse; background: #fff; }
.table th, .table td { padding: 12px; vertical-align: top; border-top: .8px solid var(--td-line); text-align: left; }
.table thead th, .table .thead-red th {
  vertical-align: bottom; background: var(--th-red); color: #fff; font-size: 12px; font-weight: 700;
  text-transform: uppercase; border-color: var(--th-red);
}
.table-bordered, .table-bordered th, .table-bordered td { border: .8px solid var(--td-line); }
.table-bordered thead th { border-color: var(--th-red); }
.table .row-total th, .table .row-total td, .table tr.total-row > * { background: var(--th-total); color: #000; font-weight: 700; border-color: var(--th-total); }
.table td.empty-row { text-align: center; color: var(--body); padding: 16px; }
/* sticky THAO TÁC column at the right edge (with the site's soft shadow) */
.table .col-actions { position: sticky; right: 0; z-index: 1; white-space: nowrap; box-shadow: -4px 0 6px -2px rgba(58, 59, 69, .15); }
.table td.col-actions { background: #f8f9fc; }
.table th.col-actions { background: var(--th-red); }
.badge {
  display: inline-block; padding: 3px 7px; border-radius: 10px; font-size: 10px; font-weight: 500; line-height: 1;
  color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline;
}
.badge.bts-2, .badge-teal { background: var(--success); }
.badge-danger { background: var(--danger); }
.badge-secondary { background: #858796; }

/* ---------------------------------------------------------- modals (Bootstrap 4) */
.modal-root { position: fixed; inset: 0; z-index: 1050; }
.modal-backdrop { position: fixed; inset: 0; background: #000; opacity: 0; transition: opacity .15s linear; }
.modal-root.show .modal-backdrop { opacity: .5; }
.modal { position: fixed; inset: 0; overflow-x: hidden; overflow-y: auto; outline: 0; -webkit-overflow-scrolling: touch; }
.modal-dialog {
  position: relative; width: auto; max-width: 700px; margin: 28px auto; pointer-events: none;
  transform: translateY(-40px); opacity: 0; transition: transform .25s ease-out, opacity .15s linear;
}
.modal-root.show .modal-dialog { transform: none; opacity: 1; }
.modal-dialog.modal-sm { max-width: 500px; }
.modal-dialog.modal-lg { max-width: 900px; }
.modal-dialog.modal-xl { max-width: 1300px; }
.modal-content {
  position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto;
  background: #fff; background-clip: padding-box; border: .8px solid rgba(0, 0, 0, .2); border-radius: 4.8px; outline: 0;
  color: var(--body); font-size: 12px;
}
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between; padding: 16px;
  border-bottom: .8px solid var(--td-line); border-radius: 3.8px 3.8px 0 0;
  box-shadow: 0 .125rem .25rem 0 rgba(58, 59, 69, .1);
}
.modal-title { margin: 0; font-size: 20px; font-weight: 400; line-height: 1.5; color: var(--body); }
.modal-header .close {
  margin: -16px -16px -16px auto; padding: 16px; border: 0; background: transparent; cursor: pointer;
  font-size: 24px; font-weight: 700; line-height: 1; color: #000; text-shadow: 0 1px 0 #fff; opacity: .5;
}
.modal-header .close:hover { opacity: .75; }
.modal-body { position: relative; flex: 1 1 auto; padding: 16px; }
.modal-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: .8px solid var(--td-line); border-radius: 0 0 3.8px 3.8px;
}
.confirm-text { font-size: 13px; }
/* Thay đổi mật khẩu (account.js): the site's 700px dialog, fields 33px in from its sides, labels 30px under the
   header, box to box 85px, 41px under the last box (tinhtienso-doi-mat-khau-desktop.png) */
@media (min-width: 576px) { .pw-modal .modal-dialog { margin-top: 30px; } }
.pw-modal .modal-body { padding: 20px 33px 24px; }
.pw-modal .form-group { margin-bottom: 17px; }
.pw-modal .form-group > label { margin-bottom: 10px; }

/* alert popup (js/limits.js alertDialog): the reference's SweetAlert look — no header, big round icon, text, buttons */
.tts-alert .modal-header { display: none; }
.tts-alert .modal-dialog { max-width: 420px; }
.tts-alert .modal-body { padding: 28px 22px 22px; text-align: center; }
.tts-alert-icon { display: inline-flex; width: 80px; height: 80px; margin-bottom: 14px; }
.tts-alert-icon svg { width: 100%; height: 100%; }
.tts-alert-warning .tts-alert-icon { color: #f8bb86; }
.tts-alert-error .tts-alert-icon { color: #f27474; }
.tts-alert-success .tts-alert-icon { color: #a5dc86; }
.tts-alert-text { margin: 0 0 20px; color: #545454; font-size: 17px; line-height: 1.45; }
.tts-alert-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tts-alert-actions .btn { min-width: 80px; height: 38px; font-size: 14px; }

/* Mua / Gia hạn tài khoản (js/billing.js): the reference's buy dialog */
.btn-buy { background: #ff9800; border-color: #ff9800; color: #fff; }
.btn-buy:hover { background: #f08c00; border-color: #f08c00; color: #fff; }
.btn-renew { background: #007bff; border-color: #007bff; color: #fff; }
.btn-renew:hover { background: #0069d9; border-color: #0062cc; color: #fff; }
.btn-login-now { background: #4caf50; border-color: #4caf50; color: #fff; }
.btn-login-now:hover { background: #43a047; border-color: #43a047; color: #fff; }
.bill-modal .modal-dialog { max-width: 500px; }
.bill-modal .modal-title { font-weight: 500; }
.bill-loading { padding: 20px 0; text-align: center; color: var(--tts-muted); }
.bill-login label { font-weight: 500; }
.bill-card { border: .8px solid #e3e6f0; border-radius: 5.6px; }
.bill-pills { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 12px 12px; list-style: none; border-bottom: .8px solid #e3e6f0; background: #f8f9fc; }
.bill-pill { padding: 7px 12px; border: 0; border-radius: 5.6px; background: none; color: var(--primary); font: inherit; font-size: 13px; cursor: pointer; }
.bill-pill.active { background: var(--primary); color: #fff; }
.bill-card-body { padding: 16px; }
.bill-lead { margin: 0 0 10px; color: #0061f2; font-size: 16px; }
.bill-way { font-weight: 700; color: #36b9cc; text-transform: uppercase; }
.bill-notset { margin: 0 0 12px; padding: 10px 12px; border-radius: 5.6px; background: #fff4e5; color: #8a5a00; font-size: 13px; }
.bill-ways { display: grid; gap: 12px; margin-bottom: 16px; }
.bill-way-card {
  position: relative; padding: 12px 56px 12px 14px; border: .8px solid #e3e6f0; border-radius: 5.6px; background: #fff;
  box-shadow: 0 .15rem 1.75rem 0 rgba(58, 59, 69, .15); cursor: pointer;
}
.bill-way-card.is-on { border-bottom: 4px solid #f6c23e; }
.bill-way-card.is-off { cursor: not-allowed; opacity: .55; box-shadow: none; }
.bill-way-name { margin-bottom: 4px; color: #e74a3b; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.bill-way-price { color: #5a5c69; font-size: 20px; font-weight: 700; }
.bill-way-ic { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: #dddfeb; font-size: 30px; }
.bill-features { margin: 0; padding: 0; list-style: none; color: #6c757d; font-size: 15px; }
.bill-features li::before { content: "— "; }
.bill-notes { margin: 8px 0 14px; }
.bill-notes p { margin: 0 0 4px; color: red; font-weight: 700; }
.bill-notes footer { color: #0061f2; font-size: 13px; line-height: 1.5; }
.bill-notes footer::before { content: "— "; }
.bill-table td { vertical-align: middle; overflow-wrap: anywhere; }
.bill-table td:first-child { width: 40%; }
.bill-copy { margin-left: 12px; padding: 2px 7px; border: 1px solid #f6c23e; background: #fff; color: #f6c23e; }
.bill-copy:hover { background: #f6c23e; color: #fff; }
.bill-qr, .bill-qr-img { display: block; width: 150px; }
.bill-qr svg { display: block; width: 150px; height: 150px; }
.bill-timer { color: red; font-size: 20px; font-weight: 700; }
.bill-done-lead { margin: 0 0 10px; font-size: 18px; }
.bill-done-lead p { margin: 0; }

/* breadcrumb: Hạn sử dụng of an expired account */
.tts-expiry.is-expired, .tts-expiry.is-expired .title { color: var(--danger); font-weight: 700; }

/* admin pages (js/view-giao-dich.js, js/view-cai-dat-thanh-toan.js) */
.adm-page { margin: 16px 10px; font-family: var(--font-sans); }
.adm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 14px; }
.adm-presets { display: flex; flex-wrap: wrap; gap: 4px; }
.adm-presets .is-selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.adm-range { display: flex; align-items: center; gap: 6px; }
.adm-range .form-control { width: 150px; height: 36px; }
.adm-clean { margin-left: auto; }
.btn-outline-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }
.adm-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.adm-head h2, .adm-h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--tts-navy); }
.adm-head p { margin: 2px 0 0; color: var(--tts-muted); }
.adm-summary { display: flex; flex-wrap: wrap; gap: 12px; }
.adm-table td, .adm-table th { vertical-align: middle; }
.adm-table .nw { white-space: nowrap; }
.adm-badge { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 10px; background: #e8f0fe; color: #1a56c4; font-size: 11px; }
.adm-badge.is-buy { background: #fff0e0; color: #b35c00; }
.adm-status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.adm-status.is-waiting { background: #fff4d1; color: #8a5a00; }
.adm-status.is-paid { background: #e3f6ea; color: #1b7f3b; }
.adm-status.is-expired { background: #f1f2f5; color: #6b778a; }
.adm-state { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-empty { padding: 18px 0; color: var(--tts-muted); }
.adm-h2 { margin: 18px 0 10px; }
.adm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.adm-prices { max-width: 640px; }
.adm-prices .form-control { height: 34px; }
/* Thành viên (js/view-thanh-vien.js): form on one line on a computer; the table turns into cards on a phone */
.mem-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0 12px; align-items: end; }
.mem-fields .form-group { margin-bottom: 6px; }
.mem-submit { height: 40px; margin-bottom: 6px; white-space: nowrap; }
.mem-form { margin-bottom: 8px; }
.mem-actions .btn { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
@media (max-width: 767.98px) {
  .adm-grid { grid-template-columns: 1fr; }
  .adm-clean { margin-left: 0; }
  .adm-page { margin: 10px 0; padding: 14px 12px; }
  .mem-fields { grid-template-columns: 1fr; }
  .mem-submit { width: 100%; justify-content: center; }
  .mem-table thead { display: none; }
  .mem-table, .mem-table tbody, .mem-table tr, .mem-table td { display: block; width: 100%; }
  .mem-table tr { margin-bottom: 10px; border: .8px solid var(--td-line); border-radius: 8px; overflow: hidden; }
  .mem-table td { display: flex; justify-content: space-between; gap: 10px; border: 0; border-bottom: .8px solid var(--td-line); text-align: right; }
  .mem-table td:last-child { border-bottom: 0; }
  .mem-table td.mem-actions:empty { display: none; }
  .mem-table td.mem-actions { justify-content: flex-end; background: #f8f9fc; }
  .mem-table td::before { content: attr(data-label); color: var(--tts-muted); font-weight: 600; text-align: left; }
}
@media (max-width: 575.98px) {
  .modal-dialog, .modal-dialog.modal-sm, .modal-dialog.modal-lg, .modal-dialog.modal-xl { max-width: none; margin: 8px; }
}
@media (min-width: 576px) and (max-width: 1340px) {
  .modal-dialog.modal-xl, .modal-dialog.modal-lg { max-width: calc(100vw - 32px); }
}

/* ---------------------------------------------------------- toasts (top right, white card + tick / X) */
#toasts {
  position: fixed; z-index: 2000; top: 10px; right: 10px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  width: 345px; max-width: calc(100vw - 20px); pointer-events: none;
}
/* measured on screens 11 / 12: one line 70px tall, two lines 84px (line pitch ~18px: 16px Arial-like text), text
   starting 78px from the card's left edge, "Tin nhắn không hợp lệ, vui lòng / kiểm tra lại!" */
.tts-toast {
  display: flex; align-items: center; gap: 0; width: 100%; min-height: 70px; padding: 16px;
  background: #fff; color: #545454; border-radius: 5px;
  box-shadow: 0 0 .625em #d9d9d9, 0 .3em 1.2em rgba(0, 0, 0, .08);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; line-height: normal; word-wrap: break-word;
  opacity: 0; transform: translateX(14px); transition: opacity .2s, transform .2s;
  pointer-events: auto; cursor: pointer;
}
.tts-toast.show { opacity: 1; transform: none; }
.tts-toast-icon { flex: none; width: 38px; height: 38px; margin-right: 8px; }
.tts-toast-icon svg { display: block; width: 38px; height: 38px; }
.tts-toast-text { flex: 1 1 auto; min-width: 0; margin: 8px 16px; }

/* ---------------------------------------------------------- loading / empty / error */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 20px; height: 20px; flex: none; border: 3px solid #dddfeb; border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px 16px; color: var(--body); text-align: center; }
.state.small { padding: 14px 10px; }
.state-loading { flex-direction: row; color: #858796; }
.state-empty { padding: 16px; }
.state-error { color: var(--danger); }
.state-ic { font-size: 28px; opacity: .7; }
.is-stale { opacity: .55; transition: opacity .15s; }

/* ---------------------------------------------------------- select2 "classic" picker (ui.comboBox: Người chơi) */
.select2-container { position: relative; display: inline-block; box-sizing: border-box; margin: 0; vertical-align: middle; }
.select2.select2-container { display: block; width: 100%; }
.select2-container .select2-selection--single {
  position: relative; display: block; box-sizing: border-box; height: 28px; cursor: pointer; user-select: none; -webkit-user-select: none;
  background-color: #f7f7f7; background-image: linear-gradient(to bottom, #fff 50%, #eee 100%); background-repeat: repeat-x;
  border: 1px solid #aaa; border-radius: 4px; outline: 0;
}
.select2-container .select2-selection--single:focus { border-color: #5897fb; }
.select2-container .select2-selection--single .select2-selection__rendered {
  display: block; padding: 0 20px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #444; line-height: 28px;
}
.select2-container .select2-selection--single .select2-selection__arrow {
  position: absolute; top: 0; right: 0; width: 20px; height: 26px;
  background-color: #ddd; background-image: linear-gradient(to bottom, #eee 50%, #ccc 100%);
  border-left: 1px solid #aaa; border-radius: 0 4px 4px 0;
}
.select2-container .select2-selection--single .select2-selection__arrow b {
  position: absolute; top: 50%; left: 50%; width: 0; height: 0; margin: -2px 0 0 -4px;
  border-style: solid; border-width: 5px 4px 0; border-color: #888 transparent transparent;
}
.select2-container--open .select2-selection--single { border-color: #5897fb; }
.select2-container--open .select2-selection--single .select2-selection__arrow { background: transparent; border: 0; }
.select2-container--open .select2-selection--single .select2-selection__arrow b { border-width: 0 4px 5px; border-color: transparent transparent #888; }
.select2-container--open.select2-container--below .select2-selection--single {
  border-bottom: 0; border-radius: 4px 4px 0 0; background-image: linear-gradient(to bottom, #fff 0%, #eee 50%);
}
.select2-container--open.select2-container--above .select2-selection--single {
  border-top: 0; border-radius: 0 0 4px 4px; background-image: linear-gradient(to bottom, #eee 50%, #fff 100%);
}
/* the dropdown, appended to <body> above the dialogs */
.select2-drop-host { position: absolute; z-index: 1060; display: block; }
.select2-dropdown {
  display: block; box-sizing: border-box; background: #fff; border: 1px solid #5897fb; border-radius: 4px; color: var(--body); font-size: 12px;
}
.select2-dropdown--below { border-top: 0; border-radius: 0 0 4px 4px; }
.select2-dropdown--above { border-bottom: 0; border-radius: 4px 4px 0 0; }
.select2-search--dropdown { display: block; padding: 4px; }
.select2-search--dropdown .select2-search__field {
  display: block; box-sizing: border-box; width: 100%; padding: 4px; border: 1px solid #aaa; border-radius: 0; outline: 0;
  font-family: inherit; color: inherit; background: #fff; -webkit-appearance: none; appearance: none;
}
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button { -webkit-appearance: none; }
.select2-results { display: block; }
.select2-results__options { max-height: 200px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.select2-results__option { padding: 6px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.select2-results__option--highlighted[aria-selected] { background-color: #3875d7; color: #fff; }
.select2-results__message { cursor: default; }

/* ---------------------------------------------------------- datepicker (js/datepicker.js, jQuery UI "base" look) */
.ui-datepicker {
  position: absolute; z-index: 1070; width: 17em; padding: .2em .2em 0; box-sizing: content-box;
  font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; text-align: left;
  border: 1px solid #c5c5c5; border-radius: 3px; background: #fff; color: #333;
}
.ui-datepicker .ui-datepicker-header {
  position: relative; padding: .2em 0; border: 1px solid #ddd; border-radius: 3px; background: #e9e9e9; color: #333; font-weight: bold;
}
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next {
  position: absolute; top: 2px; width: 1.8em; height: 1.8em; border: 1px solid transparent; border-radius: 3px; cursor: pointer;
}
.ui-datepicker .ui-datepicker-prev { left: 2px; }
.ui-datepicker .ui-datepicker-next { right: 2px; }
.ui-datepicker .ui-datepicker-prev:hover, .ui-datepicker .ui-datepicker-next:hover { top: 1px; border-color: #ccc; background: #ededed; }
.ui-datepicker .ui-datepicker-prev:hover { left: 1px; }
.ui-datepicker .ui-datepicker-next:hover { right: 1px; }
.ui-datepicker .ui-icon {
  display: block; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  overflow: hidden; text-indent: -99999px; background: no-repeat center / 16px 16px;
}
.ui-datepicker .ui-icon-circle-triangle-w { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='%23444'/%3E%3Cpath fill='%23fff' d='M5 8l4-3v6z'/%3E%3C/svg%3E"); }
.ui-datepicker .ui-icon-circle-triangle-e { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='%23444'/%3E%3Cpath fill='%23fff' d='M11 8L7 5v6z'/%3E%3C/svg%3E"); }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker table { width: 100%; margin: 0 0 .4em; font-size: .9em; border-collapse: collapse; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { padding: 1px; border: 0; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker td a.ui-state-default { border: 1px solid #c5c5c5; background: #f6f6f6; color: #454545; font-weight: normal; }
.ui-datepicker td a.ui-state-default:hover { border-color: #ccc; background: #ededed; color: #2b2b2b; text-decoration: none; }
.ui-datepicker td a.ui-state-active { border-color: #003eff; background: #007fff; color: #fff; }
.ui-datepicker td a.ui-state-highlight { border-color: #dad55e; background: #fffa90; color: #777620; }
.ui-datepicker td.ui-state-disabled { opacity: .35; }

/* ================================================================== 5. login (tinhtienso style) */
.auth-screen {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  background: radial-gradient(circle at 80% -10%, rgba(248, 209, 20, .18), rgba(0, 0, 0, 0) 45%),
    linear-gradient(150deg, #c92329 0%, #b91e23 45%, #8c1218 100%);
  font-family: var(--font-sans);
}
.auth-card { width: min(400px, 100%); background: #fff; color: var(--tts-ink); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(60, 0, 0, .35); }
.auth-card.center { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; text-align: center; }
.auth-card.center h2 { font-size: 18px; font-weight: 700; margin: 0; }
.auth-top {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px 20px 18px;
  background: var(--tts-header-bg); border-bottom: 3px solid var(--tts-yellow);
}
.auth-logo { display: block; width: 232px; height: 70px; }
/* tagline under the logo (brand.js TAGLINE, sentence case: never text-transform it) */
.auth-tagline {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; margin: 0; padding: 5px 14px;
  border: .8px solid rgba(248, 209, 20, .45); border-radius: 999px; background: rgba(97, 10, 19, .28);
  color: #fff; font-size: 13px; font-weight: 600; line-height: 18px; text-align: center;
}
.auth-tagline .ic { color: var(--tts-yellow); font-size: 12px; }
.auth-form { padding: 20px 22px 18px; }
.auth-form .form-group { margin-bottom: 14px; }
.auth-form label { font-size: 12px; font-weight: 600; color: #4b5a72; margin-bottom: 6px; }
.auth-input { position: relative; }
.auth-input > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8792a5; font-size: 13px; pointer-events: none; }
.auth-input .form-control { height: 42px; padding-left: 34px; font-size: 14px; border-color: var(--tts-line); border-radius: 8px; }
.auth-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: #8792a5; cursor: pointer; font-size: 15px; }
.auth-form .form-control { font-size: 14px; }
.auth-msg { min-height: 18px; margin: 0 0 8px; color: var(--danger); font-size: 12px; font-weight: 600; }
.btn-auth { height: 44px; background: var(--tts-red); border-color: var(--tts-red); color: #fff; border-radius: 8px; font-size: 15px; font-weight: 700; }
.btn-auth:hover { background: #a3191e; color: #fff; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: #8792a5; font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: .8px solid var(--tts-line); }
.auth-alt { display: grid; gap: 8px; }
.btn-auth-alt { height: 38px; border: .8px solid #f0c8ca; background: #fff7f7; color: var(--tts-red); border-radius: 8px; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.btn-auth-alt:disabled { opacity: .55; }
.auth-switch { display: block; margin: 14px auto 0; border: 0; background: none; color: var(--tts-blue); font: inherit; font-size: 12px; cursor: pointer; }
.auth-switch:hover { text-decoration: underline; }
.auth-title { font-size: 18px; font-weight: 750; color: var(--tts-ink); margin: 0 0 4px; }
.auth-note { font-size: 12px; color: var(--tts-muted); margin: 0 0 14px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-top: 18px; }
.auth-links a { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 13px; opacity: .92; }
.auth-links a:hover { opacity: 1; text-decoration: none; }
/* on tinhsonhanh.com: the way to the phone app address (app.tinhsonhanh.com/login) */
.auth-app-entry {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; margin-top: 14px; padding: 0 18px;
  border: 1px solid #f8d114; border-radius: 8px; color: #f8d114; font-size: 14px; font-weight: 600;
}
.auth-app-entry:hover { background: rgba(248, 209, 20, .12); color: #ffe56a; text-decoration: none; }

/* ================================================================== 6. legacy page styles
   Kept so the pages written before the restyle still render inside the new shell. Page agents move
   what they keep into css/<page>.css and delete the rest. */
.muted { color: #858796; }
.small { font-size: 11px; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-size: .93em; }
.r { text-align: right; }
.c { text-align: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1 1 auto; }
.pos { color: var(--blue); }
.neg { color: var(--red); }
.zero { color: #858796; }
.win-amt { color: var(--blue); font-weight: 700; }
.clamp-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.req { color: var(--danger); font-style: normal; }
mark.err { background: #ff0000; color: #fff; border-radius: 2px; padding: 0 1px; }
mark.hit { background: var(--hit-bg); color: inherit; border-radius: 2px; padding: 0 1px; }

.btn-outline { background: #fff; border-color: var(--input-line); color: var(--body); }
.btn-outline:hover { background: #f1f2f7; }
.btn-outline.active { background: #eef3fd; border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--body); }
.btn-ghost:hover { background: #f1f2f7; }
.btn-danger-outline { color: var(--danger); }
.btn-caps { text-transform: uppercase; }
.btn-icon { width: 32px; padding: 0; }
.btn-group { display: inline-flex; gap: 0; flex-wrap: wrap; }
.num-btn { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; margin: 0; }
.num-btn:hover { text-decoration: underline; }

.input-date { width: auto; min-width: 140px; }
.input-lg { height: 44px; }
.input.r { text-align: right; }
.msg-input { font-family: inherit; font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field > span:first-child { font-size: 12px; font-weight: 500; }
.form-grid { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
.form-grid-auto { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 28px; }
.check input { margin: 0; }
.field-check { align-self: end; margin-bottom: 12px; }
.flag-row { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; min-height: 32px; margin-bottom: 12px; }
.hint { font-size: 12px; background: #f8f9fc; border: .8px solid var(--td-line); border-radius: 5px; padding: 8px 10px; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 26px; }
.input-suffix span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #858796; pointer-events: none; }
.search-box { position: relative; flex: 1 1 180px; max-width: 320px; min-width: 150px; }
.search-box .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #858796; pointer-events: none; }
.search-box .input { padding-left: 30px; }
.pw-wrap { position: relative; display: block; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; position: relative; min-height: 28px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 42px; height: 24px; border-radius: 999px; background: #c9ced8; position: relative; transition: background-color .18s; flex: none; }
.switch-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s; }
.switch input:checked + .switch-track { background: #1f9d55; }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch-label { font-size: 12px; font-weight: 600; min-width: 74px; }
.switch-right { margin-left: auto; }
.seg { display: inline-flex; border: .8px solid var(--input-line); border-radius: 5.6px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg-btn, .seg-item span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--body); cursor: pointer; }
.seg-btn + .seg-btn, .seg-item + .seg-item span { border-left: .8px solid var(--input-line); }
.seg-btn.active, .seg-item input:checked + span { background: var(--primary); color: #fff; }
.seg-item { position: relative; display: inline-flex; cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-sm .seg-btn, .seg-sm .seg-item span { height: 28px; padding: 0 10px; }
.chip-check { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-check span { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; font-size: 12px; color: var(--body); user-select: none; }
.chip-check span::before { content: ""; width: 16px; height: 16px; border-radius: 5.6px; border: 1px solid #b7b9cc; background: #fff center / 50% no-repeat; flex: none; }
.chip-check input:checked + span::before {
  background-color: var(--primary); border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3E%3C/svg%3E");
}
.opt-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 0 0 10px; }
.opt-inline { margin: 0; }
.combo-row { display: flex; gap: 8px; align-items: center; }

.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.page-head h1 { font-size: 20px; font-weight: 700; color: var(--tts-navy); font-family: var(--font-sans); margin: 0; }
.page-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card { background: #fff; border: .8px solid var(--td-line); border-radius: 5.6px; padding: 12px; margin-bottom: 12px; }
.card-flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar-wrap { row-gap: 10px; }
.date-nav { display: inline-flex; align-items: center; gap: 2px; }
.date-label { font-size: 12px; font-weight: 600; }
.range { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.period-line { font-size: 12px; margin: 0 2px 8px; font-weight: 600; }
.note { margin: 6px 2px 0; }
.sub-title { font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
.sub-title small { font-weight: 400; }
.info-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
@media (max-width: 599px) {
  .page-head h1 { display: none; }
  .page-actions { width: 100%; }
  .action-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .action-bar .btn { flex: 0 0 auto; }
}

/* legacy tabs -> the site's tab bar look */
.tabs { display: flex; margin: 0 0 12px; background: #eaecf0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 1 0; min-width: max-content; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: 0; background: #eaecf0; color: #505b72; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.tab.active { color: #fff; background: linear-gradient(90deg, #259dba 0, #2574ab); }
.tab-err.active { background: linear-gradient(90deg, #e74a3b 0, #c0392b); }
.tabs-sm .tab { padding: 6px 12px; }
.count { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 999px; background: rgba(0, 0, 0, .08); font-size: 11px; text-align: center; }
.count-err { background: #f00; color: #fff; }

.badge-ok { background: var(--success); color: #fff; }
.badge-err { background: var(--danger); color: #fff; }
.badge-warn { background: var(--warning); color: #fff; }
.badge-muted { background: #858796; color: #fff; }
.badge-info { background: var(--info); color: #fff; }
.badge-win { background: var(--success); color: #fff; }

.alert { border: .8px solid; border-radius: 5.6px; padding: 10px 12px; margin: 0 0 10px; font-size: 12px; }
.alert-title { font-weight: 700; margin-bottom: 6px; }
.alert-err { background: var(--err-bg); border-color: var(--err-border); color: var(--err-ink); }
.alert-ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-ink); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-ink); }
.alert .msg-text { color: var(--body); background: #fff; border-radius: 5px; padding: 8px 10px; margin: 4px 0; }
.err-list { margin: 6px 0 0; padding-left: 18px; }

.summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 12px; }
.sum-item { background: #fff; border: .8px solid var(--td-line); border-radius: 5.6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sum-item span { font-size: 11px; color: #858796; font-weight: 600; }
.sum-item b { font-size: 16px; overflow-wrap: anywhere; }
.summary-compact .sum-item b { font-size: 14px; }
@media (min-width: 640px) { .summary { grid-template-columns: repeat(4, 1fr); } }

/* legacy tables -> red header bordered tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; }
.tbl th {
  background: var(--th-red); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase;
  text-align: left; padding: 12px; border: .8px solid var(--th-red); vertical-align: bottom;
}
.tbl th.r { text-align: right; }
.tbl th.c { text-align: center; }
.tbl td { padding: 12px; border: .8px solid var(--td-line); vertical-align: top; }
.tbl tfoot td { background: var(--th-total); color: #000; font-weight: 700; border-color: var(--th-total); }
.tbl .stt { width: 44px; }
.tbl-compact td, .tbl-compact th { padding: 8px 10px; }
.tbl-bets td { white-space: nowrap; }
.tbl-bets td.mono { white-space: normal; min-width: 120px; }
.row-win td { background: var(--win-bg); }
.row-err td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.row-off td { opacity: .55; }
.group-row td { background: #f1f3f8; font-size: 12px; padding: 8px 12px; }
.money-cell { white-space: nowrap; }
.actions-cell { white-space: nowrap; }
.msg-cell { min-width: 200px; max-width: 520px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--link); }
.msg-orig { margin-top: 4px; font-size: 11px; overflow-wrap: anywhere; }
.msg-box { white-space: pre-wrap; overflow-wrap: anywhere; background: #f8f9fc; border: .8px solid var(--td-line); border-radius: 5px; padding: 8px 10px; min-height: 36px; }
.msg-old { text-decoration: line-through; opacity: .6; margin-bottom: 6px; }
.bet-lines { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; }
.bet-lines li { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 4px 6px; border-top: 1px dashed var(--td-line); }
.bet-lines li.is-win { background: var(--win-bg); }
.bl-st { color: #858796; }
.bl-content { font-weight: 600; }
.bl-money { margin-left: auto; white-space: nowrap; }
.tbl-price td { padding: 6px 10px; vertical-align: middle; }
.tbl-price .input { width: 112px; margin-left: auto; height: 34px; }
.tbl-settings .input { min-width: 150px; height: 34px; }
.tbl-settings td { vertical-align: middle; }
.tbl-rev th, .tbl-rev td { white-space: nowrap; }
.tbl-rev td { vertical-align: middle; }
.reg-head { text-align: center !important; }
.reg-end { border-right-width: 2px !important; }
.tbl-sticky .sticky-col { position: sticky; left: 0; z-index: 2; background: #fff; }
.tbl-sticky th.sticky-col { background: var(--th-red); z-index: 3; }
.tbl-sticky tfoot .sticky-col { background: var(--th-total); }
.fmt-line { white-space: pre-wrap; }
@media (min-width: 720px) { .money-cell .fmt-line { white-space: pre; } }
.total-row td { background: var(--th-total); color: #000; font-weight: 700; border-color: var(--th-total); }
.msg-detail { margin-top: 8px; font-size: 12px; line-height: 25px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--body); }
.err-ink { color: var(--err-ink); }
.xt-thu { display: block; font-variant-numeric: tabular-nums; }
.hoi-lines { display: flex; flex-direction: column; gap: 1px; font-size: 12px; line-height: 1.35; }
.rev-foot { margin-top: 10px; padding: 10px 14px; display: grid; gap: 10px; }
@media (min-width: 720px) { .rev-foot { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.rev-foot-group { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.rev-foot-line { display: flex; gap: 6px; }
.copy-dlg { display: flex; flex-direction: column; gap: 10px; }
.copy-preview { min-height: 240px; font-size: 12px; white-space: pre; overflow: auto; resize: vertical; }
.cls-controls { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: flex-end; margin-bottom: 8px; }
.cls-controls .field { margin-bottom: 8px; min-width: 200px; }
.cls-controls .check { margin-bottom: 8px; font-weight: 700; }
.cls-item { padding: 10px 0; border-top: .8px solid var(--td-line); }
.cls-item.is-empty { opacity: .5; }
.cls-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cls-text { margin-top: 6px; min-height: 0; }
.cls-lines { display: flex; flex-direction: column; gap: 2px; }
.history .hist-item { margin-bottom: 14px; }
.hist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.steps { padding-left: 20px; margin: 0 0 10px; }
.steps li { margin: 6px 0; }
.check-box:not(:empty) { margin-top: 6px; }
.keep-open { margin-bottom: 6px; }
.edit-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: #5a5c69; margin-bottom: 12px; }
.edit-meta span { display: inline-flex; align-items: center; gap: 5px; }
.edit-grid { display: grid; gap: 0 14px; }
@media (min-width: 768px) { .edit-grid { grid-template-columns: 1fr 1fr; } }
.region-panel { padding-top: 4px; }
.panel-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* legacy Kết quả */
.do-so-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.do-so-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.do-so-row .input { width: auto; }
.do-so-row input.input { width: 150px; }
.do-so-row select.input { flex: 1 1 180px; max-width: 280px; }
.do-so-result:not(:empty) { margin-top: 10px; }
.hit-list { margin: 6px 0; padding-left: 18px; }
.kq-card { padding: 12px; }
.kq-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.kq-head h2 { margin: 0; font-size: 15px; }
.kq { width: 100%; border-collapse: collapse; table-layout: fixed; }
.kq th, .kq td { border: .8px solid var(--td-line); text-align: center; padding: 6px 3px; vertical-align: middle; }
.kq tbody th { width: 44px; background: #f8f9fc; color: #858796; font-size: 11px; font-weight: 700; }
.kq thead th { background: #f4f6fa; font-size: 12px; }
.kq-corner { width: 44px; color: #858796; }
.kq-south { min-width: calc(44px + var(--st, 3) * 78px); }
.kq-st { font-weight: 700; color: var(--tts-navy); }
.kq-st-status { font-size: 10px; font-weight: 600; margin-top: 2px; }
.kq-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.kq-grid { display: grid; grid-template-columns: repeat(var(--cols, 1), 1fr); gap: 4px 6px; align-items: center; justify-items: center; }
.kq-num { font-family: Arial, Helvetica, sans-serif; font-size: 17px; font-weight: 700; color: var(--tts-ink); }
.kq-num.is-hit { background: var(--win-bg); }
.kq-db .kq-num, .kq-g8 .kq-num, .kq-north .kq-g7 .kq-num { color: var(--tts-red); }
.kq-north .kq-db .kq-num { font-size: 24px; }
.kq-wait { color: #858796; }
.kq-input { height: 32px; padding: 4px; text-align: center; min-width: 0; }

/* legacy Hướng dẫn cú pháp */
.help h2 { font-size: 15px; }
.help ul { margin: 0 0 8px; padding-left: 20px; }
.help li { margin: 5px 0; }
.help details { border-top: .8px solid var(--td-line); padding: 4px 0; }
.help summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.boso-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; padding: 4px 0 8px; }
.boso { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.example-list { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 8px; }
@media (min-width: 900px) { .example-list { grid-template-columns: 1fr 1fr; } }
.example-list li { margin: 0 !important; padding: 8px 10px; border: .8px solid var(--td-line); border-radius: 5.6px; }
.example { border: 0; background: none; padding: 0; font: inherit; color: var(--body); cursor: pointer; text-align: left; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.try-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 10px 0 6px; }
.try-box .msg-input { min-height: 72px; }

/* ================================================================== 7. print */
@media print {
  .tts-header, .tts-sidebar, .tts-bottombar, .tts-sheet, .tts-menu-backdrop, .breadcrumb-tts, #toasts, .col-actions, .actions-cell { display: none !important; }
  #content-wrapper { margin: 0 !important; padding: 0 !important; }
  .view { padding: 0 !important; }
}
