/* ============================================================
   ui2.css — GIAO DIỆN 2 (05/11/2026) — theo mẫu "📊 Báo cáo kinh doanh".
   Anh Dũng: "đổi giao diện toàn db.classic.vn, các tab đều có màu sắc và chữ rõ ràng như trong báo cáo".
     · chữ đậm, tương phản cao: chữ chính #0f172a, chữ phụ #475569 / #64748b (thay xám nhạt cũ)
     · khung màu xanh than #0f172a + vạch vàng #c9a227 (sidebar, thanh tiêu đề, tab đang chọn)
     · tiêu đề cột bảng + nhãn ô số: CHỮ IN HOA nhỏ, giãn chữ, đậm
     · xanh lá = tốt, đỏ = xấu — đậm hơn để đọc được trên nền trắng
     · nút: xanh dương #2563eb (rõ "xanh" hơn tím than cũ)
   Lớp phủ lên app.css + ui1b.css. Gỡ dòng <link …ui2.css> trong index.html là về giao diện 1b.
   ============================================================ */

/* ---------- Token (chế độ sáng) ---------- */
html:not([data-theme="dark"]) {
  --bg:            #F1F5F9;
  --surface:       #FFFFFF;
  --surface-2:     #F8FAFC;
  --surface-3:     #EEF2F7;
  --border:        #E2E8F0;
  --border-strong: #CBD5E1;

  --text:   #0F172A;
  --text-2: #475569;
  --text-3: #64748B;

  --primary:      #2563EB;
  --primary-600:  #1D4ED8;
  --primary-soft: #EFF5FF;

  --success: #15803D;  --success-soft: #ECFDF3;
  --warning: #B45309;  --warning-soft: #FFF7E6;
  --danger:  #C62828;  --danger-soft:  #FEF2F2;
  --info:    #1D4ED8;  --info-soft:    #EFF5FF;
  --purple:  #6D28D9;  --purple-soft:  #F3EEFF;

  --ink: #0F172A;
  --line-soft: #EEF2F6;
  --faint: #64748B;
}
:root { --navy: #0F172A; --navy-2: #1E293B; --navy-3: #334155; --gold: #C9A227; --gold-2: #E7C85A; }
[data-theme="dark"] { --primary: #3B82F6; --primary-600: #2563EB; --gold: #C9A227; --gold-2: #E7C85A; }

body { color: var(--text); }
b, strong { font-weight: 700; }
.muted { color: var(--text-3); }
.bold { font-weight: 700; }

/* ---------- Sidebar xanh than, mục đang mở có vạch vàng ---------- */
.sidebar { background: var(--navy); color: #CBD5E1; }
.nav__item, .nav__label { color: #CBD5E1; }
.nav__item:hover, .nav__label:hover { background: var(--navy-2); color: #fff; }
.nav__item.is-active, [data-theme="dark"] .nav__item.is-active {
  background: var(--navy-2); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--gold);
}
.nav__sub .nav__item { color: #94A3B8; }
.nav__sub .nav__item.is-active { color: var(--gold-2); }
.nav__chev::after { color: #64748B; }
.sidebar__foot { border-top-color: var(--navy-2); }
.user-chip:hover, .sidebar .icon-btn:hover { background: var(--navy-2); }
.user-chip__av { background: var(--navy-3); }
.user-chip__role, .sidebar .icon-btn { color: #94A3B8; }
.sidebar__ver { color: #475569; }
.sidebar ::-webkit-scrollbar-thumb { background: var(--navy-2); border-color: var(--navy); }

/* ---------- Thanh tiêu đề: chữ xanh than đậm, vạch vàng dưới ---------- */
.topbar { border-bottom: 3px solid var(--gold); }
.topbar__title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.topbar__sub { color: var(--text-3); font-weight: 500; }

/* ---------- Tab cấp trang: tab đang chọn nền xanh than, chữ trắng ---------- */
.seg { background: var(--surface-3); border: 1px solid var(--border); }
.seg button { color: var(--text-2); font-weight: 600; }
.seg button:hover { color: var(--text); background: rgba(15,23,42,.05); }
.seg button.is-active, [data-theme="dark"] .seg button.is-active {
  background: var(--navy); color: #fff; font-weight: 700; box-shadow: inset 0 -2px 0 var(--gold);
}
[data-theme="dark"] .seg button.is-active { background: #334155; }
.xk-tab.is-chon { background: var(--navy); border-color: var(--navy); box-shadow: inset 0 -2px 0 var(--gold); }

/* ---------- Thẻ: đầu thẻ nền nhạt, tiêu đề đậm ---------- */
.card { border-color: var(--border); }
.card__head { background: var(--surface-2); border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }
.card--gon .card__head { background: transparent; }
.card__title { font-size: 15px; font-weight: 800; color: var(--text); }
.card__sub { color: var(--text-3); }

/* ---------- Ô số: nhãn in hoa, số đậm, nền nhạt như báo cáo ---------- */
.stat { background: var(--surface-2); border: 1px solid var(--border); }
.stat__label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.stat__value { font-size: 24px; font-weight: 800; color: var(--text); }
.stat__hint { color: var(--text-2); }
.stat--success .stat__value { color: var(--success); }
.stat--danger .stat__value  { color: var(--danger); }
.stat--warning .stat__value { color: var(--warning); }

/* ---------- Bảng: tiêu đề cột in hoa đậm, số đậm, hàng rõ ---------- */
.tbl th {
  background: var(--surface-2); color: var(--text-3);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.tbl td { color: var(--text); border-bottom-color: var(--line-soft); }
.tbl .num { font-weight: 700; }
.tbl tbody tr:hover td { background: #F8FAFC; }
[data-theme="dark"] .tbl tbody tr:hover td { background: var(--surface-2); }

/* ---------- Nhãn trạng thái: đậm, có viền mảnh ---------- */
.tag { font-weight: 700; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }

/* ---------- Thông báo trong trang ---------- */
.alert--warning { background: #FFF7E6; border-color: #F5D79E; color: #7A5200; }
[data-theme="dark"] .alert--warning { background: var(--warning-soft); color: #fcd34d; }
.alert--danger { font-weight: 500; }

/* ---------- Nút: xanh dương rõ ---------- */
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-600); border-color: var(--primary-600); }

/* ---------- Modal: đầu hộp xanh than + vạch vàng như báo cáo ---------- */
.modal__head { background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold); border-radius: 14px 14px 0 0; }
.modal__head .modal__title, .modal__head h3 { color: #fff; font-weight: 800; }
.modal__head .icon-btn, .modal__head button { color: #CBD5E1; }
.modal__head .icon-btn:hover, .modal__head button:hover { background: var(--navy-2); color: #fff; }

/* ---------- Tổng quan 1b: cột doanh thu theo màu báo cáo ---------- */
.db-so { font-weight: 800; }
.db-cot__than { background: #BFD3F8; }
.db-cot__than.is-cuoi { background: var(--primary); }

/* ---------- Điện thoại ---------- */
@media (max-width: 767px) {
  .nav__sub .nav__item { background: var(--navy-2); color: #E2E8F0; }
  .nav__sub .nav__item.is-active { background: var(--navy-3); color: var(--gold-2); box-shadow: inset 3px 0 0 var(--gold); }
  .sidebar__foot { border-bottom-color: var(--navy-2); }
  .tabbar { border-top: 2px solid var(--gold); }
  .tabbar__item { color: var(--text-3); }
  .tabbar__item.is-active { color: var(--navy); font-weight: 800; }
  [data-theme="dark"] .tabbar__item.is-active { color: var(--gold-2); }
}
