/* =====================================================================
   Theme: 18+ (html[data-theme="adult"])
   AUTO-SPLIT từ app-theme.css. Mỗi theme 1 file, độc lập — sửa file này
   không ảnh hưởng theme khác. Thêm theme mới: tạo public/css/themes/<ten>.css
   (layout tự nạp mọi file trong themes/).
   ===================================================================== */

html[data-theme="adult"] .mm-theme-opt.is-active .mm-theme-check { color: var(--mm-accent); }
/* HIỆU NĂNG: ở 2 theme có blur kính (Thẻ trong suốt / 18+), pulse box-shadow của
   thẻ "Tổng nợ" buộc Chrome desktop vẽ lại lớp blur mỗi frame -> giật. Chỉ tắt
   GLOW (box-shadow lặp, không composite được). Icon vẫn RUNG: transform được
   đẩy sang layer GPU riêng (will-change bên dưới) nên không động vào lớp blur. */
html[data-theme="adult"] .mm-stat--owe {
    animation: none !important;
}
/* =====================================================================
   Theme "18+" — tông đêm: đen + bia hổ phách + vàng kim, nhấn đỏ rượu.
   Bật ở menu user; lưu localStorage('mmTheme'='adult') -> [data-theme="adult"].
   ===================================================================== */
html[data-theme="adult"] {
    --mm-primary:        #e0962f;   /* bia hổ phách */
    --mm-primary-dark:   #c47a1c;
    --mm-primary-darker: #9c5e12;
    --mm-primary-soft:   rgba(224, 150, 47, .16);
    --mm-accent:         #f5c451;   /* vàng kim */
    --mm-success:        #6bbf59;
    --mm-success-soft:   rgba(107, 191, 89, .16);
    --mm-danger:         #e0533d;   /* đỏ rượu */
    --mm-danger-soft:    rgba(224, 83, 61, .18);
    /* Màu tiền sáng cho nền tối -> số xanh/đỏ rõ & đẹp như danh sách bill. */
    --mm-pos:            #8fd97e;
    --mm-neg:            #f08a78;
    --mm-warning:        #f0a830;
    --mm-warning-soft:   rgba(240, 168, 48, .16);
    --mm-info:           #d9a441;
    --mm-info-soft:      rgba(217, 164, 65, .16);

    --mm-bg:        #140c06;
    --mm-surface:   rgba(28, 18, 10, .62);
    --mm-soft:      rgba(40, 26, 14, .55);
    --mm-ink:       #f3e7d4;        /* chữ kem ấm */
    --mm-muted:     #c2ad8c;
    --mm-muted-2:   #d8c5a3;
    --mm-border:    rgba(245, 196, 81, .22);   /* viền ánh vàng kim */

    --bs-body-color: var(--mm-ink);
    --bs-border-color: var(--mm-border);
    --mm-shadow-card:  0 1px 2px rgba(0, 0, 0, .4), 0 6px 22px rgba(0, 0, 0, .45);
    --mm-shadow-hover: 0 10px 34px rgba(224, 150, 47, .35);
}
html[data-theme="adult"] body { background-color: #140c06; color: var(--mm-ink); }
html[data-theme="adult"] body::before {
    background:
        linear-gradient(rgba(10, 6, 2, .40), rgba(8, 4, 1, .56)),
        url('/images/background_18.png') center center / cover no-repeat;
}
@media (max-width: 767.98px) {html[data-theme="adult"] body::before {
        background-image:
            linear-gradient(rgba(10, 6, 2, .40), rgba(8, 4, 1, .56)),
            url('/images/background_18_mb.png');
    }
}
html[data-theme="adult"] h1,
html[data-theme="adult"] h2,
html[data-theme="adult"] h3,
html[data-theme="adult"] h4,
html[data-theme="adult"] h5,
html[data-theme="adult"] h6 { color: #f7ecd6; }
/* Thẻ tối, viền ánh vàng kim + glow nhẹ.
   HIỆU NĂNG: KHÔNG dùng backdrop-filter blur ở đây. Dashboard có rất nhiều thẻ
   (stat/chart/bảng) — mỗi thẻ trong mờ + blur nằm trên ảnh nền CỐ ĐỊNH buộc
   Chrome lấy mẫu & blur lại nền sau mỗi thẻ trên TỪNG frame khi cuộn -> giật.
   Thay bằng nền đặc hơn (giống cách theme mặc định đã xử lý ở app-theme.css). */
html[data-theme="adult"] .card,
html[data-theme="adult"] .mm-stat,
html[data-theme="adult"] .mm-chart-card {
    background: rgba(22, 13, 6, .80) !important;
    border: 1px solid rgba(245, 196, 81, .28) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 22px rgba(0, 0, 0, .4) !important;
}
html[data-theme="adult"] .mm-bill,
html[data-theme="adult"] .mm-task {
    background: rgba(40, 24, 12, .18);
    border-color: rgba(245, 196, 81, .22);
}
html[data-theme="adult"] .mm-task { border-left-color: var(--mm-warning); }
html[data-theme="adult"] .mm-task__title,
html[data-theme="adult"] .mm-task__amount { color: #f5e6c8; }
html[data-theme="adult"] .mm-stat:hover,
html[data-theme="adult"] .mm-stat-link:hover .mm-stat {
    border-color: rgba(245, 196, 81, .55) !important;
    box-shadow: 0 10px 34px rgba(224, 150, 47, .35) !important;
}
/* Chữ phụ + tiêu đề nhóm */
html[data-theme="adult"] .mm-stat__label,
html[data-theme="adult"] .mm-page-head .mm-sub,
html[data-theme="adult"] .text-muted { color: var(--mm-muted) !important; }
html[data-theme="adult"] .mm-stat__value { color: #f5e6c8; }
html[data-theme="adult"] .mm-group-title { color: #f0dcb4; }
html[data-theme="adult"] .mm-group-title i { color: var(--mm-accent); }
html[data-theme="adult"] .text-primary { color: var(--mm-accent) !important; }
/* Icon thống kê: dịu lại trên nền tối, ngả vàng kim */
html[data-theme="adult"] .mm-stat--indigo .mm-stat__icon,
html[data-theme="adult"] .mm-stat--amber  .mm-stat__icon { background: rgba(245, 196, 81, .16); color: #f5c451; }
html[data-theme="adult"] .mm-stat--violet .mm-stat__icon { background: rgba(200, 155, 255, .16); color: #c89bff; }
html[data-theme="adult"] .mm-stat--green  .mm-stat__icon { background: rgba(107, 191, 89, .16); color: #8fd97e; }
html[data-theme="adult"] .mm-stat--green  .mm-stat__value { color: #8fd97e; }
html[data-theme="adult"] .mm-stat--red    .mm-stat__icon { background: rgba(224, 83, 61, .18); color: #f08a78; }
html[data-theme="adult"] .mm-stat--red    .mm-stat__value { color: #f08a78; }
html[data-theme="adult"] .mm-stat--sky    .mm-stat__icon { background: rgba(217, 164, 65, .16); color: #e8c477; }
html[data-theme="adult"] .mm-stat--slate  .mm-stat__icon { background: rgba(255, 255, 255, .08); color: #d8c5a3; }
/* Topbar + sidebar + thanh điều hướng */
html[data-theme="adult"] .mm-topbar { background: rgba(18, 11, 5, .40) !important; }
/* Nền hiện rõ hơn -> thêm bóng chữ nhẹ cho số liệu/tiêu đề dễ đọc */
html[data-theme="adult"] .mm-stat__value,
html[data-theme="adult"] .mm-stat__label,
html[data-theme="adult"] .mm-group-title,
html[data-theme="adult"] .mm-page-head h2,
html[data-theme="adult"] .card h5,
html[data-theme="adult"] .card .h5,
html[data-theme="adult"] .mm-bill,
html[data-theme="adult"] .mm-chart-card h5 { text-shadow: 0 1px 6px rgba(0, 0, 0, .9), 0 0 3px rgba(0, 0, 0, .75); }
html[data-theme="adult"] .mm-topbar__brand { color: #f7ecd6; }
html[data-theme="adult"] .mm-sidebar {
    background: linear-gradient(185deg, rgba(46, 28, 12, .82) 0%, rgba(18, 10, 4, .9) 100%);
    border-right-color: rgba(245, 196, 81, .16);
}
html[data-theme="adult"] .mm-nav-link.active {
    background: linear-gradient(135deg, rgba(224, 150, 47, .95), rgba(245, 196, 81, .92));
    color: #2a1804; box-shadow: 0 6px 16px rgba(224, 150, 47, .4);
}
html[data-theme="adult"] .mm-nav-link.active i { color: #2a1804; }
/* Burger + pill user trên topbar */
html[data-theme="adult"] .mm-burger {
    background: rgba(40, 24, 12, .5); border-color: rgba(245, 196, 81, .3); color: #f3e7d4;
}
html[data-theme="adult"] .mm-userbox {
    background: rgba(40, 24, 12, .5); border-color: rgba(245, 196, 81, .3); color: #f3e7d4;
}
html[data-theme="adult"] .mm-userbox:hover { background: rgba(224, 150, 47, .25); color: #fff; }
html[data-theme="adult"] .mm-avatar { background: linear-gradient(135deg, var(--mm-primary), var(--mm-accent)); color: #2a1804; }
/* Dropdown menu tối */
html[data-theme="adult"] .dropdown-menu {
    background: rgba(26, 16, 8, .96); border-color: rgba(245, 196, 81, .25);
}
html[data-theme="adult"] .dropdown-item { color: #f0e2cb; }
html[data-theme="adult"] .dropdown-item:hover,
html[data-theme="adult"] .dropdown-item:focus { background: rgba(245, 196, 81, .14); color: #fff; }
html[data-theme="adult"] .dropdown-header { color: #c2ad8c; }
html[data-theme="adult"] .dropdown-divider { border-top-color: rgba(245, 196, 81, .2); }
/* Bảng số liệu trên nền tối */
html[data-theme="adult"] .table { color: var(--mm-ink); --bs-table-bg: transparent; --bs-table-color: var(--mm-ink); --bs-table-hover-bg: rgba(245, 196, 81, .08); --bs-table-hover-color: #fff; }
html[data-theme="adult"] .table > thead th,
html[data-theme="adult"] .table > thead.table-light th,
html[data-theme="adult"] .table tfoot td { background: rgba(40, 24, 12, .55) !important; color: #f0dcb4 !important; border-color: rgba(245, 196, 81, .18); }
html[data-theme="adult"] .table td,
html[data-theme="adult"] .table th { border-color: rgba(245, 196, 81, .14); }
html[data-theme="adult"] .mm-rank.is-me { background: rgba(245, 196, 81, .14); }
/* Form trên nền tối */
html[data-theme="adult"] .form-control,
html[data-theme="adult"] .form-select { background-color: rgba(40, 24, 12, .5); border-color: rgba(245, 196, 81, .28); color: var(--mm-ink); }
html[data-theme="adult"] .form-control:focus,
html[data-theme="adult"] .form-select:focus { background-color: rgba(40, 24, 12, .72); border-color: var(--mm-accent); box-shadow: 0 0 0 .2rem rgba(224, 150, 47, .22); color: #fff; }
html[data-theme="adult"] .form-control::placeholder { color: #a08a68; }
/* TomSelect (ô "Thêm thành viên"): mặc định là theme sáng -> chữ tối chìm trên
   nền tối. Cho khớp .form-control tối + dropdown tối, chữ kem dễ đọc. */
html[data-theme="adult"] .ts-wrapper.single .ts-control,
html[data-theme="adult"] .ts-control {
    background-color: rgba(40, 24, 12, .5); border-color: rgba(245, 196, 81, .28); color: var(--mm-ink);
}
html[data-theme="adult"] .ts-wrapper.focus .ts-control { border-color: var(--mm-accent); box-shadow: 0 0 0 .2rem rgba(224, 150, 47, .22); }
html[data-theme="adult"] .ts-control .item,
html[data-theme="adult"] .ts-control > input,
html[data-theme="adult"] .ts-control > input::placeholder { color: var(--mm-ink); }
html[data-theme="adult"] .ts-control > input::placeholder { color: #a08a68; }
html[data-theme="adult"] .ts-dropdown {
    background: rgba(26, 16, 8, .98); border-color: rgba(245, 196, 81, .25); color: var(--mm-ink);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .5);
}
html[data-theme="adult"] .ts-dropdown .option { color: #f0e2cb; }
html[data-theme="adult"] .ts-dropdown .option.active,
html[data-theme="adult"] .ts-dropdown .active { background: rgba(245, 196, 81, .16); color: #fff; }
html[data-theme="adult"] .ts-dropdown .optgroup-header { background: transparent; color: #c2ad8c; }
html[data-theme="adult"] .ts-dropdown .no-results { color: #c2ad8c; }
/* Nút primary: gradient bia → vàng kim */
html[data-theme="adult"] .btn-primary { background-color: var(--mm-primary-dark) !important; border-color: var(--mm-primary) !important; color: #2a1804 !important; }
html[data-theme="adult"] .btn-primary:hover,
html[data-theme="adult"] .btn-primary:focus { background-color: var(--mm-primary) !important; box-shadow: 0 0 0 .2rem rgba(224, 150, 47, .3) !important; }

/* Nút Duyệt (success) / Từ chối (danger): bớt chói, thêm chiều sâu (gradient + bóng)
   cho hợp tông đêm 18+ thay vì khối màu phẳng sáng. */
html[data-theme="adult"] .btn-success {
    background: linear-gradient(135deg, #6bbf59, #4f9a44) !important;
    border-color: rgba(143, 217, 126, .55) !important;
    color: #08210a !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35) !important;
}
html[data-theme="adult"] .btn-success:hover,
html[data-theme="adult"] .btn-success:focus {
    background: linear-gradient(135deg, #7bcf68, #59a84d) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4), 0 0 0 .2rem rgba(107, 191, 89, .3) !important;
}
html[data-theme="adult"] .btn-danger {
    background: linear-gradient(135deg, #e0533d, #b53b2b) !important;
    border-color: rgba(240, 138, 120, .5) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35) !important;
}
html[data-theme="adult"] .btn-danger:hover,
html[data-theme="adult"] .btn-danger:focus {
    background: linear-gradient(135deg, #ec6650, #c44432) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4), 0 0 0 .2rem rgba(224, 83, 61, .3) !important;
}
html[data-theme="adult"] .mm-legend-btn,
html[data-theme="adult"] .mm-pager__btn { border-color: rgba(245, 196, 81, .26); color: #f5e6c8; }
html[data-theme="adult"] .mm-legend-btn.is-active { background: rgba(245, 196, 81, .14); border-color: var(--mm-accent); }
/* Theme tối / kính: nền nút trong suốt theo thẻ. */
html[data-theme="adult"] .mm-pagination .page-link {
    background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .38); color: #f5e6c8;
}
html[data-theme="adult"] .mm-pagination .page-item.disabled .page-link { background: rgba(255, 255, 255, .06); }
html[data-theme="adult"] .mm-pagination .page-item.active .page-link { background: var(--mm-primary); color: #fff; }
/* =====================================================================
   Theme "18+" — vá nốt các thành phần nền sáng còn sót (badge subtle, ô upload).
   ===================================================================== */
html[data-theme="adult"] .bg-primary-subtle { background-color: rgba(245, 196, 81, .18) !important; }
html[data-theme="adult"] .bg-secondary-subtle { background-color: rgba(255, 255, 255, .10) !important; }
html[data-theme="adult"] .bg-success-subtle { background-color: rgba(107, 191, 89, .18) !important; }
html[data-theme="adult"] .bg-danger-subtle { background-color: rgba(224, 83, 61, .18) !important; }
html[data-theme="adult"] .bg-warning-subtle { background-color: rgba(240, 168, 48, .18) !important; }
html[data-theme="adult"] .bg-info-subtle { background-color: rgba(217, 164, 65, .18) !important; }
html[data-theme="adult"] .text-primary-emphasis { color: var(--mm-accent) !important; }
html[data-theme="adult"] .text-secondary-emphasis { color: #d8c5a3 !important; }
html[data-theme="adult"] .text-success-emphasis { color: #8fd97e !important; }
html[data-theme="adult"] .text-danger-emphasis { color: #f08a78 !important; }
html[data-theme="adult"] .badge.bg-primary-subtle.text-primary { color: var(--mm-accent) !important; }
/* Ô upload ảnh chuyển khoản */
html[data-theme="adult"] .mm-upload { background: rgba(40, 24, 12, .42); border-color: rgba(245, 196, 81, .35); }
html[data-theme="adult"] .mm-upload:hover { border-color: var(--mm-accent); background: rgba(245, 196, 81, .12); }
html[data-theme="adult"] .mm-upload.has-file { border-color: var(--mm-success); background: rgba(107, 191, 89, .12); }
html[data-theme="adult"] .mm-upload__icon { color: var(--mm-accent); }
html[data-theme="adult"] .mm-upload.has-file .mm-upload__icon { color: var(--mm-success); }
html[data-theme="adult"] .mm-upload__title { color: var(--mm-ink); }
html[data-theme="adult"] .mm-upload__hint { color: var(--mm-muted); }
/* Alert (vd "Mở lại các khoản..." nền trắng) -> tông tối */
html[data-theme="adult"] .alert-secondary { background: rgba(40, 24, 12, .55); border-color: rgba(245, 196, 81, .25); color: #e9d9b8; }
html[data-theme="adult"] .alert-warning { background: rgba(240, 168, 48, .15); border-color: rgba(240, 168, 48, .4); color: #f0c87a; }
html[data-theme="adult"] .alert-info { background: rgba(217, 164, 65, .14); border-color: rgba(217, 164, 65, .35); color: #e8c477; }
html[data-theme="adult"] .alert-success { background: rgba(107, 191, 89, .15); border-color: rgba(107, 191, 89, .4); color: #a7e09a; }
html[data-theme="adult"] .alert-danger { background: rgba(224, 83, 61, .15); border-color: rgba(224, 83, 61, .4); color: #f3a596; }
html[data-theme="adult"] .alert strong { color: inherit; }
/* Badge xám (vd "Bạn") -> viên vàng kim trong mờ */
html[data-theme="adult"] .badge.bg-secondary { background-color: rgba(245, 196, 81, .18) !important; color: var(--mm-accent) !important; }
/* Card "người tham gia" + dòng kẻ bảng: viền vàng kim thay vì trắng */
html[data-theme="adult"] table.mm-table > tbody > tr { border-color: rgba(245, 196, 81, .26) !important; }
html[data-theme="adult"] table.mm-table > tbody > tr > td { border-bottom-color: rgba(245, 196, 81, .14) !important; }
html[data-theme="adult"] table.mm-participants td.mm-cell-amount { color: var(--mm-accent) !important; }
/* THỦ PHẠM "đục": card mm-participants / mm-report có nền trắng .35 -> nền tối trong mờ */
html[data-theme="adult"] table.mm-participants > tbody > tr,
html[data-theme="adult"] table.mm-report > tbody > tr { background: rgba(30, 18, 9, .30) !important; }
/* Bảng dùng .table-light (thead hoặc hàng) */
html[data-theme="adult"] .table-light { --bs-table-bg: rgba(40, 24, 12, .55); --bs-table-color: #f0dcb4; }
/* Modal (báo cáo / xác nhận trong trang bill) */
html[data-theme="adult"] .modal-content { background: #18100a; border: 1px solid rgba(245, 196, 81, .25); color: var(--mm-ink); }
html[data-theme="adult"] .modal-header,
html[data-theme="adult"] .modal-footer { border-color: rgba(245, 196, 81, .18); }
html[data-theme="adult"] .modal-title { color: #f7ecd6; }
html[data-theme="adult"] .btn-close { filter: invert(1) brightness(1.6) opacity(.85); }
/* List group (chi tiết người tham gia/khoản) */
html[data-theme="adult"] .list-group-item { background: rgba(40, 24, 12, .4); border-color: rgba(245, 196, 81, .18); color: var(--mm-ink); }
/* Thanh tiến trình (báo cáo) */
html[data-theme="adult"] .mm-progress,
html[data-theme="adult"] .progress { background-color: rgba(255, 255, 255, .12); }
/* Tab lọc (nav-pills) */
html[data-theme="adult"] .nav-pills .nav-link { color: var(--mm-muted-2); }
html[data-theme="adult"] .nav-pills .nav-link:hover { color: var(--mm-ink); background: rgba(245, 196, 81, .1); }
html[data-theme="adult"] .nav-pills .nav-link.active { background: var(--mm-primary-dark); color: #2a1804; }
/* Badge: chữ sáng lại cho hợp nền tối (kể cả .text-dark, .bg-dark) */
html[data-theme="adult"] .badge.bg-success { color: #a7e09a !important; }
html[data-theme="adult"] .badge.bg-danger { color: #f3a596 !important; }
html[data-theme="adult"] .badge.bg-warning { color: #f0c87a !important; }
html[data-theme="adult"] .badge.bg-info { color: #e8c477 !important; }
html[data-theme="adult"] .badge.bg-primary { color: var(--mm-accent) !important; }
html[data-theme="adult"] .badge.bg-dark { background-color: rgba(255, 255, 255, .12) !important; color: #e9d9b8 !important; }
html[data-theme="adult"] .badge.text-dark { color: #f0c87a !important; }
/* bg-white tổng quát (vd trang welcome) */
html[data-theme="adult"] .bg-white { background-color: rgba(40, 24, 12, .5) !important; }
/* Theme tối: nền hộp đặc + blur cho dễ đọc */
html[data-theme="adult"] .mm-confirm__dialog {
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}
html[data-theme="adult"] .mm-confirm__dialog {
    background: rgba(28, 18, 10, .92);
    border-color: rgba(245, 196, 81, .28);
}
html[data-theme="adult"] .mm-confirm__icon { background: rgba(245, 196, 81, .16); color: #f5c451; }

/* Vòng quay may mắn — tông 18+ (đen + hổ phách + vàng kim). Chỉ đổi MÀU. */
html[data-theme="adult"] {
    --mm-wheel-panel:   #14100a;
    --mm-wheel-panel-2: #241a0d;
    --mm-wheel-gold:    #f5c451;
    --mm-wheel-lit:     #ffe08a;
    --mm-wheel-win:     #e0962f;
    --mm-wheel-border:  rgba(245,196,81,.18);

    /* Chip xu = nền tối + viền/sao vàng kim sáng (kiểu ô jackpot, hợp topbar tối). */
    --mm-coin-chip-bg:     linear-gradient(135deg, #2c2410, #1c1707);
    --mm-coin-chip-border: #f5c451;
    --mm-coin-chip-text:   #f5c451;
    --mm-coin-chip-star:   #ffd766;
    --mm-coin-chip-glow:   rgba(245,196,81,.5);
}
