/* ============================================================
   Beauty Manager — Layout & Components v1.1
   Sidebar: wine gradient | Buttons: coral→magenta gradient
   ============================================================ */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: "Segoe UI", "Roboto", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    background: var(--color-bg-page);
    color: var(--color-text-primary);
}

/* ─── AUTH PAGES (Login split-screen) ─── */
/* ════════════════════════════════════════════════════════════════════════════
   LOGIN — Full screen split layout · Responsive (mobile/tablet/laptop/desktop)
   Hero hồng-be · Form trắng · Dropdown ngôn ngữ refined
   ════════════════════════════════════════════════════════════════════════════ */

body.auth-page {
    background: var(--color-bg-page);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}
body.auth-page main { min-height: 100vh; display: flex; }

.auth-fullscreen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: var(--color-bg-page);
}

.auth-card {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    min-height: 100vh;
    background: white;
}

/* ── HERO (left) ────────────────────────────────────────────────────────── */
.auth-card-hero {
    background: linear-gradient(135deg, #FFE4EC 0%, #FFC4D6 45%, #FF8FAB 100%);
    padding: 3rem 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    color: var(--brand-wine);
    overflow: hidden;
}
.auth-hero-decor {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.auth-hero-decor.decor-1 {
    top: -60px; right: -60px;
    width: 280px; height: 280px;
    background: rgba(255,255,255,0.30);
}
.auth-hero-decor.decor-2 {
    bottom: -80px; left: -80px;
    width: 320px; height: 320px;
    background: rgba(194,24,91,0.12);
}
.auth-card-hero > *:not(.auth-hero-decor) { position: relative; z-index: 1; }

/* Brand */
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand-mark {
    width: 44px; height: 44px;
    background: white;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(194,24,91,0.18);
    position: relative;
    overflow: hidden;
}
.auth-brand-mark img {
    width: 32px; height: 32px; object-fit: contain;
    position: relative; z-index: 2;
}
.auth-brand-fallback {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--brand-magenta); font-weight: 500; font-size: 22px;
    z-index: 1;
}
.auth-brand-name { font-size: 18px; font-weight: 500; color: var(--brand-wine); }
.auth-brand-sub  { font-size: 11px; color: var(--brand-wine-light); opacity: 0.7; }

/* Hero body */
.auth-hero-body { margin: 2rem 0; }
.auth-hero-title {
    color: var(--brand-wine);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.25;
    margin: 0 0 .75rem;
    max-width: 480px;
}
.auth-hero-subtitle {
    color: var(--brand-wine-light);
    font-size: 14px;
    line-height: 1.65;
    margin: 0 0 1.75rem;
    max-width: 460px;
}
.auth-hero-features {
    list-style: none;
    padding: 0; margin: 0;
    display: grid;
    gap: .65rem;
}
.auth-hero-features li {
    display: flex; align-items: center; gap: 12px;
    font-size: 14px;
    color: var(--brand-wine);
    line-height: 1.4;
}
.auth-hero-features li i {
    color: var(--brand-magenta);
    font-size: 18px;
    width: 24px;
    flex-shrink: 0;
}

/* Hero bottom */
.auth-hero-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}
.auth-stats { display: flex; gap: 28px; }
.auth-stats .stat-num   { font-size: 24px; font-weight: 500; color: var(--brand-wine); line-height: 1; }
.auth-stats .stat-label { font-size: 11px; color: var(--brand-wine-light); margin-top: 4px; opacity: 0.8; }
.auth-copyright         { font-size: 11px; color: var(--brand-wine-light); opacity: 0.65; }
.auth-hotline           {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--brand-wine);
    margin-bottom: 4px;
}
.auth-hotline i         { font-size: 14px; color: var(--brand-magenta); flex-shrink: 0; }
.auth-hotline a         { color: var(--brand-wine); font-weight: 600; text-decoration: none; }
.auth-hotline a:hover   { text-decoration: underline; }

/* ── FORM (right) ───────────────────────────────────────────────────────── */
.auth-card-form {
    background: white;
    padding: 2.5rem 3rem;
    display: flex; flex-direction: column;
    position: relative;
    min-height: 100vh;
}
.auth-form-inner {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
}
.auth-form-title    { font-size: 24px; font-weight: 500; margin: 0 0 6px; color: var(--brand-wine); }
.auth-form-subtitle { font-size: 13px; color: var(--color-text-secondary); margin: 0 0 1.75rem; line-height: 1.5; }

/* Form fields */
.auth-field { margin-bottom: 16px; }
.auth-label {
    display: block;
    font-size: 12px; font-weight: 500;
    color: var(--brand-wine-light);
    margin-bottom: 6px;
}
.auth-input-wrap { position: relative; }
.auth-input-wrap > i {
    position: absolute;
    left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--brand-coral);
    font-size: 16px;
    pointer-events: none;
}
.auth-input {
    width: 100%;
    height: 44px;
    padding: 0 12px 0 38px;
    border: 1px solid var(--color-border-soft);
    border-radius: 10px;
    background: white;
    font-size: 14px;
    color: var(--brand-wine);
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.auth-input:focus {
    outline: none;
    border-color: var(--brand-magenta);
    box-shadow: 0 0 0 3px rgba(194,24,91,0.12);
}
.auth-input::placeholder { color: var(--color-text-muted); }
.auth-input-action {
    position: absolute;
    right: 6px; top: 50%; transform: translateY(-50%);
    background: transparent;
    border: 0;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--color-text-secondary);
    border-radius: 6px;
    line-height: 1;
}
.auth-input-action:hover { background: var(--color-bg-card-tint); color: var(--brand-magenta); }

/* Remember + Forgot row */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 20px;
    font-size: 13px;
    gap: 12px;
    flex-wrap: wrap;
}
.auth-check { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-wine); cursor: pointer; }
.auth-check input { accent-color: var(--brand-magenta); width: 16px; height: 16px; cursor: pointer; }
.auth-forgot { color: var(--brand-magenta); text-decoration: none; font-weight: 500; }
.auth-forgot:hover { text-decoration: underline; }

/* Submit */
.auth-btn-submit {
    width: 100%;
    height: 46px;
    background: var(--brand-gradient);
    color: white;
    border: 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(194,24,91,0.25);
    transition: transform .12s, box-shadow .12s, opacity .15s;
}
.auth-btn-submit:hover  { box-shadow: 0 6px 20px rgba(194,24,91,0.35); }
.auth-btn-submit:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(194,24,91,0.25); }
.auth-btn-submit i      { font-size: 18px; }

/* ── Language dropdown (refined) ────────────────────────────────────────── */
.auth-lang-switch {
    position: absolute;
    top: 1.5rem; right: 1.75rem;
    z-index: 5;
}
.auth-lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 0.5px solid var(--color-border-soft);
    padding: 7px 12px 7px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--brand-wine-light);
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(194,24,91,0.06);
    transition: border-color .15s, background .15s, box-shadow .15s;
    font-family: inherit;
}
.auth-lang-trigger:hover {
    border-color: var(--brand-magenta);
    background: var(--color-bg-card-tint);
}
.auth-lang-switch.open .auth-lang-trigger {
    border-color: var(--brand-magenta);
    background: var(--color-bg-card-tint);
}
.auth-lang-flag {
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.auth-lang-chev {
    font-size: 14px;
    color: var(--brand-magenta);
    opacity: 0.7;
    transition: transform .2s;
}
.auth-lang-switch.open .auth-lang-chev { transform: rotate(180deg); }

.auth-lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border: 0.5px solid var(--color-border-soft);
    border-radius: 12px;
    min-width: 220px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(74,24,37,0.12), 0 2px 6px rgba(74,24,37,0.06);
    display: none;
    z-index: 20;
}
.auth-lang-switch.open .auth-lang-menu { display: block; animation: lang-fade-in .12s ease-out; }

@keyframes lang-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-lang-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--brand-wine);
    text-decoration: none;
    cursor: pointer;
    transition: background .12s;
}
.auth-lang-opt:hover { background: var(--color-bg-card-tint); }
.auth-lang-opt.active {
    background: var(--color-bg-card-accent);
    color: var(--brand-magenta);
    font-weight: 500;
}
.auth-lang-opt-name { flex: 1; }
.auth-lang-opt-meta {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.auth-lang-check { color: var(--brand-magenta); font-size: 16px; }

/* ── RESPONSIVE BREAKPOINTS ─────────────────────────────────────────────── */

/* LAPTOP nhỏ < 1280px: thu hẹp padding để không bị tràn */
@media (max-width: 1280px) {
    .auth-card-hero { padding: 2.5rem 2rem 2rem; }
    .auth-card-form { padding: 2rem 2rem; }
    .auth-hero-title { font-size: 26px; }
}

/* TABLET landscape ≤ 1024px: vẫn split nhưng compact */
@media (max-width: 1024px) {
    .auth-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .auth-card-hero { padding: 2rem 1.75rem; }
    .auth-card-form { padding: 1.75rem 1.5rem; }
    .auth-hero-title { font-size: 22px; }
    .auth-hero-subtitle { font-size: 13px; margin-bottom: 1.25rem; }
    .auth-hero-features li { font-size: 13px; }
    .auth-stats { gap: 20px; }
    .auth-stats .stat-num { font-size: 20px; }
}

/* TABLET portrait + MOBILE ≤ 768px: stack hero on top of form */
@media (max-width: 768px) {
    body.auth-page { overflow-y: auto; }
    .auth-fullscreen { min-height: 100vh; height: auto; }
    .auth-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        min-height: 100vh;
    }
    .auth-card-hero {
        padding: 2rem 1.5rem 2.5rem;
        min-height: auto;
    }
    .auth-hero-body { margin: 1.5rem 0; }
    .auth-hero-features { grid-template-columns: 1fr 1fr; gap: .5rem .75rem; }
    .auth-hero-features li { font-size: 12.5px; }
    .auth-hero-features li i { font-size: 16px; width: 20px; }
    .auth-hero-bottom { margin-top: 1.5rem; }
    .auth-stats .stat-num { font-size: 20px; }
    .auth-copyright { display: none; }

    .auth-card-form {
        padding: 2rem 1.5rem 2.5rem;
        min-height: auto;
    }
    .auth-form-inner { padding: 0; max-width: 100%; }
    .auth-lang-switch { top: 1rem; right: 1rem; }

    .auth-hero-decor.decor-1 { width: 180px; height: 180px; top: -40px; right: -40px; }
    .auth-hero-decor.decor-2 { width: 200px; height: 200px; bottom: -60px; left: -60px; }
}

/* MOBILE nhỏ ≤ 480px: phóng tap target, dồn features 1 cột */
@media (max-width: 480px) {
    .auth-card-hero { padding: 1.5rem 1.25rem 2rem; }
    .auth-card-form { padding: 1.5rem 1.25rem 2.5rem; }
    .auth-hero-title { font-size: 20px; line-height: 1.3; }
    .auth-hero-subtitle { font-size: 13px; }
    .auth-hero-features { grid-template-columns: 1fr; }
    .auth-form-title { font-size: 22px; }
    .auth-form-subtitle { font-size: 13px; }

    .auth-input { height: 48px; font-size: 16px; }       /* 16px tránh iOS zoom khi focus */
    .auth-btn-submit { height: 50px; font-size: 15px; }
    .auth-lang-menu { min-width: 200px; }

    .auth-lang-switch { top: .75rem; right: .75rem; }
    .auth-lang-trigger { padding: 6px 10px 6px 8px; font-size: 12px; }
    .auth-lang-trigger .auth-lang-name { display: none; }   /* chỉ show flag + chevron, tiết kiệm chỗ */
}

/* SHORT viewport (landscape phone): không full-height, scroll OK */
@media (max-height: 640px) and (max-width: 1024px) {
    .auth-fullscreen { min-height: auto; }
    .auth-card { min-height: auto; }
    .auth-card-hero, .auth-card-form { min-height: auto; }
}


.bm-brand-mark {
    display: inline-flex;
    width: 44px; height: 44px;
    background: white;
    border-radius: 12px;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(198,40,98,0.18);
    font-family: serif;
    font-weight: 700;
    font-size: 22px;
    background-image: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.bm-brand-mark.big { width: 60px; height: 60px; font-size: 30px; }

/* Input with leading icon */
.input-wrap { position: relative; }
.input-wrap > i {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--brand-coral); font-size: 16px;
    pointer-events: none;
}
.input-wrap > input.form-control { padding-left: 36px; }

/* ─── APP LAYOUT ─── */
.bm-app { display: flex; min-height: 100vh; }

.bm-sidebar {
    width: var(--sidebar-width);
    background: var(--brand-gradient-wine);
    color: white;
    flex-shrink: 0;
    position: sticky; top: 0;
    height: 100vh; overflow-y: auto;
    box-shadow: 2px 0 12px rgba(74,24,37,0.08);

    /* Scrollbar mặc định ẩn hoàn toàn (Firefox + Chromium) */
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge legacy */
}
.bm-sidebar::-webkit-scrollbar {
    width: 0;                       /* Chrome/Safari/Edge - mặc định ẩn */
    background: transparent;
}

/* Khi hover vào sidebar → scrollbar hiện ra mờ */
.bm-sidebar:hover {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;  /* thumb mờ trên track trong suốt */
}
.bm-sidebar:hover::-webkit-scrollbar {
    width: 6px;                     /* thanh mỏng khi hiện */
}
.bm-sidebar:hover::-webkit-scrollbar-track {
    background: transparent;
}
.bm-sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.20);   /* mờ */
    border-radius: 3px;
    transition: background .2s;
}
.bm-sidebar:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.40);   /* đậm hơn khi hover trực tiếp thumb */
}
.bm-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.bm-brand .bm-brand-mark { width: 40px; height: 40px; font-size: 22px; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.bm-brand-name { color: white; font-weight: 500; line-height: 1.2; }
.bm-brand-name small { font-weight: 400; opacity: 0.7; font-size: 11px; display: block; }

.bm-nav { padding: 0.5rem 0; flex: 1; }
.bm-nav-section {
    padding: 12px 1rem 4px;
    font-size: 10px; text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}
.bm-nav ul { list-style: none; padding: 0; margin: 0; }
.bm-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px;
    color: rgba(255,255,255,0.78);
    text-decoration: none; font-size: 13px;
    transition: all .15s;
    margin: 2px 8px;
    border-radius: 8px;
}
.bm-nav-link i { font-size: 18px; width: 20px; text-align: center; }
.bm-nav-link:hover {
    color: white;
    background: rgba(255,143,171,0.10);
}
.bm-nav-link.active {
    color: white;
    background: rgba(255,143,171,0.22);
    box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.15);
}

.bm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.bm-topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 0.5px solid var(--color-bg-card-accent);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky; top: 0; z-index: 10;
}
.bm-topbar-actions { display: flex; align-items: center; gap: 14px; }

/* Topbar language pill */
.bm-lang-switch {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 16px;
    background: var(--color-bg-card-tint);
    border: 0.5px solid var(--color-border-soft);
    font-size: 12px; cursor: pointer;
    color: var(--brand-wine);
    position: relative;
}
.bm-lang-switch i.ti-world { color: var(--brand-magenta); font-size: 14px; }
.bm-lang-switch .dropdown-menu {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    background: white;
    border: 0.5px solid var(--color-border-soft);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(74,24,37,0.12);
    min-width: 140px; padding: 4px;
    display: none; z-index: 100;
}
.bm-lang-switch.open .dropdown-menu { display: block; }
.bm-lang-switch .dropdown-menu form { margin: 0; }
.bm-lang-switch .dropdown-menu button {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 8px 10px;
    background: none; border: none;
    font-size: 13px; cursor: pointer;
    border-radius: 6px; text-align: left;
    color: var(--brand-wine);
}
.bm-lang-switch .dropdown-menu button:hover { background: var(--color-bg-card-tint); }
.bm-lang-switch .dropdown-menu button.active { background: var(--color-bg-card-accent); font-weight: 500; }

/* Topbar notification badge */
.bm-notif-badge { position: relative; }
.bm-notif-badge > a { color: var(--brand-wine-light); padding: 4px 8px; display: inline-block; }
.bm-notif-badge .badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--color-danger); color: white;
    font-size: 10px; font-weight: 600;
    line-height: 1;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px;
    border: 2px solid var(--color-bg-page, #fff);
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
    z-index: 2;
}

/* Topbar user menu */
.bm-user-menu .btn {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--color-bg-card-tint);
    border: none;
    color: var(--brand-wine);
    font-size: 12px;
    cursor: pointer;
}
.bm-user-menu .user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--brand-gradient);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 500;
}
.bm-user-menu .user-info { line-height: 1.1; text-align: left; }
.bm-user-menu .user-info small { font-size: 10px; color: var(--color-text-muted); display: block; }

.bm-content { flex: 1; padding: 1.25rem; }
.bm-footer {
    background: white;
    border-top: 0.5px solid var(--color-bg-card-accent);
    padding: 0.6rem 1.25rem;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 12px;
}

/* ─── BREADCRUMB ─── */
.bm-breadcrumb {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-wrap: wrap; gap: 6px;
    font-size: 12px;
}
.bm-breadcrumb-item { display: flex; align-items: center; gap: 6px; color: var(--color-text-secondary); }
.bm-breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin-left: 6px;
    color: var(--color-text-muted);
}
.bm-breadcrumb-item a { color: var(--color-text-secondary); }
.bm-breadcrumb-item a:hover { color: var(--brand-magenta); }
.bm-breadcrumb-item.active { color: var(--brand-magenta); font-weight: 500; }
.bm-breadcrumb-item:first-child a i { font-size: 13px; }

/* Sub breadcrumb dưới page header (cho khi cần đặt riêng) */
.bm-page-breadcrumb { margin-bottom: 10px; }

/* ─── PAGE HEADER & CARDS ─── */
.bm-page-header { margin-bottom: 1rem; }
.bm-page-header h2 {
    margin: 0; font-size: 1.25rem; font-weight: 500;
    color: var(--brand-wine);
    display: flex; align-items: center; gap: 8px;
}
.bm-page-header h2 i { color: var(--brand-magenta); }
.bm-page-header .header-actions { display: flex; gap: 6px; align-items: center; }

.bm-card {
    background: var(--color-bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 0.5px solid var(--color-bg-card-accent);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.bm-card-mini {
    background: white;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    border: 0.5px solid var(--color-bg-card-accent);
}

/* ─── STAT TILES ─── */
.bm-stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 14px;
    border: 0.5px solid var(--color-bg-card-accent);
    position: relative;
    overflow: hidden;
}
.bm-stat-card::before {
    content: '';
    position: absolute; top: -10px; right: -10px;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--color-bg-card-accent);
    opacity: 0.6;
}
.bm-stat-card > * { position: relative; }
.bm-stat-icon { font-size: 18px; color: var(--brand-magenta); }

/* ── Variant: bm-stat-card khi dùng làm link (clickable navigate) ─────────── */
.bm-stat-link {
    display: block;     /* <a> mặc định là inline → phải override để chiếm full width col */
    text-decoration: none !important;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.bm-stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74,24,37,.10);
    border-color: var(--brand-magenta) !important;
}

/* Icon background variants (vòng tròn tô màu nhẹ phía sau icon) */
.bm-stat-icon.bg-primary-light { background: rgba(195, 70, 99, .12); }
.bm-stat-icon.bg-info-light    { background: rgba(13, 110, 253, .12); color: #0d6efd; }
.bm-stat-icon.bg-success-light { background: rgba(25, 135, 84, .12);  color: #198754; }
.bm-stat-icon.bg-warning-light { background: rgba(255, 159, 26, .15); color: #d97706; }
.bm-stat-icon.bg-danger-light  { background: rgba(220, 53, 69, .15);  color: #dc3545; }
.bm-stat-icon.bg-pink-light    { background: rgba(236, 72, 153, .15); color: #ec4899; }
.bm-stat-card .bm-stat-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 4px;
}
.bm-stat-label { font-size: 11px; color: var(--color-text-secondary); margin-top: 8px; }
.bm-stat-value { font-size: 22px; font-weight: 500; color: var(--brand-wine); }
.bm-stat-trend { font-size: 11px; }
.bm-stat-trend.up   { color: var(--color-success-dark); }
.bm-stat-trend.down { color: var(--color-danger-dark); }
.bm-stat-trend.warn { color: var(--color-warning-dark); }

/* ─── TABLE ─── */
.bm-table { font-size: 13px; }
.bm-table thead th {
    background: linear-gradient(180deg, var(--color-bg-card-tint), var(--color-bg-card-accent));
    color: var(--brand-wine-light);
    font-weight: 500;
    border-bottom: 0.5px solid var(--color-border-soft);
}
.bm-table tbody tr:hover {
    background: var(--color-bg-card-tint);
}
.bm-table tbody td { border-bottom: 0.5px solid var(--color-bg-card-accent); }

/* ─── FORM ─── */
.bm-form label.required::after {
    content: "*"; color: var(--color-danger); margin-left: 0.2em;
}
.bm-form-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    margin-top: 1.5rem; padding-top: 1rem;
    border-top: 0.5px solid var(--color-bg-card-accent);
}
.form-control, .form-select {
    border-radius: 8px !important;
    border: 0.5px solid var(--color-border-soft) !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-coral) !important;
    box-shadow: 0 0 0 0.2rem rgba(255,143,171,0.18) !important;
}

/* ─── AVATAR ─── */
.bm-avatar-sm {
    width: 36px; height: 36px;
    border-radius: 50%; object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.bm-avatar-detail {
    width: 110px; height: 110px;
    border-radius: 50%; object-fit: cover;
    box-shadow: 0 6px 20px rgba(194,24,91,0.25);
}
.bm-avatar-placeholder {
    display: inline-flex;
    width: 36px; height: 36px;
    background: var(--brand-gradient-soft);
    color: var(--brand-magenta);
    border-radius: 50%;
    align-items: center; justify-content: center;
    font-weight: 500;
}
.bm-avatar-placeholder.gradient {
    background: var(--brand-gradient);
    color: white;
}
.bm-avatar-placeholder.big   { width: 70px; height: 70px; font-size: 26px; }
.bm-avatar-placeholder.huge  { width: 110px; height: 110px; font-size: 40px; }
.bm-avatar-preview {
    width: 110px; height: 110px;
    object-fit: cover; border-radius: 50%;
    border: 3px solid var(--color-bg-card-accent);
}
.bm-thumb {
    width: 100%; aspect-ratio: 1;
    object-fit: cover; border-radius: 8px;
    border: 0.5px solid var(--color-bg-card-accent);
}

/* ─── PAGER ─── */
.bm-pager {
    padding: 12px;
    border-top: 0.5px solid var(--color-bg-card-accent);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px;
}
.bm-pager .page-link {
    color: var(--brand-wine-light);
    border-radius: 6px !important;
    border: 0.5px solid var(--color-border-soft);
    margin: 0 2px;
}
.bm-pager .page-item.active .page-link {
    background: var(--brand-gradient);
    border-color: transparent;
    color: white;
    font-weight: 500;
}

/* ─── LANGUAGE PICKER GRID (in profile) ─── */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 360px;
}
.lang-option {
    border: 0.5px solid var(--color-border-soft);
    background: white;
    border-radius: 12px;
    padding: 14px 12px;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
    position: relative;
}
.lang-option:hover { border-color: var(--brand-coral); }
.lang-option.selected {
    border: 1.5px solid var(--brand-magenta);
    background: var(--color-bg-card-tint);
}
.lang-option .flag { font-size: 24px; }
.lang-option .lang-name { font-size: 13px; font-weight: 500; color: var(--brand-wine); margin-top: 4px; }
.lang-option .lang-en   { font-size: 11px; color: var(--color-text-secondary); }
.lang-option input[type="radio"] { position: absolute; top: 8px; right: 8px; accent-color: var(--brand-magenta); }

/* ─── RESPONSIVE ─── */
@media (max-width: 992px) {
    .bm-sidebar {
        position: fixed; left: -100%; transition: left .3s; z-index: 100;
    }
    .bm-sidebar.show { left: 0; }
    .bm-content { padding: 0.75rem; }
    .auth-card { grid-template-columns: 1fr; min-height: auto; }
    .auth-card-hero { padding: 1.5rem; min-height: 200px; }
    .auth-card-hero h1 { font-size: 20px; margin: 0.5rem 0; }
    .auth-card-form { padding: 1.5rem; }
}
@media (max-width: 576px) {
    .bm-card { padding: 0.85rem; }
    .bm-page-header h2 { font-size: 1.05rem; }
}

@media print {
    .bm-sidebar, .bm-topbar, .bm-footer, .bm-form-actions, .btn { display: none !important; }
    .bm-main, .bm-content { padding: 0; }
    .bm-card { box-shadow: none; border: 0.5px solid #DDD; }
}

/* ─────── SPRINT 3: Notification, Timeline, Empty States, Avatar Placeholder ─────── */
.bm-notif-icon {
    font-size: 24px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-bg-soft, #FCE4EC);
    border-radius: 50%;
    flex-shrink: 0;
}
.bm-notif-unread {
    background: linear-gradient(90deg, rgba(255,143,171,0.06) 0%, transparent 60%);
    border-left: 3px solid var(--brand-coral, #FF8FAB);
}

/* Empty state placeholder */
.bm-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted, #6c757d);
}
.bm-empty-icon {
    font-size: 64px;
    opacity: 0.3;
    display: block;
    margin: 0 auto 1rem;
}

/* Avatar placeholder */
.bm-avatar-placeholder {
    background: linear-gradient(135deg, #FFE0E9, #F8BBD0);
    color: #C2185B;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.bm-avatar-placeholder i { font-size: 60%; }

/* Avatar sizes */
.bm-avatar-sm  { width: 36px;  height: 36px;  border-radius: 50%; object-fit: cover; }
.bm-avatar-lg  { width: 80px;  height: 80px;  border-radius: 50%; object-fit: cover; display:block; }
.bm-avatar-detail { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
.bm-avatar-preview { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; }
.bm-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }

/* Timeline (Lead activity log) */
.bm-timeline {
    position: relative;
    padding-left: 32px;
}
.bm-timeline::before {
    content: ""; position: absolute;
    left: 12px; top: 0; bottom: 0;
    width: 2px; background: #E0E0E0;
}
.bm-timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #F0F0F0;
}
.bm-timeline-item:last-child { border-bottom: 0; }
.bm-timeline-icon {
    position: absolute;
    left: -32px; top: 2px;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    background: white;
    border: 2px solid #FF8FAB;
    border-radius: 50%;
    color: #C2185B;
    font-size: 13px;
}
.bm-timeline-body { font-size: 14px; }

/* Required field marker (label.required → red asterisk) */
.form-label.required::after {
    content: " *";
    color: #E24B4A;
    font-weight: bold;
}

/* ── Warehouse sub-menu (Sprint 4) ─────────────────────────────────── */
.bm-nav-group { position: relative; }
.bm-nav-caret { font-size: 14px; transition: transform .2s; flex-shrink: 0; }
.bm-nav-group.open .bm-nav-caret { transform: rotate(180deg); }
.bm-nav-sub { list-style: none; padding: 0; margin: 0;
    max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.bm-nav-group.open .bm-nav-sub { max-height: 400px; }
.bm-nav-sub-link {
    display: flex; align-items: center; gap: .35rem;
    padding: .38rem .75rem .38rem 2.7rem;
    color: var(--color-text-secondary); font-size: .82rem;
    text-decoration: none; border-radius: 6px; margin: 1px 8px;
    transition: background .15s, color .15s;
}
.bm-nav-sub-link:hover { background: var(--color-primary-light); color: var(--color-primary); }
.bm-nav-sub-link.active { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }
.bm-nav-sub-link i { font-size: 15px; width: 16px; }

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Comprehensive breakpoints (Sprint v2.5)
   Breakpoints: Mobile <576px, Tablet 576-991px, Laptop 992-1199px, Desktop ≥1200px
   ════════════════════════════════════════════════════════════════════════════ */

/* Hamburger button — visible on tablet/mobile only */
.bm-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--bm-border, #e5e7eb);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    margin-right: 12px;
    color: inherit;
}
.bm-menu-btn:hover { background: rgba(0,0,0,.04); }
.bm-menu-btn i { font-size: 20px; }

/* Sidebar overlay for mobile/tablet — click outside to close */
.bm-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
}
.bm-sidebar-overlay.show { display: block; }

/* ═══ TABLET (768 — 991px) ═══════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .bm-menu-btn { display: inline-flex; align-items: center; }
    .bm-sidebar { box-shadow: 2px 0 16px rgba(0,0,0,.15); }
    .bm-topbar { padding: 0.6rem 0.85rem; }
    .bm-topbar-actions { gap: 8px; }
    .bm-content { padding: 1rem; }
    .bm-card { padding: 1rem; }
    .bm-page-header h2,
    .bm-page-header h4 { font-size: 1rem; }
    /* User info hide name on tablet, show only avatar */
    .bm-user-menu .user-info { display: none !important; }
    /* Reduce card grid columns */
    .row.g-3 > [class*="col-md-3"] { width: 50%; max-width: 50%; flex: 0 0 50%; }
    .row.g-3 > [class*="col-md-4"] { width: 50%; max-width: 50%; flex: 0 0 50%; }
}

/* ═══ MOBILE (≤575px) ════════════════════════════════════════════════════════ */
@media (max-width: 575.98px) {
    .bm-content { padding: 0.6rem; }
    .bm-card { padding: 0.75rem; border-radius: 8px; }
    .bm-card .card-header { padding: 0.5rem 0.75rem; font-size: .9rem; }
    .bm-card .card-body  { padding: 0.75rem; }
    .bm-page-header { flex-direction: column; align-items: flex-start !important; gap: 8px; }
    .bm-page-header h2, .bm-page-header h4 { font-size: .95rem; margin: 0; }
    .bm-page-header .btn { font-size: .8rem; padding: 0.3rem 0.6rem; }

    /* Topbar: compact, hide language switch text */
    .bm-topbar { padding: 0.5rem 0.6rem; }
    /* Ẩn chữ "VI"/"EN" trên pill (chỉ giữ icon + chevron), KHÔNG ảnh hưởng dropdown items bên trong */
    .bm-lang-switch > span:not(.material-symbols-outlined) { display: none; }
    .bm-lang-switch { padding: 5px 8px; }
    .bm-topbar-actions { gap: 4px; }

    /* All multi-column grids → single column on mobile */
    .row.g-3 > [class*="col-md"],
    .row.g-2 > [class*="col-md"],
    .row.g-3 > [class*="col-sm-6"] { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }

    /* Tables: smaller font + horizontal scroll always */
    .bm-table { font-size: .8rem; }
    .bm-table th, .bm-table td { padding: 6px 8px; white-space: nowrap; }
    .table-responsive { -webkit-overflow-scrolling: touch; }

    /* Buttons: better tap targets */
    .btn-sm { padding: 0.4rem 0.7rem; font-size: .85rem; }
    .btn-xs { padding: 0.3rem 0.5rem; font-size: .78rem; }

    /* Forms */
    .form-control, .form-select { font-size: 16px; } /* Prevent iOS zoom on focus */
    .form-control-sm, .form-select-sm { font-size: 14px; }
    .form-label { font-size: .82rem; margin-bottom: 0.2rem; }

    /* Modals / overlays full-width */
    .modal-dialog { margin: 0.5rem; max-width: calc(100vw - 1rem); }

    /* Hide breadcrumb on mobile to save space */
    .bm-breadcrumb { display: none; }

    /* Sidebar: full width on mobile */
    .bm-sidebar { width: 85vw !important; max-width: 320px; }

    /* Footer text smaller */
    .bm-footer { font-size: .72rem; padding: 0.5rem; text-align: center; }

    /* Dashboard KPI cards bigger tap targets */
    .card .fs-3, .card .fs-5 { font-size: 1.1rem !important; }
}

/* ═══ TINY MOBILE (≤375px — iPhone SE) ═══════════════════════════════════════ */
@media (max-width: 375.98px) {
    .bm-content { padding: 0.4rem; }
    .bm-card { padding: 0.6rem; }
    .bm-table { font-size: .75rem; }
    .bm-table th, .bm-table td { padding: 4px 6px; }
}

/* ═══ LANDSCAPE TABLET / LAPTOP (992 — 1199px) ══════════════════════════════ */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .bm-content { padding: 1rem; }
    .bm-card { padding: 1rem; }
}

/* ═══ TOUCH-FRIENDLY TAP TARGETS (any device with coarse pointer) ═══ */
@media (pointer: coarse) {
    .btn, .form-control, .form-select, .page-link, .dropdown-item {
        min-height: 38px;
    }
    .bm-nav-link, .bm-nav-sub a { padding: 10px 14px; }
}
