/* ============================================================
   NQM AGENCY — Master Style Sheet
   Dark + Light theme · SVG icons · Protection · Landing
   ============================================================ */

/* ============================================================
   1. VARIABLES
   ============================================================ */
   /* ============================================================
   REMOVE TAP HIGHLIGHT + FOCUS OUTLINE
   Fix ô vuông xanh dương khi nhấn trên mobile/desktop
   ============================================================ */

/* 1. Xóa tap highlight xanh dương trên mobile (iOS Safari, Android Chrome) */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
}

html, body {
    -webkit-tap-highlight-color: transparent !important;
}

a, button, input, textarea, select, label,
[role="button"], [onclick], [data-*] {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
    outline: none;
}

/* 2. Xóa focus outline xanh dương mặc định */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus,
:focus {
    outline: none !important;
    box-shadow: none;
}

/* Focus visible - dùng custom focus ring thay cho outline mặc định */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* 3. Xóa selection highlight xanh dương mặc định */
::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

::-moz-selection {
    background: var(--accent);
    color: var(--accent-ink);
}

/* 4. Fix autofill Chrome (nền vàng/xanh) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: var(--text) !important;
    -webkit-box-shadow: 0 0 0 30px var(--surface-2) inset !important;
    box-shadow: 0 0 0 30px var(--surface-2) inset !important;
    transition: background-color 5000s ease-in-out 0s !important;
    caret-color: var(--text);
}

/* 5. Tắt highlight khi tap trên iOS */
body {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Nhưng cho phép select text trong input/textarea/pre */
input, textarea, [contenteditable], pre, code {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 6. Tắt outline & shadow cho button/link mặc định */
button {
    outline: none;
    border: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

button:focus,
button:active {
    outline: none;
    box-shadow: none;
}

/* 7. Custom focus state - thay vì outline xanh */
.button:focus-visible,
.mod-btn:focus-visible,
.showcase-act:focus-visible,
.sidebar-link:focus-visible,
.icon-button:focus-visible,
.uid-copy:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* 8. Input focus - chỉ hiện border đổi màu, không outline */
input:focus,
textarea:focus,
select:focus {
    outline: none !important;
    box-shadow: none !important;
}
:root {
    --bg:           #0a0a0c;
    --surface:      #141416;
    --surface-2:    #1c1a1d;
    --surface-3:    #232126;

    --line:         rgba(255, 255, 255, .08);
    --line-strong:  rgba(255, 255, 255, .18);

    --text:         #f7f5f3;
    --muted:        #9c9598;
    --muted-2:      #716b6e;

    --accent:       #ffffff;
    --accent-ink:   #0a0a0c;

    --danger:       #ef4444;
    --danger-bg:    rgba(239, 68, 68, .13);
    --success:      #22c55e;
    --success-bg:   rgba(34, 197, 94, .13);
    --warning:      #f59e0b;
    --warning-bg:   rgba(245, 158, 11, .13);
    --info:         #3b82f6;
    --info-bg:      rgba(59, 130, 246, .13);

    --sans:         'Manrope', system-ui, -apple-system, sans-serif;
    --mono:         'DM Mono', 'Courier New', monospace;

    --radius-sm:    10px;
    --radius:       14px;
    --radius-lg:    20px;
    --radius-xl:    24px;
    --sidebar-w:    260px;
    --topbar-h:     66px;

    --shadow-sm:    0 2px 8px rgba(0, 0, 0, .25);
    --shadow:       0 12px 32px rgba(0, 0, 0, .35);
    --shadow-lg:    0 30px 80px rgba(0, 0, 0, .5);

    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg:           #f4f0ea;
    --surface:      #ffffff;
    --surface-2:    #f6f1ec;
    --surface-3:    #ede6df;

    --line:         rgba(20, 15, 12, .09);
    --line-strong:  rgba(20, 15, 12, .2);

    --text:         #171012;
    --muted:        #726a67;
    --muted-2:      #928a86;

    --accent:       #0a0a0c;
    --accent-ink:   #ffffff;

    --danger-bg:    rgba(239, 68, 68, .1);
    --success-bg:   rgba(34, 197, 94, .1);
    --warning-bg:   rgba(245, 158, 11, .1);
    --info-bg:      rgba(59, 130, 246, .1);

    color-scheme: light;
}


/* ============================================================
   2. RESET + BASE
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background .3s ease, color .3s ease;
}

a { color: inherit; text-decoration: none; }

button {
    font-family: inherit;
    cursor: pointer;
    border: 0;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
}

::selection { background: var(--accent); color: var(--accent-ink); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }


/* ============================================================
   3. ★ SVG ICON — BẮT BUỘC KẾ THỪA MÀU
   ============================================================ */
svg {
    color: inherit;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

svg.icon-svg,
.icon-svg {
    stroke: currentColor !important;
    fill: none !important;
    color: inherit;
}

svg.icon-svg *,
.icon-svg * {
    stroke: currentColor !important;
    fill: none !important;
}

/* Path fill="currentColor" cho icon có nền (dot, v.v.) */
svg.icon-svg [fill="currentColor"],
.icon-svg [fill="currentColor"] {
    fill: currentColor !important;
    stroke: none !important;
}

/* Icon trong các context */
.sidebar-ico svg,
.button svg,
.mod-btn svg,
.showcase-act svg,
.icon-button svg,
.user-menu svg,
.ai-fab svg,
.uid-copy svg,
.toast-icon svg,
.notice-icon svg,
.scroll-top-inner svg,
.notif-more svg,
.rail-arrows svg,
.service-icon svg,
.feature-icon-wrap svg,
.search-ico,
.store-search svg {
    color: inherit;
    stroke: currentColor;
}


/* ============================================================
   4. LOADING SCREEN
   ============================================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: grid;
    place-items: center;
    transition: opacity .5s ease, visibility .5s ease;
}

.loading-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ★ Ẩn loader ngay lập tức khi có attribute skip */
html[data-skip-loader="1"] .loading-screen,
html[data-skip-loader="1"] #loadingScreen {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
}

.loading-ring {
    position: relative;
    width: 130px;
    height: 130px;
}

.loading-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.loading-track {
    fill: none;
    stroke: var(--line);
    stroke-width: 2;
}

.loading-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 276.46;
    stroke-dashoffset: 276.46;
    transition: stroke-dashoffset .15s linear;
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent));
}

.loading-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.loading-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    animation: logo-pulse 1.5s ease-in-out infinite;
    transition: filter .3s ease;
}

@keyframes logo-pulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%      { transform: scale(1.08); opacity: .85; }
}

.loading-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.loading-brand {
    font: 800 13px var(--mono);
    letter-spacing: .22em;
    color: var(--text);
    text-transform: uppercase;
}

.loading-percent {
    font: 700 11px var(--mono);
    letter-spacing: .1em;
    color: var(--muted);
}


/* ============================================================
   5. METEOR SHOWER
   ============================================================ */
.meteor-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse 800px 500px at 20% -10%, rgba(255, 255, 255, .05), transparent 55%),
        radial-gradient(ellipse 700px 500px at 90% 10%, rgba(255, 255, 255, .035), transparent 50%);
}

:root[data-theme="light"] .meteor-layer {
    background:
        radial-gradient(ellipse 800px 500px at 20% -10%, rgba(0, 0, 0, .04), transparent 55%),
        radial-gradient(ellipse 700px 500px at 90% 10%, rgba(0, 0, 0, .03), transparent 50%);
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    opacity: .45;
    animation: twinkle infinite ease-in-out;
}

:root[data-theme="light"] .star { background: #000; opacity: .15; }

@keyframes twinkle {
    0%, 100% { opacity: .12; transform: scale(.7); }
    50%      { opacity: .85; transform: scale(1.15); }
}

.meteor {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, .85);
    opacity: 0;
    animation: meteorFall linear infinite;
}

.meteor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 140px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .85), transparent);
    transform: translateY(-50%) rotate(-35deg);
    transform-origin: left center;
}

:root[data-theme="light"] .meteor {
    background: #333;
    box-shadow: 0 0 6px 1px rgba(0, 0, 0, .25);
}
:root[data-theme="light"] .meteor::after {
    background: linear-gradient(90deg, rgba(0, 0, 0, .35), transparent);
}

@keyframes meteorFall {
    0%   { opacity: 0; transform: translate(0, 0); }
    8%   { opacity: 1; }
    70%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-620px, 480px); }
}


/* ============================================================
   6. LAYOUT
   ============================================================ */
.dash-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.dash-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.dash-sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}


/* ============================================================
   7. SIDEBAR
   ============================================================ */
.dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    z-index: 60;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 20px 14px 26px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform .3s cubic-bezier(.2, .8, .3, 1);
    color: var(--text);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.sidebar-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
}

.brand-word {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.brand-word span { color: var(--muted); opacity: .7; }

.sidebar-nav { display: flex; flex-direction: column; }

.sidebar-label {
    margin: 16px 10px 8px;
    font: 700 10px var(--mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.sidebar-nav > .sidebar-label:first-child { margin-top: 4px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 3px;
    transition: background .2s ease, color .2s ease, transform .15s ease;
}

.sidebar-link:hover {
    background: var(--surface-2);
    transform: translateX(2px);
}

.sidebar-link.is-active {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}

.sidebar-link.is-active .sidebar-ico,
.sidebar-link.is-active .sidebar-ico svg {
    color: var(--accent-ink);
    stroke: var(--accent-ink);
}

.sidebar-link-danger { color: var(--danger); }
.sidebar-link-danger:hover { background: var(--danger-bg); }

.sidebar-ico {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
}

.sidebar-ico svg {
    width: 18px !important;
    height: 18px !important;
    color: inherit;
    stroke: currentColor;
}


/* ============================================================
   8. MAIN + TOPBAR
   ============================================================ */
.dash-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
}

.dash-topbar-v2 {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 30;
    min-height: var(--topbar-h);
    color: var(--text);
}

.sidebar-toggle-btn {
    display: none;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    align-items: center;
    justify-content: center;
    transition: border-color .2s ease;
}

.sidebar-toggle-btn:hover { border-color: var(--line-strong); }

.crumb-chip {
    font: 700 10px var(--mono);
    letter-spacing: .12em;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 12px;
    text-transform: uppercase;
}

.topbar-title {
    font-size: 22px;
    letter-spacing: -.02em;
    flex: 1;
    min-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    color: var(--text);
}

.icon-button {
    position: relative;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s ease;
}

.icon-button:hover { border-color: var(--line-strong); }

.icon-button svg {
    width: 18px;
    height: 18px;
    color: inherit;
    stroke: currentColor;
}


/* ============================================================
   9. CHIP BUTTONS
   ============================================================ */
.balance-chip,
.notification-chip {
    height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 0 14px;
    color: var(--text);
    font-size: 11.5px;
    transition: border-color .2s ease;
}

.balance-chip:hover,
.notification-chip:hover {
    border-color: var(--line-strong);
}

.balance-chip svg,
.notification-chip svg {
    width: 15px;
    height: 15px;
    color: inherit;
    stroke: currentColor;
    opacity: .9;
}

.balance-chip b {
    font: 700 11.5px var(--mono);
    letter-spacing: .02em;
}

.notification-chip {
    position: relative;
    padding: 0 12px;
}

.notification-chip i {
    position: absolute;
    top: -5px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font: 700 9px var(--mono);
    display: grid;
    place-items: center;
    font-style: normal;
}


/* ============================================================
   10. DROPDOWNS
   ============================================================ */
.notif-wrap { position: relative; }

.notif-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-height: 440px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: .2s ease;
    z-index: 120;
    overflow: hidden;
    color: var(--text);
}

.notif-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-menu-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    flex-shrink: 0;
}

.notif-menu-head span { color: var(--muted); font-size: 11.5px; }

.notif-menu-body {
    overflow-y: auto;
    max-height: 320px;
}

.notif-item {
    display: flex;
    gap: 11px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    transition: background .15s ease;
}

.notif-item:hover { background: var(--surface-2); }

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    margin-top: 6px;
    flex-shrink: 0;
}

.notif-item.type-success .notif-dot { background: var(--success); }
.notif-item.type-danger  .notif-dot { background: var(--danger); }
.notif-item.type-info    .notif-dot { background: var(--text); }

.notif-item strong {
    font-size: 13px;
    display: block;
    margin-bottom: 2px;
}

.notif-item p {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 3px;
    line-height: 1.5;
}

.notif-item small { font: 10px var(--mono); color: var(--muted-2); }

.notif-empty {
    padding: 30px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.notif-more {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 12.5px;
    font-weight: 700;
    border-top: 1px solid var(--line);
    transition: background .15s ease;
    flex-shrink: 0;
    color: var(--text);
}

.notif-more:hover { background: var(--surface-2); }


/* ============================================================
   11. USER CHIP
   ============================================================ */
.user-chip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .2s ease;
    color: var(--text);
}

.user-chip:hover { border-color: var(--line-strong); }

.user-chip-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--surface-3);
}

.user-chip-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    font: 700 12px var(--sans);
}

.user-chip-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.user-chip-text strong {
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
    color: var(--text);
}

.user-chip-text span {
    font-size: 10.5px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 6px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: .2s ease;
    z-index: 120;
    color: var(--text);
}

.user-chip.is-open .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    transition: background .15s ease;
}

.user-menu a:hover { background: var(--surface-2); }

.user-menu a svg {
    width: 14px;
    height: 14px;
    color: inherit;
    stroke: currentColor;
    opacity: .85;
    flex-shrink: 0;
}

.user-menu a.danger { color: var(--danger); }

.user-menu-sep {
    height: 1px;
    background: var(--line);
    margin: 5px 4px;
}


/* ============================================================
   12. MAIN CONTENT
   ============================================================ */
.dash-main-content {
    padding: 26px 28px 120px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    color: var(--text);
}


/* ============================================================
   13. FLASH ALERTS
   ============================================================ */
.flash-alert {
    margin-bottom: 18px;
    font-size: 13px;
    border-radius: var(--radius);
    padding: 14px 18px;
    font-weight: 600;
    border: 1px solid;
    line-height: 1.5;
}

.flash-alert.alert-error {
    background: var(--danger-bg);
    color: #f87171;
    border-color: rgba(239, 68, 68, .3);
}

.flash-alert.alert-success {
    background: var(--success-bg);
    color: #4ade80;
    border-color: rgba(34, 197, 94, .3);
}

.flash-alert.alert-warning {
    background: var(--warning-bg);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, .3);
}

.flash-alert.alert-info {
    background: var(--info-bg);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, .3);
}

:root[data-theme="light"] .flash-alert.alert-error   { color: #a4121f; }
:root[data-theme="light"] .flash-alert.alert-success { color: #1a6a3a; }
:root[data-theme="light"] .flash-alert.alert-warning { color: #92610a; }
:root[data-theme="light"] .flash-alert.alert-info    { color: #1d4ed8; }


/* ============================================================
   14. MARQUEE
   ============================================================ */
.dashboard-marquee {
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    margin-bottom: 20px;
    padding: 13px 0;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 800;
}

.dashboard-marquee-track {
    display: flex;
    width: max-content;
    animation: dash-marquee 18s linear infinite;
}

.dashboard-marquee-track span { padding: 0 34px; display: block; }

@keyframes dash-marquee { to { transform: translateX(-50%); } }


/* ============================================================
   15. PAGE HEAD
   ============================================================ */
.page-head {
    margin-bottom: 24px;
}

.page-head h2 {
    font-size: clamp(26px, 3.6vw, 38px);
    line-height: 1.05;
    margin-bottom: 8px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-head h2 svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
    stroke: currentColor;
}

.page-head p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.page-head p svg {
    width: 12px;
    height: 12px;
    opacity: .7;
    stroke: currentColor;
}

.eyebrow {
    font: 700 10px var(--mono);
    letter-spacing: .14em;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 20px;
    padding: 8px 12px;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.eyebrow svg {
    width: 10px;
    height: 10px;
    color: inherit;
    stroke: currentColor;
}


/* ============================================================
   16. WELCOME BANNER
   ============================================================ */
.welcome-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 40px 46px;
    margin-bottom: 22px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line-strong);
    background: linear-gradient(135deg, var(--surface), var(--surface-2));
    position: relative;
    overflow: hidden;
    color: var(--text);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .06), transparent 65%);
    pointer-events: none;
}

:root[data-theme="light"] .welcome-banner::before {
    background: radial-gradient(circle, rgba(0, 0, 0, .05), transparent 65%);
}

.welcome-text { position: relative; z-index: 1; }

.welcome-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font: 700 11px var(--mono);
    letter-spacing: .16em;
    color: var(--muted);
    text-transform: uppercase;
}

.welcome-eyebrow::before {
    content: '';
    width: 28px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.welcome-banner h2 {
    font-size: clamp(28px, 4.2vw, 44px);
    line-height: 1.06;
    margin: 16px 0 12px;
    letter-spacing: -.03em;
    color: var(--text);
}

.welcome-banner p {
    margin: 0;
    max-width: 560px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}

.welcome-logo {
    width: clamp(88px, 12vw, 150px);
    height: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    object-fit: contain;
}


/* ============================================================
   17. UID BAR
   ============================================================ */
.uid-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px 16px;
    align-items: center;
    padding: 26px 30px;
    margin-bottom: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-strong);
    background: linear-gradient(135deg, var(--surface), var(--surface-2));
    color: var(--text);
}

.uid-bar-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.uid-bar-label {
    font: 700 11px var(--mono);
    letter-spacing: .14em;
    color: var(--muted);
    text-transform: uppercase;
}

.uid-bar-value {
    grid-column: 1 / -1;
    font: 800 clamp(38px, 5vw, 64px) var(--mono);
    letter-spacing: .14em;
    line-height: 1;
    color: var(--text);
    word-break: keep-all;
}

.uid-copy {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 11px 20px;
    font: 700 12px var(--sans);
    transition: .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.uid-copy:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

.uid-copy.is-done {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}


/* ============================================================
   18. STAT CARDS
   ============================================================ */
.stat-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card-v2 {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 18px;
    overflow: hidden;
    transition: transform .25s ease, border-color .25s ease;
    color: var(--text);
    display: block;
}

.stat-card-v2:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
}

.stat-card-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: .6;
}

.stat-label {
    margin: 0 0 10px;
    font: 700 10px var(--mono);
    letter-spacing: .14em;
    color: var(--muted);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stat-label svg {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    opacity: .7;
}

.stat-card-v2 strong {
    font: 800 26px var(--sans);
    letter-spacing: -.02em;
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.stat-card-v2 small {
    color: var(--muted);
    font-size: 11.5px;
}


/* ============================================================
   19. PANEL
   ============================================================ */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px;
    transition: border-color .25s ease;
    color: var(--text);
}

.panel:hover { border-color: var(--line-strong); }

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.panel-head h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
}


/* ============================================================
   20. SHOWCASE / GALLERY
   ============================================================ */
.showcase-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    color: var(--text);
}

.showcase-search {
    position: relative;
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}

.showcase-search .search-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    width: 17px;
    height: 17px;
    stroke: currentColor;
}

.showcase-search input {
    flex: 1;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 12px;
    padding: 12px 15px 12px 42px;
    color: var(--text);
    font: 13px var(--sans);
    outline: none;
    transition: border-color .2s ease;
}

.showcase-search input:focus { border-color: var(--line-strong); }
.showcase-search input::placeholder { color: var(--muted); }

.showcase-search button {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 20px;
    background: var(--accent);
    color: var(--accent-ink);
    font: 700 12.5px var(--sans);
    transition: .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.showcase-search button:hover { opacity: .88; }

.showcase-search button svg {
    width: 14px;
    height: 14px;
    color: inherit;
    stroke: currentColor;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.showcase-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .25s ease, border-color .25s ease;
    color: var(--text);
}

.showcase-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
}

.showcase-thumb {
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.showcase-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.showcase-thumb-placeholder {
    color: var(--muted);
    opacity: .35;
    display: grid;
    place-items: center;
}

.showcase-thumb-placeholder svg {
    width: 48px;
    height: 48px;
    stroke: currentColor;
}

.showcase-body {
    padding: 14px 16px;
    flex: 1;
}

.showcase-body strong {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    word-break: break-word;
    font-weight: 700;
    color: var(--text);
}

.showcase-body p {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    word-break: break-word;
}

.showcase-date {
    font: 10px var(--mono);
    color: var(--muted-2);
    letter-spacing: .04em;
}

.showcase-actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 14px;
}

.showcase-act {
    flex: 1;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font: 700 11.5px var(--sans);
    transition: .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    white-space: nowrap;
}

.showcase-act svg {
    width: 14px;
    height: 14px;
    color: inherit;
    stroke: currentColor;
}

.showcase-act:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

.showcase-act-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.showcase-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.6;
}


/* ============================================================
   21. BUTTONS
   ============================================================ */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font: 700 12.5px var(--sans);
    transition: .2s ease;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
}

.button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: inherit;
    stroke: currentColor;
}

.button-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.button-primary:hover { opacity: .88; transform: translateY(-1px); }

.button-primary:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.button-ghost {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
}

.button-ghost:hover { border-color: var(--line-strong); }

.button-danger {
    background: var(--danger);
    color: #fff;
}

.button-danger:hover { filter: brightness(1.08); }

.button-success {
    background: var(--success);
    color: #fff;
}

.button-full { width: 100%; }

.button[hidden] { display: none; }


/* Mod button */
.mod-btn {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 8px 13px;
    font: 700 11.5px var(--sans);
    transition: .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    white-space: nowrap;
}

.mod-btn svg {
    width: 14px;
    height: 14px;
    color: inherit;
    stroke: currentColor;
}

.mod-btn:hover { border-color: var(--line-strong); }

.mod-btn-ok {
    border-color: rgba(34, 197, 94, .3);
    color: var(--success);
}

.mod-btn-ok:hover {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.mod-btn-danger {
    border-color: rgba(239, 68, 68, .3);
    color: var(--danger);
}

.mod-btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}


/* ============================================================
   22. ROLE BADGES
   ============================================================ */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font: 700 10px var(--mono);
    letter-spacing: .06em;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 4px 11px;
    color: var(--muted);
    white-space: nowrap;
}

.role-badge svg {
    width: 11px;
    height: 11px;
    stroke: currentColor;
}

.role-admin {
    background: var(--info-bg);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, .3);
}

.role-user {
    background: var(--surface-2);
    color: var(--muted);
}

.role-banned {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}


/* ============================================================
   23. FORMS
   ============================================================ */
.field-group { margin-bottom: 16px; }

.field-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 7px;
    letter-spacing: .01em;
}

.field-group label svg {
    width: 12px;
    height: 12px;
    opacity: .7;
    stroke: currentColor;
}

.field-group input,
.field-group textarea,
.field-group select {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 12px;
    padding: 12px 15px;
    color: var(--text);
    font: 13.5px var(--sans);
    outline: none;
    transition: border-color .2s ease, background .2s ease;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
    border-color: var(--line-strong);
    background: var(--surface-3);
}

.field-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.55;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
    color: var(--muted);
    opacity: .9;
}

.field-group input[type="file"] {
    padding: 11px 14px;
    cursor: pointer;
    font-size: 12.5px;
}

.field-group input[type="file"]::file-selector-button {
    background: var(--surface-3);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 7px 14px;
    border-radius: 8px;
    margin-right: 12px;
    cursor: pointer;
    font-family: var(--sans);
    font-weight: 700;
    font-size: 12px;
    transition: background .2s ease;
}

.field-group input[type="file"]::file-selector-button:hover {
    background: var(--accent);
    color: var(--accent-ink);
}

select option {
    background: var(--surface);
    color: var(--text);
}

.field-hint {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.5;
}

.image-preview {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    padding: 8px;
}

.image-preview[hidden] { display: none; }


/* ============================================================
   24. USER GRID (Admin)
   ============================================================ */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 14px;
}

.user-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color .2s ease;
    color: var(--text);
}

.user-card:hover { border-color: var(--line-strong); }

.user-card.is-banned {
    border-color: rgba(239, 68, 68, .5);
    background: color-mix(in srgb, var(--danger) 5%, var(--surface));
}

.user-card-main {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.user-avatar {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    font: 800 20px var(--sans);
    overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-card-info { min-width: 0; flex: 1; }

.user-card-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.user-card-name strong {
    font-size: 15px;
    word-break: break-word;
    color: var(--text);
}

.user-card-meta {
    font-size: 12px;
    color: var(--muted);
    word-break: break-all;
    line-height: 1.6;
}

.user-card-meta b {
    font-family: var(--mono);
    color: var(--text);
    letter-spacing: .05em;
}

.user-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.user-card-actions form { display: contents; }


/* ============================================================
   25. MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    padding: 20px;
    animation: modal-in .2s ease;
}

.modal-overlay[hidden] { display: none; }

@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    width: min(520px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    animation: modal-slide .25s cubic-bezier(.2, .8, .3, 1);
    color: var(--text);
}

@keyframes modal-slide {
    from { transform: scale(.95) translateY(10px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.modal-head h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-head h3 svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .2s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    color: var(--text);
    border-color: var(--line-strong);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}


/* ============================================================
   26. FLOAT ACTIONS
   ============================================================ */
.float-actions {
    position: fixed;
    right: 22px;
    bottom: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 110;
}

.ai-fab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font: 800 12px var(--sans);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .35);
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.ai-fab svg {
    width: 18px;
    height: 18px;
    color: inherit;
    stroke: currentColor;
}

.ai-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(0, 0, 0, .45);
}

.scroll-top-btn {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease;
}

.scroll-top-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--pct, 0) * 1%), var(--line) 0);
}

.scroll-top-inner {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: var(--text);
    font: 700 9px var(--mono);
}

.scroll-top-inner svg {
    width: 14px;
    height: 14px;
    color: inherit;
    stroke: currentColor;
}

.scroll-top-inner b { font: 700 9px var(--mono); color: var(--muted); }


/* ============================================================
   27. AI MODAL
   ============================================================ */
.ai-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 210;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: grid;
    place-items: end end;
    padding: 24px;
    animation: modal-in .2s ease;
}

.ai-modal-overlay[hidden] { display: none; }

.ai-modal {
    width: min(460px, calc(100vw - 28px));
    max-height: min(680px, calc(100vh - 40px));
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: modal-slide .25s cubic-bezier(.2, .8, .3, 1);
    color: var(--text);
}

.ai-modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.ai-modal-head .notice-icon { margin: 0; width: 42px; height: 42px; flex-shrink: 0; }

.ai-modal-head h2 {
    font-size: 18px;
    letter-spacing: -.02em;
    margin-bottom: 2px;
    color: var(--text);
}

.ai-modal-head p { margin: 0; color: var(--muted); font-size: 11px; }

.notice-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--text);
    flex-shrink: 0;
}

.notice-icon svg {
    width: 22px;
    height: 22px;
    color: inherit;
    stroke: currentColor;
}

.ai-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 180px;
    max-height: 340px;
    overflow-y: auto;
    padding: 2px;
}

.ai-message {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-message-bot {
    align-self: flex-start;
    background: var(--surface-2);
    color: var(--text);
}

.ai-message-user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--accent-ink);
}

.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.ai-suggestions button {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 600;
    transition: .2s ease;
    cursor: pointer;
}

.ai-suggestions button:hover {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

.ai-form {
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.ai-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text);
    padding: 12px 14px;
    font: 13px var(--sans);
    outline: none;
    transition: border-color .2s ease;
}

.ai-form input:focus { border-color: var(--line-strong); }
.ai-form input::placeholder { color: var(--muted); }
.ai-form .button { padding: 0 18px; }


/* ============================================================
   28. TOAST
   ============================================================ */
.toast-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    max-width: calc(100vw - 40px);
    animation: toast-in .35s cubic-bezier(.2, .8, .3, 1);
}

.toast-wrap.is-hiding { animation: toast-out .3s ease forwards; }

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 14px 40px 14px 14px;
    box-shadow: var(--shadow);
    min-width: 280px;
    overflow: hidden;
    color: var(--text);
}

.toast-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-weight: 800;
}

.toast-icon svg {
    width: 18px;
    height: 18px;
    color: #ffffff !important;
    stroke: #ffffff !important;
}

.toast-info .toast-icon svg {
    color: var(--accent-ink) !important;
    stroke: var(--accent-ink) !important;
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding-top: 2px;
}

.toast-body strong { font: 800 14px var(--sans); color: var(--text); }

.toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    color: var(--muted);
    font-size: 16px;
    display: grid;
    place-items: center;
    transition: color .2s ease;
    cursor: pointer;
    border: 0;
    background: none;
}

.toast-close:hover { color: var(--text); }

.toast-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.toast-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
}

.toast-bar i {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--accent);
    transform-origin: left;
    animation: toast-countdown 6s linear forwards;
}

.toast-success .toast-icon { background: var(--success); color: #fff; }
.toast-error   .toast-icon { background: var(--danger);  color: #fff; }
.toast-warning .toast-icon { background: var(--warning); color: #fff; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-12px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(-8px) scale(.98); }
}

@keyframes toast-countdown {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}


/* ============================================================
   29. AUTH PAGES
   ============================================================ */
.auth-scene {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
    color: var(--text);
}

.auth-card-v2 {
    position: relative;
    z-index: 2;
    width: min(440px, 100%);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    padding: 34px 32px;
    box-shadow: var(--shadow);
    color: var(--text);
}

.auth-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 6px;
}

.auth-card-v2 h1 {
    font-size: 26px;
    letter-spacing: -.03em;
    margin: 16px 0 20px;
    color: var(--text);
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: 700 11px var(--mono);
    letter-spacing: .06em;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 13px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.auth-form-v2 { display: grid; gap: 16px; }

.field-pass { position: relative; }
.field-pass input { padding-right: 44px; }

.field-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    color: var(--muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: color .2s ease;
    border: 0;
    background: none;
}

.field-eye svg {
    width: 17px;
    height: 17px;
    color: inherit;
    stroke: currentColor;
}

.field-eye:hover { color: var(--text); }

.auth-switch-v2 {
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 22px;
}

.auth-switch-v2 a {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pw-meter {
    margin-top: 9px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.pw-meter-track {
    flex: 1;
    height: 5px;
    border-radius: 4px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    overflow: hidden;
}

.pw-meter-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--line);
    transition: width .25s ease, background .25s ease;
}

.pw-meter-label { font: 10px var(--mono); color: var(--muted); white-space: nowrap; }

.pw-meter.lvl-1 .pw-meter-fill { width: 25%;  background: #e8283a; }
.pw-meter.lvl-2 .pw-meter-fill { width: 55%;  background: #e8b423; }
.pw-meter.lvl-3 .pw-meter-fill { width: 80%;  background: #3fbf6a; }
.pw-meter.lvl-4 .pw-meter-fill { width: 100%; background: #16a34a; }


/* ============================================================
   30. SETTINGS TABS
   ============================================================ */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
    overflow-x: auto;
}

.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    font: 700 13px var(--sans);
    color: var(--muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.settings-tab svg {
    width: 16px;
    height: 16px;
    color: inherit;
    stroke: currentColor;
}

.settings-tab:hover { color: var(--text); }

.settings-tab.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.settings-pane { display: none; }

.settings-pane.is-active {
    display: block;
    animation: fadeSlideIn .25s cubic-bezier(.2, .8, .3, 1);
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   31. SUPPORT PAGE
   ============================================================ */
.support-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 30px;
    align-items: center;
    padding: 34px 36px;
}

.support-hero-left {
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-avatar-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.support-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--line-strong);
    background: var(--surface-2);
    padding: 4px;
}

.support-online-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success);
    border: 3px solid var(--surface);
    animation: pulse-online 2s ease-in-out infinite;
}

@keyframes pulse-online {
    0%, 100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, .35); }
    50%      { box-shadow: 0 0 0 6px rgba(34, 197, 94, .1); }
}

.support-hero-body { min-width: 0; }

.support-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 4px 0;
    color: var(--text);
}

.support-role { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }

.support-contacts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.support-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: var(--radius);
    color: var(--text);
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.support-contact svg {
    width: 18px;
    height: 18px;
    color: inherit;
    stroke: currentColor;
    flex-shrink: 0;
}

.support-contact:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

.support-contact > div {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.support-contact small {
    font-size: 10.5px;
    color: var(--muted);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.support-contact strong {
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-list { display: flex; flex-direction: column; gap: 10px; }

.staff-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .2s ease, background .2s ease;
}

.staff-row:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
}

.staff-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    font: 800 16px var(--sans);
    overflow: hidden;
    flex-shrink: 0;
}

.staff-avatar img { width: 100%; height: 100%; object-fit: cover; }

.staff-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.staff-info strong {
    font-size: 14px;
    color: var(--text);
    word-break: break-word;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.5;
}

.contact-list li:last-child { border-bottom: 0; }

.contact-list svg {
    color: var(--text);
    stroke: currentColor;
    flex-shrink: 0;
    opacity: .8;
}

.contact-list a {
    color: var(--text);
    font-weight: 600;
    word-break: break-all;
}

.contact-list a:hover {
    color: var(--accent);
    text-decoration: underline;
}


/* ============================================================
   32. SWITCH (Toggle)
   ============================================================ */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.switch-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: var(--line-strong);
    border-radius: 999px;
    transition: background .25s ease;
}

.switch-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform .25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

.switch input:checked + .switch-slider { background: var(--success); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.switch-row:last-of-type { border-bottom: 0; }

.switch-row-info { min-width: 0; flex: 1; }

.switch-row-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 3px;
    color: var(--text);
}

.switch-row-info small {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
    display: block;
}


/* ============================================================
   33. PROTECTION LAYER
   ============================================================ */
.protect-image,
.showcase-thumb,
.image-preview,
.protect-image img,
.showcase-thumb img {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.protect-image img,
.showcase-thumb img {
    pointer-events: none;
}

.showcase-thumb-link,
.showcase-card a,
.gallery-link {
    pointer-events: auto;
}

body.nqm-tab-hidden .protect-image img,
body.nqm-tab-hidden .showcase-thumb img,
body.nqm-tab-hidden .image-preview,
body.nqm-tab-hidden .showcase-thumb,
body.nqm-tab-hidden .panel img {
    filter: blur(24px) brightness(.3) !important;
    transition: filter .12s ease;
}

body.nqm-devtools-open .protect-image img,
body.nqm-devtools-open .showcase-thumb img,
body.nqm-devtools-open .image-preview {
    filter: blur(24px) brightness(.3) !important;
    pointer-events: none;
}

body.nqm-devtools-open::before {
    content: '⚠️ Vui lòng đóng DevTools để tiếp tục';
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10000;
    background: var(--danger);
    color: #fff;
    padding: 12px;
    text-align: center;
    font: 700 13px var(--sans);
}

/* Watermark */
.nqm-watermark {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 3;
    opacity: .22;
    mix-blend-mode: overlay;
}

.nqm-watermark span {
    position: absolute;
    font: 800 12px var(--mono);
    color: #ffffff;
    letter-spacing: .12em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
    transform: rotate(-28deg);
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
}

:root[data-theme="light"] .nqm-watermark span {
    color: #000000;
    text-shadow: 0 1px 3px rgba(255, 255, 255, .7);
}

/* Protect warning toast */
.nqm-protect-warning {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 10000;
    background: var(--danger);
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 999px;
    font: 700 13px var(--sans);
    box-shadow: 0 12px 32px rgba(239, 68, 68, .45);
    opacity: 0;
    transition: transform .3s cubic-bezier(.2, .8, .3, 1), opacity .3s ease;
    pointer-events: none;
    max-width: calc(100vw - 40px);
    text-align: center;
    white-space: nowrap;
}

.nqm-protect-warning.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ============================================================
   34. LOGO THEME SWITCH
   ============================================================ */
.theme-logo {
    transition: filter .3s ease;
}

.sidebar-logo,
.welcome-logo,
.loading-logo,
.auth-logo,
.theme-logo,
img[src*="logo"] {
    opacity: 1;
    filter: none;
    mix-blend-mode: normal;
}

:root[data-theme="light"] .theme-logo:not([data-logo-light]) {
    filter: invert(1) hue-rotate(180deg);
}


/* ============================================================
   35. UTILITIES
   ============================================================ */
.muted    { color: var(--muted); }
.muted-2  { color: var(--muted-2); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.icon-svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    color: inherit;
    stroke: currentColor;
}


/* ============================================================
   36. RESPONSIVE — Tablet
   ============================================================ */
@media (max-width: 1100px) {
    .stat-grid-v2 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
    .dash-sidebar { transform: translateX(-100%); }
    .dash-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 24px 0 60px rgba(0, 0, 0, .5);
    }
    .dash-main { margin-left: 0; }
    .sidebar-toggle-btn { display: inline-flex; }
    .user-chip-text { display: none; }
    .user-chip { padding: 5px; }
    .notif-menu {
        position: fixed;
        left: 14px;
        right: 14px;
        width: auto;
        top: auto;
    }
    .user-menu {
        position: fixed;
        left: 14px;
        right: 14px;
        width: auto;
        top: auto;
    }
}


/* ============================================================
   37. RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 640px) {
    .dash-topbar-v2 { padding: 14px 16px; }
    .dash-main-content { padding: 18px 16px 100px; }
    .crumb-chip { display: none; }
    .topbar-title { font-size: 18px; }
    .welcome-banner {
        padding: 26px 22px;
        flex-direction: column;
        align-items: flex-start;
    }
    .welcome-logo {
        width: 80px;
        align-self: flex-end;
    }
    .uid-bar { padding: 20px 18px; }
    .uid-bar-value { font-size: 34px; letter-spacing: .1em; }
    .showcase-toolbar { flex-direction: column; align-items: stretch; }
    .showcase-search { max-width: none; }
    .user-grid { grid-template-columns: 1fr; }
    .showcase-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .stat-grid-v2 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card-v2 { padding: 16px 14px; }
    .stat-card-v2 strong { font-size: 20px; }
    .ai-modal-overlay { padding: 0; place-items: stretch; }
    .ai-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        align-self: end;
    }
    .toast-wrap { left: 14px; right: 14px; top: 14px; }
    .toast { min-width: 0; }
    .panel { padding: 20px; }
    .auth-card-v2 { padding: 28px 22px; border-radius: var(--radius-lg); }
    .auth-card-v2 h1 { font-size: 24px; }
    .support-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 26px 22px;
    }
    .support-hero-left { justify-content: center; }
    .support-contacts { text-align: left; }
    .support-name { font-size: 22px; }
}

@media (max-width: 460px) {
    .stat-grid-v2 { grid-template-columns: 1fr; }
    .showcase-grid { grid-template-columns: 1fr; }
    .balance-chip { padding: 0 10px; font-size: 11px; }
    .modal-box { padding: 22px 18px; border-radius: var(--radius); }
    .settings-tab { padding: 10px 12px; font-size: 12px; }
    .support-contacts { grid-template-columns: 1fr; }
    .staff-row { flex-wrap: wrap; }
    .switch-row { flex-direction: column; align-items: flex-start; }
}


/* ============================================================
   38. PRINT
   ============================================================ */
@media print {
    body * { display: none !important; }
    body::after {
        content: '🔒 Nội dung được bảo vệ bởi NQM AGENCY.';
        display: block;
        padding: 40px;
        font-size: 20px;
        text-align: center;
        font-family: sans-serif;
    }
}


/* ============================================================
   39. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
/* ============================================================
   THEME TOGGLE — Topbar (giống landing)
   ============================================================ */
.theme-button-topbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, transform .15s ease;
    flex-shrink: 0;
}

.theme-button-topbar:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.theme-button-topbar:active {
    transform: scale(.94);
}

.theme-button-topbar svg {
    width: 16px;
    height: 16px;
    color: inherit;
    stroke: currentColor;
}

/* ============================================================
   STORE — Product thumb clickable
   ============================================================ */
.product-thumb a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.product-thumb-overlay {
    pointer-events: none;
}

.product-thumb-overlay .product-thumb-btn {
    pointer-events: auto;
    text-decoration: none;
    display: inline-flex;
}
/* ============================================================
   ★ LOADING MỚI — Ring + % + Fade
   ============================================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0a0a0c;
    display: grid;
    place-items: center;
    transition: opacity .45s ease, transform .45s ease;
}
[data-theme="light"] .loading-screen { background: #f4f0ea; }

.loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.loading-ring {
    position: relative;
    width: 140px;
    height: 140px;
}

.loading-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.loading-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 2;
}
[data-theme="light"] .loading-track { stroke: rgba(0, 0, 0, 0.08); }

.loading-progress {
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 276.46;
    stroke-dashoffset: 276.46;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.7));
    transition: stroke-dashoffset .08s linear;
}
[data-theme="light"] .loading-progress {
    stroke: #0a0a0c;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35));
}

.loading-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.loading-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    animation: logo-pulse 1.6s ease-in-out infinite;
}
@keyframes logo-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.08); opacity: 0.82; }
}

.loading-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.loading-brand {
    font: 800 13px 'DM Mono', monospace;
    letter-spacing: 0.24em;
    color: #f0f0f0;
    text-transform: uppercase;
}
[data-theme="light"] .loading-brand { color: #1a1a1a; }

.loading-percent {
    font: 700 11px 'DM Mono', monospace;
    letter-spacing: 0.15em;
    color: #9c9598;
}

/* ============================================================
   ★ METEOR MỚI — Starfield + Falling streaks
   ============================================================ */
.meteor-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    transition: transform .1s linear;
}

/* Sao nhấp nháy */
.meteor-star {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0.5;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
    animation: star-twinkle infinite ease-in-out;
}
[data-theme="light"] .meteor-star {
    background: #000000;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}
@keyframes star-twinkle {
    0%, 100% { opacity: 0.08; transform: scale(0.7); }
    50%      { opacity: 1; transform: scale(1.2); }
}

/* Sao băng rơi */
.meteor-streak {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.9);
    opacity: 0;
    animation: meteor-fall linear infinite;
}
[data-theme="light"] .meteor-streak {
    background: #222222;
    box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.35);
}

.meteor-streak::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: var(--tail, 120px);
    height: 1.5px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.95),
        rgba(255, 255, 255, 0.4),
        transparent);
    transform: translateY(-50%) rotate(-32deg);
    transform-origin: left center;
    border-radius: 2px;
}
[data-theme="light"] .meteor-streak::after {
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.7),
        rgba(0, 0, 0, 0.2),
        transparent);
}

@keyframes meteor-fall {
    0%   { opacity: 0; transform: translate(0, 0); }
    6%   { opacity: 1; }
    60%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-70vw, 90vh); }
}
/* ============================================================
   ★ APP FOOTER — Redesign
   ============================================================ */
.app-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 22px 30px;
}

.app-footer-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    max-width: 1280px;
    margin: 0 auto;
}

.app-footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.app-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font: 800 13px var(--sans);
    white-space: nowrap;
}

.app-footer-brand img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 7px;
}

.app-footer-sep {
    color: var(--muted-2);
    font-size: 12px;
}

.app-footer-tagline {
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-footer-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.app-footer-links a {
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 8px;
    text-decoration: none;
    transition: .2s ease;
    white-space: nowrap;
}

.app-footer-links a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.app-footer-right {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.app-footer-copy {
    font: 700 11px var(--mono);
    color: var(--muted-2);
    letter-spacing: .04em;
    white-space: nowrap;
}

/* Responsive footer */
@media (max-width: 900px) {
    .app-footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
    .app-footer-left,
    .app-footer-right {
        justify-content: center;
    }
    .app-footer-links {
        order: -1;
    }
}

@media (max-width: 640px) {
    .app-footer {
        padding: 18px 16px;
    }
    .app-footer-links {
        gap: 0;
    }
    .app-footer-links a {
        padding: 5px 9px;
        font-size: 11px;
    }
}

/* ============================================================
   ★ FLOAT ACTIONS — Redesign
   ============================================================ */
.float-actions {
    position: fixed;
    right: 22px;
    bottom: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    z-index: 500;
}

/* ── Scroll top với ring SVG ── */
.scroll-top-btn {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    border: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(.9);
    transition: opacity .25s ease, transform .25s ease;
}

.scroll-top-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.scroll-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.scroll-ring-track {
    fill: var(--surface);
    stroke: var(--line);
    stroke-width: 3;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .3));
}

.scroll-ring-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 289.03;
    stroke-dashoffset: 289.03;
    transition: stroke-dashoffset .1s linear;
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent));
}

.scroll-top-inner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: var(--text);
    pointer-events: none;
}

.scroll-top-inner svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    transition: transform .2s ease;
}

.scroll-top-btn:hover .scroll-top-inner svg {
    transform: translateY(-2px);
}

.scroll-top-inner b {
    font: 700 8px var(--mono);
    color: var(--muted);
    margin-top: 1px;
}

/* ── AI FAB ── */
.ai-fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px 0 16px;
    border-radius: 999px;
    border: 0;
    background: var(--accent);
    color: var(--accent-ink);
    font: 800 13px var(--sans);
    cursor: pointer;
    box-shadow:
        0 14px 30px color-mix(in srgb, var(--accent) 30%, transparent),
        0 4px 10px rgba(0, 0, 0, .3);
    transition: transform .25s ease, box-shadow .25s ease;
    overflow: hidden;
}

.ai-fab:hover {
    transform: translateY(-3px);
    box-shadow:
        0 20px 40px color-mix(in srgb, var(--accent) 35%, transparent),
        0 6px 14px rgba(0, 0, 0, .35);
}

.ai-fab:active {
    transform: translateY(-1px) scale(.98);
}

.ai-fab-icon {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
}

.ai-fab-icon svg {
    animation: ai-rotate 8s linear infinite;
}

@keyframes ai-rotate {
    to { transform: rotate(360deg); }
}

.ai-fab-text {
    position: relative;
    z-index: 2;
    white-space: nowrap;
}

.ai-fab-pulse {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--accent) 100%, transparent),
        color-mix(in srgb, var(--accent) 60%, transparent));
    opacity: 0;
    animation: ai-pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ai-pulse {
    0%, 100% { opacity: 0; }
    50%      { opacity: .35; }
}

/* ============================================================
   ★ AI MODAL — Redesign
   ============================================================ */
.ai-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: grid;
    place-items: end end;
    padding: 24px;
    animation: ai-overlay-in .25s ease;
}

.ai-modal-overlay[hidden] {
    display: none !important;
}

@keyframes ai-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ai-modal {
    width: min(480px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 40px));
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, .55),
        0 0 60px color-mix(in srgb, var(--accent) 5%, transparent);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ai-modal-in .3s cubic-bezier(.2, .8, .3, 1);
}

@keyframes ai-modal-in {
    from { opacity: 0; transform: translateY(30px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Head ── */
.ai-modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--accent) 6%, var(--surface)),
        var(--surface));
    flex-shrink: 0;
}

.ai-modal-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 25%, transparent);
}

.ai-modal-avatar svg {
    animation: ai-rotate 8s linear infinite;
}

.ai-modal-title {
    flex: 1;
    min-width: 0;
}

.ai-modal-title strong {
    display: block;
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 3px;
}

.ai-modal-title span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--muted);
}

.ai-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
    animation: ai-dot-pulse 2s ease-in-out infinite;
}

@keyframes ai-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(.7); }
}

.ai-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: .2s ease;
    flex-shrink: 0;
}

.ai-modal-close:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--line-strong);
    transform: rotate(90deg);
}

/* ── Messages ── */
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 260px;
    scroll-behavior: smooth;
}

.ai-message {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: ai-msg-in .3s ease;
}

.ai-message-user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

@keyframes ai-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ai-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    font: 800 13px var(--sans);
    flex-shrink: 0;
    font-size: 13px;
}

.ai-message-user .ai-msg-avatar {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line);
}

.ai-msg-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    background: var(--surface-2);
    color: var(--text);
    border-bottom-left-radius: 5px;
}

.ai-message-user .ai-msg-content {
    background: var(--accent);
    color: var(--accent-ink);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 5px;
}

/* ── Suggestions ── */
.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    flex-shrink: 0;
}

.ai-suggestions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 999px;
    font: 600 11.5px var(--sans);
    cursor: pointer;
    transition: .2s ease;
    white-space: nowrap;
}

.ai-suggestions button svg {
    stroke: currentColor;
    flex-shrink: 0;
    opacity: .8;
}

.ai-suggestions button:hover {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* ── Form ── */
.ai-form {
    display: flex;
    gap: 8px;
    padding: 14px 16px 16px;
    background: var(--surface);
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

.ai-form input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font: 13.5px var(--sans);
    outline: none;
    transition: .2s ease;
}

.ai-form input:focus {
    border-color: var(--accent);
    background: var(--surface-3);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.ai-form input::placeholder {
    color: var(--muted);
}

.ai-form-btn {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 0;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: .2s ease;
    flex-shrink: 0;
}

.ai-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}

.ai-form-btn:active {
    transform: translateY(0) scale(.96);
}

.ai-form-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .float-actions {
        right: 16px;
        bottom: 16px;
        gap: 10px;
    }
    .scroll-top-btn {
        width: 46px;
        height: 46px;
    }
    .ai-fab {
        height: 44px;
        padding: 0 16px 0 14px;
        font-size: 12px;
    }
    .ai-fab-text {
        display: none;
    }
    .ai-fab {
        width: 44px;
        padding: 0;
        justify-content: center;
    }
    .ai-modal-overlay {
        padding: 0;
        place-items: stretch;
    }
    .ai-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 24px 24px 0 0;
        align-self: end;
    }
    .ai-suggestions {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }
    .ai-suggestions::-webkit-scrollbar {
        display: none;
    }
}
/* ============================================================
   NẠP TIỀN — TABS & LAYOUT
   ============================================================ */
.nap-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    overflow-x: auto;
}
.nap-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    border-radius: 8px;
    transition: .2s;
    text-decoration: none;
    white-space: nowrap;
}
.nap-tab:hover {
    background: var(--surface-2);
    color: var(--text);
}
.nap-tab.active {
    background: var(--accent);
    color: var(--accent-ink);
}

.nap-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 22px;
    align-items: start;
    margin-top: 20px;
}
@media (max-width: 900px) {
    .nap-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   THẺ CÀO
   ============================================================ */
.nap-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
}
.nap-card h3 {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 9px;
}
.nap-card h3 svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
}

.nap-field { margin-bottom: 16px; }
.nap-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.nap-field select,
.nap-field input {
    width: 100%;
    padding: 12px 15px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--text);
    font: 14px var(--sans);
    outline: none;
    transition: .15s;
    font-family: inherit;
}
.nap-field select { cursor: pointer; }
.nap-field input:focus,
.nap-field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.nap-submit {
    width: 100%;
    height: 52px;
    font-size: 14px;
    font-weight: 700;
    background: var(--accent);
    color: var(--accent-ink);
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: .18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}
.nap-submit:hover {
    opacity: .9;
    transform: translateY(-1px);
}
.nap-submit:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}
.nap-submit svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Lịch sử nạp thẻ */
.nap-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nap-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 12.5px;
}
.nap-row-code {
    font: 700 11px var(--mono);
    color: var(--muted);
}
.nap-row-amount {
    font: 800 14px var(--mono);
    color: var(--accent);
}
.nap-row-badge {
    padding: 3px 9px;
    border-radius: 999px;
    font: 800 10px var(--mono);
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.nap-row-badge.warning {
    background: color-mix(in srgb, #f59e0b 18%, transparent);
    color: #fbbf24;
}
.nap-row-badge.success {
    background: color-mix(in srgb, #22c55e 18%, transparent);
    color: #4ade80;
}
.nap-row-badge.danger {
    background: color-mix(in srgb, #ef4444 18%, transparent);
    color: #f87171;
}
.nap-history-empty {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    border: 1px dashed var(--line);
    border-radius: 12px;
}

/* ============================================================
   CHUYỂN KHOẢN NGÂN HÀNG
   ============================================================ */
.bank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.bank-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.bank-logo {
    height: 40px;
    object-fit: contain;
    margin-bottom: 12px;
    background: #fff;
    padding: 4px;
    border-radius: 6px;
}
.bank-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}
.bank-row span { color: var(--muted); }
.bank-row strong {
    color: var(--text);
    font-family: var(--mono);
}
.memo-box {
    background: var(--surface-2);
    border: 1px dashed var(--accent);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-top: 16px;
}
.memo-box p {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}
.memo-box strong {
    font-size: 18px;
    color: var(--accent);
    font-family: var(--mono);
    letter-spacing: 1px;
}
.btn-copy {
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    margin-top: 8px;
    transition: .2s;
}
.btn-copy:hover { opacity: 0.8; }
/* ============================================================
   BẢO VỆ ẢNH KHI MỞ F12 (Không chặn click)
   ============================================================ */

/* 1. Làm mờ ảnh khi F12 mở */
body.nqm-devtools-open .protect-image img,
body.nqm-devtools-open .showcase-thumb img,
body.nqm-devtools-open .image-preview,
body.nqm-devtools-open .product-thumb img,
body.nqm-devtools-open .pf-drop-preview {
    filter: blur(24px) grayscale(100%) brightness(0.2) !important;
    transition: filter 0.2s ease !important;
    pointer-events: none !important;
}

/* 2. Hiện dải cảnh báo đỏ trên cùng (không phủ đen màn hình) */
body.nqm-devtools-open::after {
    content: '⚠ PHÁT HIỆN DEVTOOLS - ẢNH ĐÃ BỊ ẨN ĐỂ BẢO VỆ';
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999999;
    padding: 12px;
    background: #e8283a;
    color: #ffffff;
    font: 700 14px "Manrope", sans-serif;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* 3. Làm mờ ảnh khi chuyển sang Tab khác */
body.nqm-tab-hidden .protect-image img,
body.nqm-tab-hidden .showcase-thumb img,
body.nqm-tab-hidden .image-preview {
    filter: blur(24px) grayscale(100%) brightness(0.2) !important;
    transition: filter 0.1s ease !important;
}
/* ============================================================
   BẢO VỆ KHI MỞ DEVTOOLS (Làm mờ & Cảnh báo)
   ============================================================ */

/* 1. Làm mờ toàn bộ nội dung (chỉ giữ lại cảnh báo) */
body.nqm-devtools-open .dash-main,
body.nqm-devtools-open .dash-sidebar,
body.nqm-devtools-open .dash-topbar-v2 {
    filter: blur(20px) grayscale(100%) brightness(0.1) !important;
    pointer-events: none !important;
    user-select: none !important;
}

/* 2. Hiện màn hình đen cảnh báo */
body.nqm-devtools-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
}

body.nqm-devtools-open::after {
    content: "⚠ PHÁT HIỆN DEVTOOLS\A\A Vui lòng đóng DevTools (F12) để tiếp tục xem nội dung.";
    white-space: pre-wrap;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    padding: 30px 40px;
    border-radius: 16px;
    background: #111;
    color: #fff;
    border: 2px solid #ef4444;
    font: 700 16px "Manrope", system-ui, sans-serif;
    text-align: center;
    box-shadow: 0 30px 80px rgba(239, 68, 68, 0.3);
    pointer-events: none;
    animation: warning-pulse 2s infinite;
}

@keyframes warning-pulse {
    0%, 100% { box-shadow: 0 30px 80px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 30px 80px rgba(239, 68, 68, 0.7); }
}
/* ============================================================
   WATERMARK (DẤU CHÌM) — SVG Pattern lặp lại
   ============================================================ */
.nqm-watermark {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;                    /* Nằm trên ảnh, dưới nút Xem chi tiết */
    background-repeat: repeat;     /* Lặp lại pattern */
    background-position: center center;
    background-size: auto;         /* Giữ nguyên kích thước tile 380x240 */
}

/* Light theme: đổi fill màu đen */
:root[data-theme="light"] .nqm-watermark {
    /* Đảo màu SVG qua filter để fill chuyển từ trắng → đen */
    filter: invert(1);
    opacity: 0.45;
}