/* =====================================================================
   Giao diện chung "Home Check" — kem / vàng ánh kim
   Dùng cho: các trang công cụ (base.html), trang chủ (base_main.html),
   trang quản trị (myadmin_base.html). Không dùng cho Kinh Dịch,
   Trạch Nhật Cao Cấp (2 trang này có header/footer riêng).
   ===================================================================== */
:root {
  --bg: #FFFDF8; --surface: #FFF; --sunk: #FBF6EA; --lua: #F6EDD8;
  --line: #E6DAC0; --gold-line: rgba(184,144,47,.45);
  --gold: #B8902F; --gold-chu: #8E6A17; --gold-bright: #D9B44A; --gold-soft: #FBF3DC;
  --on-gold: #2B1E08; --son: #9B2C1F; --deep: #1E1A16; --text: #4A4238;
  --muted: #6F6556; --faint: #B4A994; --brand-brown: #74321C;

  --vang-anh-kim: linear-gradient(90deg,#8E6A17,#D9B44A,#F3D98B,#D9B44A,#8E6A17);
  --vang-khoi: linear-gradient(135deg,#F7E4A4,#D9B44A 52%,#B8902F);
  --chu-vang-sang: linear-gradient(180deg,#C99A2E,#A57C22,#7A5A12);
  --hv-tram: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36'%3E%3Cpath d='M18 2L34 18L18 34L2 18Z' fill='none' stroke='%23B8902F' stroke-opacity='.10'/%3E%3C/svg%3E");
  --hv-hoi-van: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='14'%3E%3Cpath d='M0 13H24M4 13V1H20V10H9V5H15' fill='none' stroke='%23B8902F' stroke-width='1.2'/%3E%3C/svg%3E");
  --nen-cung: radial-gradient(1100px 500px at 10% -10%, rgba(217,180,74,.13), transparent 60%),
              radial-gradient(900px 500px at 100% 0%, rgba(184,144,47,.08), transparent 60%),
              var(--hv-tram), linear-gradient(180deg,#FFFDF8,#FBF6EA);
  --nen-lua: radial-gradient(900px 400px at 50% 0%, rgba(217,180,74,.16), transparent 70%),
             var(--hv-tram), #F6EDD8;

  --shadow: 0 1px 2px rgba(74,56,20,.05), 0 12px 32px rgba(116,88,20,.09);
  --shadow-lon: 0 2px 6px rgba(74,56,20,.08), 0 30px 80px rgba(116,88,20,.22);
  --shadow-gold: 0 6px 18px rgba(184,144,47,.32);
  --r-sm: 10px; --r: 18px; --r-btn: 14px; --r-pill: 999px;
  --max-w: 1200px; --header-h: 68px; --tap: 44px;
  --ease: cubic-bezier(.22,1,.36,1);
  --font-ui: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-tieude: "Playfair Display", Georgia, "Times New Roman", serif;

  /* Bootstrap 5 dùng các biến này */
  --bs-primary: #B8902F; --bs-primary-rgb: 184,144,47;
  --bs-body-font-family: var(--font-ui); --bs-body-color: #4A4238; --bs-body-bg: #FFFDF8;
  --primary: #B8902F; --dark: #1E1A16;
}

/* ---------- Nền & chữ ---------- */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui); color: var(--text); line-height: 1.65;
  background: var(--nen-cung); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
body > main, body > .hc-noi-dung { flex: 1 0 auto; }
h1, h2, h3, .h1, .h2, .h3 { font-family: var(--font-tieude); color: var(--deep); font-weight: 600; letter-spacing: -.01em; }
h4, h5, h6 { color: var(--deep); font-weight: 600; }
a { color: var(--gold-chu); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--son); }
::selection { background: var(--gold-soft); color: var(--deep); }

.chu-vang { background: var(--chu-vang-sang); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nhan-muc { display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: var(--gold-chu); }
.duong-vang { height: 1px; background: var(--vang-anh-kim); opacity: .55; border: 0; }
.vien-hoi-van { height: 14px; background: var(--hv-hoi-van) repeat-x left center; opacity: .55; }

/* ---------- Spinner ---------- */
#spinner { background: var(--bg) !important; }
#spinner .spinner-border { color: var(--gold) !important; border-width: .2em; }

/* ---------- Bootstrap: màu chủ đạo vàng ---------- */
.text-primary { color: var(--gold-chu) !important; }
.bg-primary { background: linear-gradient(135deg,#8E6A17,#B8902F) !important; color: #fff; }
.border-primary { border-color: var(--gold) !important; }
.btn { font-family: var(--font-ui); border-radius: var(--r-btn); font-weight: 600; transition: all .25s var(--ease); }
.btn-primary, .nut-vang {
  background: var(--vang-khoi) !important; border: 1px solid #C9A23E !important; color: var(--on-gold) !important;
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover, .btn-primary:focus, .nut-vang:hover { filter: brightness(1.05); transform: translateY(-1px); color: var(--on-gold) !important; }
.btn-outline-primary, .nut-vien {
  background: transparent; border: 1px solid var(--gold-line) !important; color: var(--gold-chu) !important;
}
.btn-outline-primary:hover, .nut-vien:hover { background: var(--gold-soft) !important; border-color: var(--gold) !important; color: var(--deep) !important; }
.btn-secondary { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.btn-secondary:hover { background: var(--sunk); border-color: var(--gold-line); color: var(--deep); }
.btn-success { background: #3E7C4A; border-color: #3E7C4A; }
.btn-danger { background: var(--son); border-color: var(--son); }
.btn:focus, .btn:active { box-shadow: 0 0 0 .2rem rgba(217,180,74,.35) !important; }

.form-control, .form-select {
  border: 1px solid var(--line); border-radius: var(--r-sm); background-color: #fff; color: var(--deep);
  min-height: var(--tap);
}
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(217,180,74,.22); }
.form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }
.form-label, label { color: var(--deep); font-weight: 500; }

.table { --bs-table-striped-bg: rgba(217,180,74,.06); --bs-table-hover-bg: rgba(217,180,74,.10); color: var(--text); }
.table > thead { background: var(--lua); }
.table > thead th { color: var(--deep); font-weight: 600; border-bottom: 1px solid var(--gold-line) !important; }
.table td, .table th { border-color: var(--line); }
.page-item.active .page-link { background: var(--gold); border-color: var(--gold); color: #fff; }
.page-link { color: var(--gold-chu); }
.alert { border-radius: var(--r-sm); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lon); padding: 8px; }
.dropdown-item { border-radius: 10px; padding: 8px 12px; color: var(--text); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--gold-soft); color: var(--deep); }
.bamtracuu, .btn.bamtracuu { background: var(--vang-khoi); color: var(--on-gold) !important; border: 1px solid #C9A23E; border-radius: var(--r-pill); box-shadow: var(--shadow-gold); font-weight: 600; }
.bamtracuu:hover { filter: brightness(1.05); }

/* ---------- Thẻ ---------- */
.the {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 28px;
}
.border.bg-white { border-color: var(--line) !important; border-radius: 20px; box-shadow: var(--shadow); }

/* ---------- Thanh trên cùng (ngày, liên hệ) ---------- */
.thanh-tren { background: var(--deep); color: #E8DCC0; font-size: 13px; }
.thanh-tren .khung { max-width: var(--max-w); margin: 0 auto; padding: 6px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.thanh-tren a { color: #F3D98B; }
.thanh-tren a:hover { color: #fff; }
.thanh-tren .ngay span + span::before { content: "◆"; font-size: 8px; color: var(--gold-bright); margin: 0 10px; vertical-align: middle; }
.thanh-tren .lien-he { display: flex; gap: 18px; }
.thanh-tren i { color: var(--gold-bright); margin-right: 6px; }

/* ---------- Đầu trang ---------- */
.dau-trang {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(255,253,248,.86); -webkit-backdrop-filter: saturate(1.3) blur(16px); backdrop-filter: saturate(1.3) blur(16px);
}
.dau-trang::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--vang-anh-kim); opacity: .55; }
.dau-trang-trong { max-width: var(--max-w); margin: 0 auto; padding: 8px 20px; min-height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.logo-trang { display: flex; align-items: center; gap: 12px; color: var(--deep); flex-shrink: 0; }
.logo-trang:hover { color: var(--deep); }
.logo-trang img { width: auto; max-width: 260px; object-fit: contain; border-radius: 10px; }
.logo-trang .ten { font-family: var(--font-tieude); font-size: 20px; font-weight: 700; line-height: 1.15; display: block; color: var(--brand-brown); }
.logo-trang .phu { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-chu); display: block; }

.menu-rong { display: flex; align-items: center; justify-content: center; gap: 4px; flex: 1; margin: 0; padding: 0; list-style: none; }
.menu-rong > li { position: relative; }
.menu-rong > li > a, .menu-rong > li > button {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 14px;
  font-size: 14px; font-weight: 500; color: var(--text); background: none; border: 0; position: relative; cursor: pointer;
}
.menu-rong > li > a:hover, .menu-rong > li > button:hover, .menu-rong > li:focus-within > button { color: var(--gold-chu); }
.menu-rong > li > a.dang-o { color: var(--deep); font-weight: 700; }
.menu-rong > li > a.dang-o::after, .menu-rong > li > button.dang-o::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 6px; height: 6px; background: var(--gold);
  transform: translateX(-50%) rotate(45deg);
}
.menu-rong > li > button.dang-o { color: var(--deep); font-weight: 700; }
.menu-rong .mui { font-size: 10px; transition: transform .25s var(--ease); }
.menu-rong > li:hover .mui, .menu-rong > li:focus-within .mui { transform: rotate(180deg); }

.menu-con {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, 8px); width: 340px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lon);
  padding: 10px; opacity: 0; visibility: hidden; transition: all .25s var(--ease); z-index: 20;
}
.menu-rong > li:hover .menu-con, .menu-rong > li:focus-within .menu-con { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.menu-con a { display: flex; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); align-items: flex-start; }
.menu-con a:hover { background: var(--gold-soft); color: var(--deep); }
.menu-con .bieu-tuong { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--gold-soft); color: var(--gold-chu); border: 1px solid var(--gold-line); font-size: 15px; }
.menu-con b { display: block; font-size: 14px; font-weight: 600; color: var(--deep); }
.menu-con small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.menu-con .khoa { margin-left: auto; color: var(--faint); font-size: 12px; padding-top: 3px; }

.ben-phai { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nut-vang, .nut-vien, .nut-nho {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 20px;
  border-radius: var(--r-pill); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.nut-vien { border: 1px solid var(--gold-line); }
.nut-nho { padding: 0 14px; color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 500; }
.nut-nho:hover { color: var(--gold-chu); background: var(--gold-soft); }

/* Menu di động */
.menu-hep { display: none; position: relative; }
.menu-hep > summary { list-style: none; width: var(--tap); height: var(--tap); border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--deep); font-size: 18px; }
.menu-hep > summary::-webkit-details-marker { display: none; }
.menu-hep[open] > summary { border-color: var(--gold); color: var(--gold-chu); }
.menu-hep .the-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(88vw, 340px); max-height: 75vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lon); padding: 12px;
}
.menu-hep .the-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); font-size: 15px; }
.menu-hep .the-menu a:hover, .menu-hep .the-menu a.dang-o { background: var(--gold-soft); color: var(--deep); font-weight: 600; }
.menu-hep .the-menu i { width: 18px; text-align: center; color: var(--gold-chu); }
.menu-hep .the-menu .nhan-muc { padding: 10px 12px 4px; font-size: 11px; }
.menu-hep .the-menu hr { border-color: var(--line); opacity: 1; margin: 8px 0; }

@media (max-width: 991.98px) {
  .menu-rong, .ben-phai .an-hep { display: none !important; }
  .menu-hep { display: block; }
  .dau-trang-trong { gap: 12px; justify-content: space-between; }
  .logo-trang .ten { font-size: 17px; }
  .thanh-tren .lien-he { display: none; }
}
@media (max-width: 575.98px) { .logo-trang .phu { display: none; } }

/* ---------- Khối đầu trang nội dung (hero) ---------- */
.hc-hero { position: relative; text-align: center; padding: 64px 20px 40px; }
.hc-hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.15; margin: 14px 0 12px; }
.hc-hero p.phu { color: var(--muted); max-width: 640px; margin: 0 auto 6px; font-size: 17px; }
.hc-hero .kim-cuong { display: inline-flex; align-items: center; gap: 12px; }
.hc-hero .kim-cuong::before, .hc-hero .kim-cuong::after { content: ""; width: 48px; height: 1px; background: var(--vang-anh-kim); }
.hc-tieu-de-khoi { text-align: center; margin-bottom: 32px; }
.hc-tieu-de-khoi h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 8px 0 0; }

/* ---------- Thẻ công cụ ---------- */
.cc-the {
  position: relative; overflow: hidden; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  padding: 30px 22px 26px; text-align: center; display: flex; flex-direction: column; align-items: center;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.cc-the::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--vang-anh-kim); opacity: 0; transition: opacity .35s var(--ease); }
.cc-the:hover { transform: translateY(-4px); box-shadow: var(--shadow-lon); border-color: var(--gold-line); }
.cc-the:hover::before { opacity: 1; }
.cc-icon {
  width: 76px; height: 76px; border-radius: 22px; transform: rotate(45deg); margin: 6px 0 22px;
  background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold-chu);
  display: flex; align-items: center; justify-content: center;
}
.cc-icon i { transform: rotate(-45deg); font-size: 28px; }
.cc-ten { font-family: var(--font-tieude); font-size: 22px; color: var(--deep); margin-bottom: 10px; }
.cc-mota { color: var(--muted); font-size: 14.5px; line-height: 1.6; flex-grow: 1; margin-bottom: 20px; }
.cc-khoa { color: var(--son); font-size: 14px; }

/* ---------- Chân trang ---------- */
.chan-trang { background: var(--nen-lua); color: var(--text); margin-top: 72px; position: relative; flex-shrink: 0; }
.chan-trang .khung { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.chan-dau { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 48px 0 32px; border-bottom: 1px solid var(--gold-line); }
.chan-dau .logo-chan img { max-height: 88px; max-width: 200px; object-fit: contain; border-radius: 14px; background: #fff; padding: 6px; box-shadow: var(--shadow); }
.chan-dau .khau-hieu { font-family: var(--font-tieude); font-size: clamp(26px, 3.6vw, 40px); line-height: 1.2; margin: 0 0 8px; font-weight: 600; }
.chan-dau .phu { color: var(--muted); margin: 0; white-space: pre-line; max-width: 760px; }
.chan-cot { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 32px; padding: 40px 0; }
.chan-cot .nhan-muc { margin-bottom: 14px; }
.chan-cot ul { list-style: none; padding: 0; margin: 0; }
.chan-cot li { margin-bottom: 9px; font-size: 14px; display: flex; gap: 10px; line-height: 1.55; }
.chan-cot li i { color: var(--gold); width: 16px; margin-top: 4px; flex-shrink: 0; text-align: center; }
.chan-cot a { color: var(--text); }
.chan-cot a:hover { color: var(--gold-chu); }
.chan-cot .ban-do iframe { width: 100%; height: 190px; border: 1px solid var(--line); border-radius: 14px; }
.mxh { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.mxh a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold-line); background: rgba(255,255,255,.6); display: inline-flex; align-items: center; justify-content: center; color: var(--gold-chu); font-size: 13px; font-weight: 700; }
.mxh a:hover { background: var(--vang-khoi); color: var(--on-gold); border-color: #C9A23E; }
.mxh svg { width: 15px; height: 15px; fill: currentColor; }
.chan-cuoi { border-top: 1px solid var(--gold-line); padding: 18px 0; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 767.98px) { .chan-dau { grid-template-columns: 1fr; text-align: center; } .chan-dau .logo-chan { justify-self: center; } }
@media print { .chan-trang, .dau-trang, .thanh-tren, .back-to-top { display: none !important; } }

/* ---------- Nút lên đầu ---------- */
.back-to-top, .nut-len-dau {
  position: fixed; right: 24px; bottom: 24px; z-index: 99; width: 48px; height: 48px; border-radius: 50% !important;
  display: none; align-items: center; justify-content: center; padding: 0;
  background: var(--vang-khoi) !important; border: 1px solid #C9A23E !important; color: var(--on-gold) !important; box-shadow: var(--shadow-gold);
}
.back-to-top:hover { transform: translateY(-2px); }

/* ---------- Trang quản trị ---------- */
body.myadmin .dau-trang { background: rgba(255,253,248,.92); }
.qt-nhan { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-chu); background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: var(--r-pill); padding: 3px 10px; white-space: nowrap; }
.qt-menu { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; list-style: none; }
.qt-menu > li > a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--text); position: relative; }
.qt-menu > li > a:hover { color: var(--gold-chu); background: var(--gold-soft); }
.qt-menu > li > a.dang-o { color: var(--deep); font-weight: 700; background: var(--gold-soft); }
.qt-menu > li > a i { color: var(--gold); font-size: 13px; }
.qt-menu .dropdown-toggle::after { border-top-color: var(--gold); }
body.myadmin .noi-dung-qt { max-width: 1320px; width: 100%; margin: 28px auto 0; padding: 0 16px; flex: 1 0 auto; }
body.myadmin .noi-dung-qt > .container-xxl, body.myadmin .noi-dung-qt > .container, body.myadmin .noi-dung-qt > .container-fluid {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 28px !important;
}
body.myadmin h1, body.myadmin h2 { font-size: clamp(24px, 2.6vw, 32px); }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--gold-soft) !important; border-color: var(--gold-line) !important; border-radius: 8px; }
.qt-chan { margin-top: 48px; background: var(--nen-lua); flex-shrink: 0; }
.qt-chan .khung { max-width: 1320px; margin: 0 auto; padding: 16px 20px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 1199.98px) {
  .qt-menu-wrap { display: none; }
  .qt-menu-wrap.show { display: block; position: absolute; left: 12px; right: 12px; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lon); padding: 10px; }
  .qt-menu-wrap.show .qt-menu { flex-direction: column; align-items: stretch; }
  .qt-menu-wrap.show .dropdown-menu { position: static !important; transform: none !important; box-shadow: none; border: 0; padding-left: 24px; }
  .qt-nut-menu { display: flex !important; }
}
@media (min-width: 1200px) { .qt-menu-wrap { display: block !important; flex: 1; } .qt-nut-menu { display: none !important; } }

/* Trang đăng nhập quản trị */
.qt-dang-nhap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.qt-dang-nhap .the { width: 100%; max-width: 440px; padding: 40px 34px; }
.back-to-top { line-height: 46px; text-align: center; font-size: 16px; }
.back-to-top[style*="block"] { display: flex !important; }

/* ---------- Xem Ngày: bỏ nền xanh, dùng nền chung ---------- */
.xemngay-nen { background: transparent; }
.xemngay-nen .border-primary { border-color: var(--line) !important; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.xemngay-nen .bg-primary {
  font-family: var(--font-ui) !important; font-size: clamp(12px, 1.05vw, 14.5px) !important; font-weight: 700 !important;
  letter-spacing: .03em; line-height: 1.3; padding: 9px 8px !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Menu tài khoản (góc phải header) ---------- */
.tai-khoan { position: relative; }
.tai-khoan .nut-tk { background: transparent; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 600; }
.tai-khoan .nut-tk .mui { font-size: 10px; margin-left: 2px; transition: transform .25s var(--ease); }
.tai-khoan.mo .nut-tk .mui { transform: rotate(180deg); }
.menu-tk {
  position: absolute; right: 0; top: 100%; margin-top: 8px; min-width: 230px; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lon); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .22s var(--ease);
}
.tai-khoan.mo .menu-tk { opacity: 1; visibility: visible; transform: translateY(0); }
.menu-tk .tk-dau { padding: 8px 12px 10px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-tk .tk-dau b { display: block; font-size: 15px; color: var(--deep); font-weight: 600; }
.menu-tk a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-size: 14px; }
.menu-tk a i { width: 16px; text-align: center; color: var(--gold-chu); }
.menu-tk a:hover { background: var(--gold-soft); color: var(--deep); }
.menu-tk a.dang-xuat { border-top: 1px solid var(--line); margin-top: 6px; border-radius: 0 0 10px 10px; }
.menu-tk a.dang-xuat, .menu-tk a.dang-xuat i { color: var(--son); }

/* Cột Liên kết ở footer canh phải */
@media (min-width: 768px) {
  /* Cột Liên kết đặt sát bên phải cho cân đối, chữ trong cột canh trái */
  .chan-cot .cot-lien-ket { justify-self: end; text-align: left; }
}

/* =====================================================================
   Header chính: đồng bộ font, cỡ chữ, chiều cao các thành phần
   ===================================================================== */
.thanh-tren, .dau-trang, .dau-trang a, .dau-trang button, .dau-trang summary { font-family: var(--font-ui); }
.thanh-tren { font-size: 13px; line-height: 1.4; }
.thanh-tren .khung { padding: 7px 20px; }

.dau-trang-trong { min-height: 72px; gap: 28px; padding: 10px 20px; }
.logo-trang { gap: 12px; }
.logo-trang img { max-height: 60px; max-width: 220px; width: auto; }
.logo-trang .ten { font-family: var(--font-tieude); font-size: 19px; font-weight: 700; line-height: 1.2; letter-spacing: .005em; }
.logo-trang .phu { font-size: 11px; font-weight: 500; letter-spacing: .14em; margin-top: 3px; line-height: 1.3; }

.menu-rong { gap: 6px; }
.menu-rong > li > a, .menu-rong > li > button {
  font-size: 15px; font-weight: 500; line-height: 1; min-height: 40px; padding: 0 14px;
  text-transform: none; letter-spacing: 0; border-radius: 10px;
}
.menu-rong > li > a:hover, .menu-rong > li > button:hover { background: var(--gold-soft); }
.menu-rong > li > a.dang-o, .menu-rong > li > button.dang-o { font-weight: 600; }
.menu-rong > li > a.dang-o::after, .menu-rong > li > button.dang-o::after { bottom: -2px; }
.menu-con b { font-size: 14.5px; font-weight: 600; }
.menu-con small { font-size: 12.5px; }

/* Nút bên phải: cùng cỡ chữ, cùng chiều cao, không in hoa */
.ben-phai { gap: 10px; }
.ben-phai .nut-vang, .ben-phai .nut-vien, .ben-phai .nut-tk {
  min-height: 40px; padding: 0 18px; font-size: 14.5px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.ben-phai .nut-vang i, .ben-phai .nut-vien i { font-size: 13px; }
.menu-tk a, .menu-hep .the-menu a { font-size: 14.5px; }
.menu-tk .tk-dau b { font-size: 15px; }
.menu-hep > summary { width: 40px; height: 40px; }

@media (max-width: 991.98px) {
  .dau-trang-trong { min-height: 64px; gap: 12px; }
  .logo-trang img { max-height: 44px; }
}

/* =====================================================================
   Canh lề trái thống nhất: tiêu đề khối, header, footer
   ===================================================================== */
.hc-tieu-de-khoi { text-align: left; }
.hc-tieu-de-khoi .duong-vang { margin-left: 0 !important; margin-right: auto !important; }

/* Header: menu nằm ngay sau logo, nút tài khoản dồn sang phải */
.menu-rong { justify-content: flex-start; }
.ben-phai { margin-left: auto; }

/* Footer: logo, khẩu hiệu, nội dung đều canh trái (cả trên điện thoại) */
.chan-dau { text-align: left; }
.chan-cuoi { text-align: left; }
@media (max-width: 767.98px) {
  .chan-dau { text-align: left; }
  .chan-dau .logo-chan { justify-self: start; }
  .chan-cuoi { flex-direction: column; gap: 4px; }
}

/* =====================================================================
   Nút "Tính Toán" / "Mở lá số" (Tứ Trụ, Phi Tinh): chữ nằm đúng giữa
   ô bảng đỏ ở chân cuộn giấy (ảnh img/tracuubg.png)
   Ô bảng trong ảnh: x 477–660 / 1043px, y 322–391 / 467px
   ===================================================================== */
.tracuu2 .bamtracuu, .tracuu2 .btn.bamtracuu {
  background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  color: #F7E4A4 !important; font-weight: 700; font-size: 20px; letter-spacing: .04em; line-height: 1;
  white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.tracuu2 .bamtracuu:hover, .tracuu2 .bamtracuu:focus { color: #fff !important; filter: none; box-shadow: none !important; }
@media (min-width: 769px) {
  .tracuu2 .tab-panels { position: relative; flex-shrink: 0; max-width: 100%; }
  .tracuu2 .formcon .position-relative { position: static !important; }
  .tracuu2 .bamtracuu, .tracuu2 .btn.bamtracuu {
    /* Tính theo bề ngang khung (ảnh nền co theo bề ngang, căn giữa theo chiều dọc):
       tâm ô đỏ lệch xuống 123.5/1043 bề ngang so với tâm khung; margin-top % tính theo bề ngang */
    position: absolute; left: 54.5%; top: 50%; right: auto; bottom: auto; margin: 11.84% 0 0 0;
    transform: translate(-50%, -50%); width: 17.5%; height: auto; aspect-ratio: 183 / 69;
    display: flex; align-items: center; justify-content: center; padding: 0 !important;
  }
}

/* =====================================================================
   Header, thanh trên, footer: cùng mép trái/phải với khung nội dung (.container-xxl)
   container-xxl: rộng 100% + lề 12px, từ 1400px trở lên tối đa 1320px
   ===================================================================== */
body:not(.myadmin) .thanh-tren .khung,
body:not(.myadmin) .dau-trang-trong,
body:not(.myadmin) .chan-trang .khung {
  max-width: none; width: 100%; padding-left: .75rem; padding-right: .75rem;
}
@media (min-width: 1400px) {
  body:not(.myadmin) .thanh-tren .khung,
  body:not(.myadmin) .dau-trang-trong,
  body:not(.myadmin) .chan-trang .khung { max-width: 1320px; }
}
/* Khung nội dung trang chủ & Công cụ của tôi: giữ lề 12px cả trên điện thoại */
.container-xxl.hc-khung { padding-left: .75rem; padding-right: .75rem; }

/* Menu chính dồn sang phải, sát phần tài khoản (máy tính): logo trái – [menu + tài khoản] phải */
@media (min-width: 992px) {
  body:not(.myadmin) .dau-trang-trong { display: flex; }
  body:not(.myadmin) .dau-trang-trong > .menu-rong { flex: 0 1 auto; margin-left: auto; justify-content: flex-end; }
  body:not(.myadmin) .dau-trang-trong > .ben-phai { margin-left: 0; }
}

/* Tên website + khẩu hiệu cạnh logo: hiện cả trên điện thoại, tự rút gọn khi hẹp */
.logo-trang .chu-logo { display: block; min-width: 0; }
.logo-trang .chu-logo .ten, .logo-trang .chu-logo .phu { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 991.98px) {
  body:not(.myadmin) .logo-trang { flex: 1 1 auto; min-width: 0; gap: 10px; }
  .logo-trang .chu-logo .ten { font-size: 16px; line-height: 1.2; }
  .logo-trang .chu-logo .phu { display: block !important; font-size: 10px; letter-spacing: .08em; margin-top: 2px; }
}
@media (max-width: 380px) {
  .logo-trang .chu-logo .ten { font-size: 14.5px; }
  .logo-trang .chu-logo .phu { font-size: 9px; letter-spacing: .04em; }
}
@media (min-width: 992px) { .logo-trang .chu-logo { max-width: 320px; } }

/* =====================================================================
   Gọn & tối giản (v15): menu Công cụ chỉ tên, lưới ô công cụ nhỏ nhiều cột
   ===================================================================== */
/* Menu Công cụ (máy tính): 2 cột, mỗi dòng chỉ icon + tên */
.menu-con {
  width: 420px; padding: 8px; left: auto; right: 0; transform: translate(0, 8px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.menu-rong > li:hover .menu-con, .menu-rong > li:focus-within .menu-con { transform: translate(0, 0); }
.menu-con a { align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 14px; line-height: 1.3; }
.menu-con .bieu-tuong { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.menu-con .ten-cc { font-weight: 500; color: var(--deep); }
.menu-con a:hover .ten-cc { color: var(--gold-chu); }
.menu-con .khoa { padding-top: 0; font-size: 11px; }

/* Tiêu đề khối gọn hơn */
.hc-tieu-de-khoi { margin-bottom: 18px; }
.hc-tieu-de-khoi h2 { font-size: clamp(22px, 2.6vw, 30px); }

/* Ô công cụ: nhỏ, cả ô bấm được */
.cc-luoi .col { display: flex; }
.cc-o {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 108px; padding: 16px 10px 14px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(74,56,20,.05); color: var(--deep);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
a.cc-o:hover, .cc-o-qt:hover { color: var(--deep); border-color: var(--gold-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.cc-o-icon {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold-chu); font-size: 17px;
}
.cc-o-ten { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.cc-o-khoa { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.cc-o.bi-khoa .cc-o-icon { background: var(--sunk); color: var(--faint); border-color: var(--line); }
.cc-o.bi-khoa .cc-o-ten { color: var(--text); }
/* Bản quản trị: ô mở công cụ + nút bánh răng góc phải */
.cc-o-qt { padding: 0; }
.cc-o-mo { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 10px 14px; color: var(--deep); }
.cc-o-mo:hover { color: var(--gold-chu); }
.cc-o-caidat {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px;
}
.cc-o-caidat:hover { background: var(--gold-soft); color: var(--gold-chu); }
@media (max-width: 575.98px) {
  .cc-o, .cc-o-mo { min-height: 96px; padding: 12px 8px; }
  .cc-o-qt { padding: 0; }
  .cc-o-ten { font-size: 13.5px; }
}
/* Ô công cụ dạng ngang: icon trái, tên phải (thấp hơn, tiết kiệm chỗ) */
.cc-o, .cc-o-mo {
  display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; row-gap: 2px;
  align-items: center; justify-items: start; justify-content: stretch;
  min-height: 64px; padding: 12px 14px; text-align: left;
}
.cc-o-icon { grid-row: span 2; }
.cc-o-khoa { grid-column: 2; }
.cc-o-qt { display: flex; padding: 0; }
.cc-o-qt .cc-o-mo { padding-right: 36px; }
.cc-o-caidat { top: 50%; transform: translateY(-50%); }
.menu-con { width: 460px; }
@media (max-width: 575.98px) {
  .cc-o, .cc-o-mo { grid-template-columns: 34px 1fr; column-gap: 10px; min-height: 58px; padding: 10px; }
  .cc-o-qt { padding: 0; }
  .cc-o-icon { width: 34px; height: 34px; font-size: 15px; border-radius: 9px; }
}
.cc-o-icon { grid-row: 1 / span 2; }
.cc-o-ten { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.cc-o.bi-khoa .cc-o-ten { grid-row: 1; align-self: end; }
.cc-o.bi-khoa .cc-o-khoa { grid-row: 2; align-self: start; }

/* Bộ icon công cụ phong thủy (static/img/cong-cu-icons.svg) */
.cc-svg { width: 1em; height: 1em; display: inline-block; vertical-align: -.15em; flex-shrink: 0; overflow: visible; }
.cc-o-icon { font-size: 27px; }
.menu-con .bieu-tuong { font-size: 21px; }
.menu-hep .the-menu .cc-svg { width: 18px; height: 18px; color: var(--gold-chu); }
.cc-o-icon .cc-svg { transition: transform .25s var(--ease); }
a.cc-o:hover .cc-o-icon .cc-svg, .cc-o-mo:hover .cc-o-icon .cc-svg { transform: scale(1.08); }
@media (max-width: 575.98px) { .cc-o-icon { font-size: 24px; } }

/* Chân trang: khẩu hiệu & logo nhỏ lại cho cân đối */
.chan-dau { padding: 32px 0 24px; gap: 20px; }
.chan-dau .logo-chan img { max-height: 64px; }
.chan-dau .khau-hieu { font-size: clamp(18px, 1.9vw, 23px); line-height: 1.35; margin: 0 0 4px; }
.chan-dau .phu { font-size: 14px; }

/* =====================================================================
   v18 – Sửa theo rà soát giao diện
   ===================================================================== */
/* Bỏ lớp che "đang tải" toàn trang */
#spinner { display: none !important; }

/* Viền khi điều hướng bằng bàn phím */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible,
.form-control:focus-visible, .form-select:focus-visible {
  outline: 2px solid var(--gold) !important; outline-offset: 2px; border-radius: 6px;
}
.cc-o:focus-visible { outline-offset: 3px; border-radius: 14px; }

/* Nút đăng nhập dạng icon (chỉ hiện trên điện thoại / máy tính bảng) */
.nut-dn-hep { display: none; }
@media (max-width: 991.98px) {
  .nut-dn-hep {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px;
    background: var(--vang-khoi); border: 1px solid #C9A23E; color: var(--on-gold); box-shadow: var(--shadow-gold); font-size: 16px;
  }
  .nut-dn-hep:hover { color: var(--on-gold); filter: brightness(1.05); }
}

/* Lời mời xin tài khoản (khách chưa đăng nhập) */
.loi-moi {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 12px 16px; border-radius: 14px;
  background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--text); font-size: 14.5px; line-height: 1.5;
}
.loi-moi > i { color: var(--gold-chu); font-size: 16px; }
.loi-moi > span { flex: 1 1 260px; }
.loi-moi a:not(.nut-vang) { color: var(--son); font-weight: 600; }
.loi-moi .loi-moi-nut { min-height: 38px; padding: 0 18px; font-size: 13.5px; letter-spacing: 0; text-transform: none; }
.loi-moi.gon { display: block; text-align: center; font-size: 13.5px; padding: 10px 12px; margin-bottom: 0; }

/* Chân trang: sát nội dung hơn, nhãn đậm hơn, link dễ bấm */
.chan-trang { margin-top: 32px; }
.chan-cot { padding: 28px 0; gap: 24px 32px; }
.chan-cot .nhan-muc { color: #6E5210; }
.chan-cot li { margin-bottom: 2px; align-items: center; }
.chan-cot li a { display: inline-block; padding: 7px 0; }
.chan-cot li > span a { padding: 0; }
@media (max-width: 767.98px) {
  .chan-cot { grid-template-columns: 1fr; gap: 20px; padding: 24px 0; }
  .chan-cot > div:first-child ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .chan-dau { padding: 24px 0 18px; }
  .chan-dau .logo-chan img { max-height: 52px; }
}

/* Lịch âm (trang Tin tức, khung lịch): đổi xanh dương sang tông vàng của site */
.calendar-month, .amlich .tenthang, .amlich .navi-l, .amlich .navi-r {
  background: var(--brand-brown) !important; color: #FFF6DD !important; text-shadow: none !important;
}
.calendar td { background-color: var(--sunk); }
.amlich .calendar-day .day-num { color: var(--gold-chu); }
.amlich .lunar-day-num { color: var(--brand-brown); }
.amlich .am2 { color: var(--gold-chu); }
.amlich .homnay { background-color: var(--gold-soft); }

/* v19 – Chân trang gọn: danh sách công cụ chia 2 cột */
.chan-cot > div:first-child ul { columns: 2; column-gap: 28px; }
.chan-cot > div:first-child li { break-inside: avoid; margin-bottom: 0; }
.chan-cot li a { padding: 5px 0; }
@media (min-width: 768px) {
  .chan-cot > div:first-child { grid-column: span 2; }
}
@media (max-width: 767.98px) {
  .chan-cot > div:first-child ul { display: block; columns: 2; column-gap: 12px; }
}

/* =====================================================================
   v20 – Chân trang 4 cột: đơn vị | hỗ trợ | công cụ | kết nối
   ===================================================================== */
.chan-luoi {
  display: grid; grid-template-columns: 1.25fr 1fr 1.35fr .9fr; gap: 28px 36px;
  padding: 36px 0 28px;
}
.chan-logo { display: inline-block; margin-bottom: 12px; }
.chan-logo img { max-height: 76px; max-width: 170px; object-fit: contain; border-radius: 12px; background: #fff; padding: 6px; box-shadow: var(--shadow); }
.chan-ten { font-weight: 700; color: var(--deep); font-size: 14.5px; line-height: 1.45; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 4px; }
.chan-mst { font-weight: 600; color: var(--deep); font-size: 14px; margin: 0 0 10px; }
.chan-lh { list-style: none; padding: 0; margin: 0; }
.chan-lh li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; margin-bottom: 8px; color: var(--text); }
.chan-lh i { color: var(--gold); width: 16px; margin-top: 3px; flex-shrink: 0; text-align: center; }
.chan-lh a { color: var(--text); }
.chan-lh a:hover { color: var(--gold-chu); }

.chan-tieu-de {
  font-family: var(--font-tieude); font-size: 17px; font-weight: 700; color: var(--brand-brown);
  margin: 6px 0 14px; padding-bottom: 8px; position: relative;
}
.chan-tieu-de::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 2px; background: var(--vang-anh-kim); border-radius: 2px; }

.chan-ds { list-style: none; padding: 0; margin: 0; }
.chan-ds li { break-inside: avoid; }
.chan-ds a { position: relative; display: inline-block; padding: 5px 0 5px 16px; font-size: 14px; color: var(--text); line-height: 1.45; }
.chan-ds a::before {
  content: ""; position: absolute; left: 1px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.6px solid var(--gold); border-top: 1.6px solid var(--gold); transform: rotate(45deg);
}
.chan-ds a:hover { color: var(--gold-chu); }
.chan-ds-cc { columns: 2; column-gap: 20px; }

.chan-mxh { list-style: none; padding: 0; margin: 0; }
.chan-mxh a { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14.5px; font-weight: 500; color: var(--text); }
.chan-mxh a:hover { color: var(--gold-chu); }
.mxh-ic {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--gold-line); color: var(--gold-chu); font-size: 14px; transition: all .2s var(--ease);
}
.mxh-ic svg { width: 14px; height: 14px; fill: currentColor; }
.mxh-ic.mxh-chu { font-size: 9.5px; font-weight: 800; letter-spacing: -.02em; }
.chan-mxh a:hover .mxh-ic { background: var(--vang-khoi); color: var(--on-gold); border-color: #C9A23E; }
.chan-ban-do { display: block; width: 100%; height: 130px; border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }

.chan-cuoi { display: block; padding: 14px 0 18px; }
.chan-ghi-chu { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); font-style: italic; line-height: 1.5; }
.chan-cuoi-dong { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

@media (max-width: 1099.98px) {
  .chan-luoi { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 575.98px) {
  .chan-luoi { grid-template-columns: 1fr 1fr; gap: 22px 16px; padding: 26px 0 20px; }
  .chan-don-vi { grid-column: 1 / -1; }
  .chan-hotro { order: 1; } .chan-ketnoi { order: 2; }
  .chan-congcu { order: 3; grid-column: 1 / -1; }   /* cột công cụ: rộng hết, chia 2 */
  .chan-tieu-de { font-size: 16px; margin-bottom: 10px; }
  .chan-cuoi-dong { flex-direction: column; }
}

/* v21 – Bỏ cột Công cụ ở chân trang (đã có lưới công cụ phía trên): còn 3 cột */
.chan-luoi { grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 767.98px) { .chan-luoi { grid-template-columns: 1fr 1fr; } .chan-don-vi { grid-column: 1 / -1; } }

/* v22 – Dòng tiêu đề ở đầu khung công cụ (Thước Lỗ Ban, Độ Lệch Cửa…) */
.cc-dau { display: flex; align-items: center; gap: 12px; padding: 6px 6px 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.cc-dau-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold-chu); font-size: 27px; }
.cc-dau-ten { font-size: 22px; margin: 0; }
.cc-dau-mota { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
@media (max-width: 575.98px) { .cc-dau-ten { font-size: 19px; } .cc-dau-mota { font-size: 12.5px; } }

/* =====================================================================
   v23 – Gọn hơn cho khách: ô công cụ một dòng + khóa nhỏ; trang lỗi
   ===================================================================== */
.cc-o.bi-khoa .cc-o-ten { grid-row: 1 / span 2; align-self: center; }
.cc-o-khoa {
  position: absolute; top: 8px; right: 9px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 10px;
  background: var(--sunk); border: 1px solid var(--line); color: var(--faint);
}
.cc-o.bi-khoa { padding-right: 34px; }
.cc-o.bi-khoa .cc-o-khoa { grid-row: auto; grid-column: auto; align-self: auto; }
.cc-o.bi-khoa:hover .cc-o-khoa { color: var(--gold-chu); border-color: var(--gold-line); }

/* Lời mời xin tài khoản: gọn trên điện thoại */
@media (max-width: 575.98px) {
  .loi-moi { padding: 10px 12px; gap: 8px 10px; font-size: 13.5px; }
  .loi-moi > i { display: none; }
  .loi-moi .loi-moi-nut { min-height: 34px; padding: 0 14px; font-size: 13px; }
}

/* Trang lỗi / chưa có quyền */
.trang-loi { max-width: 520px; padding: 36px 28px; }
.trang-loi-so { font-family: var(--font-tieude); font-size: 64px; font-weight: 700; line-height: 1; margin-bottom: 10px;
  background: var(--chu-vang-sang); -webkit-background-clip: text; background-clip: text; color: transparent; }
.trang-loi-khoa { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold-chu); font-size: 24px; }

/* v24 – Tiêu đề đứng riêng (trang không có khung chung: Xem Ngày, Xem Ngày Cưới) */
.cc-dau-don { border-bottom: 0; padding: 0; margin-bottom: 16px; }
.xnc-top-action .cc-dau-don { margin-bottom: 0; }
.xnc-top-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* Tứ Trụ / Phi Tinh: CSS cũ kéo form lên -75px đè chỗ tiêu đề cũ -> trả về bình thường khi có tiêu đề mới */
.tracuu2 .cc-dau + .tabbed-content { margin-top: 0; }
.tracuu2 .cc-dau { margin-bottom: 16px; }

/* v25 – Ô công cụ đang ẩn ở trang quản trị */
.cc-o-an { opacity: .6; border-style: dashed; }
.cc-o-nhan-an { display: inline-block; font-size: 11px; font-weight: 500; color: var(--muted); background: var(--sunk); border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
