/* =========================================================
   MEDIASSIST · DESIGN SYSTEM v2
   - Giữ nguyên toàn bộ tên biến/lớp cũ (tương thích trang cũ & Admin)
   - Bổ sung token mới: surface, ring, radius, shadow, spacing, trạng thái
========================================================= */
/* Font tự lưu trong site (không phụ thuộc Google Fonts → không bị chặn/chậm khiến CSS không áp dụng) */
/* vietnamese */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets.php?f=fonts/9473b8f2d3.woff2&v=1) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets.php?f=fonts/883ecb8b38.woff2&v=1) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets.php?f=fonts/885461aeb5.woff2&v=1) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets.php?f=fonts/0534dbd43d.woff2&v=1) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets.php?f=fonts/538df6b3ab.woff2&v=1) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets.php?f=fonts/877c60545e.woff2&v=1) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets.php?f=fonts/c000becd80.woff2&v=1) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets.php?f=fonts/2c60bf20ed.woff2&v=1) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets.php?f=fonts/e88d42ea28.woff2&v=1) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets.php?f=fonts/0d10747410.woff2&v=1) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets.php?f=fonts/bcb4e33fd9.woff2&v=1) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets.php?f=fonts/e5c68d27ee.woff2&v=1) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets.php?f=fonts/3a7b670f66.woff2&v=1) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets.php?f=fonts/8eed1b9fc5.woff2&v=1) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets.php?f=fonts/2e4be41005.woff2&v=1) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets.php?f=fonts/8ea5e19410.woff2&v=1) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets.php?f=fonts/76306ee877.woff2&v=1) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets.php?f=fonts/1cd702cd25.woff2&v=1) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets.php?f=fonts/8ea5e19410.woff2&v=1) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets.php?f=fonts/76306ee877.woff2&v=1) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets.php?f=fonts/1cd702cd25.woff2&v=1) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets.php?f=fonts/8ea5e19410.woff2&v=1) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets.php?f=fonts/76306ee877.woff2&v=1) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets.php?f=fonts/1cd702cd25.woff2&v=1) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* --- DARK MODE (MẶC ĐỊNH) --- */
:root {
    color-scheme: dark;

    /* Nền & chữ */
    --bg-main: #060f1d;
    --bg-elevated: #0b1a2f;
    --text-main: #eaf6ff;
    --text-muted: #9db4c9;
    --text-subtle: #6f869c;

    /* Kính mờ (tên cũ) */
    --glass: rgba(255, 255, 255, 0.035);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-heavy: rgba(8, 20, 38, 0.88);
    --glass-hover-border: rgba(143, 220, 255, 0.38);

    /* Surface (mới) */
    --surface: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.07);
    --surface-solid: #0e2038;
    --border: rgba(170, 225, 255, 0.11);
    --border-strong: rgba(170, 225, 255, 0.22);

    /* Input */
    --input-bg: rgba(0, 0, 0, 0.28);
    --input-bg-focus: rgba(0, 0, 0, 0.45);

    /* Thương hiệu */
    /* Bảng màu XANH BĂNG (tên biến cũ được giữ để tương thích: pink = màu nhấn chính, violet = xanh thép) */
    --brand-pink: #8fdcff;
    --brand-violet: #5fb4f7;
    --brand-blue: #38bdf8;
    --brand-blue-strong: #0ea5e9;
    --brand-teal: #67e8f9;
    --primary-gradient: linear-gradient(135deg, #c4eeff 0%, #8fdcff 45%, #4cc3f7 100%);
    --text-gradient: linear-gradient(100deg, #f0faff 0%, #a9e6ff 45%, #4cc3f7 100%);
    --on-primary: #05233a;
    --btn-shadow: rgba(76, 195, 247, 0.34);
    --ring: rgba(143, 220, 255, 0.6);

    /* Trạng thái */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #f43f5e;

    /* Toast */
    --toast-bg: rgba(11, 26, 47, 0.96);

    /* Scrollbar */
    --scrollbar-thumb: rgba(170, 225, 255, 0.2);

    /* Token RGB (cho rgba(var(--x-rgb), a) – tương thích trình duyệt cũ, không cần color-mix) */
    --brand-pink-rgb: 143, 220, 255;
    --brand-violet-rgb: 95, 180, 247;
    --brand-blue-rgb: 56, 189, 248;
    --success-rgb: 16, 185, 129;
    --warning-rgb: 245, 158, 11;
    --danger-rgb: 244, 63, 94;
    --bg-main-rgb: 6, 15, 29;
    --bg-elevated-rgb: 11, 26, 47;

    /* Kích thước & hiệu ứng */
    --header-h: 72px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    /* Font */
    --font-main: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Be Vietnam Pro', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

/* --- LIGHT MODE --- */
[data-theme="light"] {
    color-scheme: light;

    --bg-main: #f1f8fd;
    --bg-elevated: #ffffff;
    --text-main: #0a1f38;
    --text-muted: #4a6078;
    --text-subtle: #70869c;

    --glass: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(8, 70, 115, 0.11);
    --glass-heavy: rgba(255, 255, 255, 0.94);
    --glass-hover-border: rgba(3, 105, 161, 0.4);

    --surface: #ffffff;
    --surface-2: #e7f3fb;
    --surface-solid: #ffffff;
    --border: rgba(8, 70, 115, 0.11);
    --border-strong: rgba(8, 70, 115, 0.22);

    --input-bg: #ffffff;
    --input-bg-focus: #ffffff;

    --brand-pink: #0369a1;
    --brand-violet: #2b6cb0;
    --brand-blue: #0284c7;
    --brand-blue-strong: #0369a1;
    --brand-teal: #0e7490;
    --primary-gradient: linear-gradient(135deg, #0881be 0%, #06689f 50%, #055080 100%);
    --text-gradient: linear-gradient(100deg, #075985 0%, #0284c7 55%, #0e8fb5 100%);
    --on-primary: #ffffff;
    --btn-shadow: rgba(3, 105, 161, 0.26);
    --ring: rgba(2, 132, 199, 0.5);

    --success: #059669;
    --warning: #d97706;
    --danger: #e11d48;

    --toast-bg: rgba(255, 255, 255, 0.98);
    --scrollbar-thumb: rgba(8, 70, 115, 0.22);

    --brand-pink-rgb: 3, 105, 161;
    --brand-violet-rgb: 43, 108, 176;
    --brand-blue-rgb: 2, 132, 199;
    --success-rgb: 5, 150, 105;
    --warning-rgb: 217, 119, 6;
    --danger-rgb: 225, 29, 72;
    --bg-main-rgb: 241, 248, 253;
    --bg-elevated-rgb: 255, 255, 255;

    --shadow-sm: 0 1px 2px rgba(8, 70, 115, 0.07);
    --shadow-md: 0 10px 30px -12px rgba(8, 70, 115, 0.2);
    --shadow-lg: 0 30px 60px -24px rgba(8, 70, 115, 0.28);
}

/* =========================================
   RESET & BASE
========================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

* { font-family: var(--font-main); } /* Icon Font Awesome dùng class selector nên vẫn ưu tiên hơn */
code, pre, kbd, samp, .mono { font-family: var(--font-mono); }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 0.35s ease, color 0.35s ease;
}

img, svg, video { max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; }
a { color: inherit; }

/* Bảng tràn trên mobile không làm vỡ layout */
table { border-collapse: collapse; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Focus hiển thị rõ cho bàn phím (WCAG 2.4.7) */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 3px;
    border-radius: 6px;
}

::selection { background: rgba(56, 189, 248, 0.3); color: inherit; }

/* Skip link */
.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 100000;
    background: var(--text-main); color: var(--bg-main);
    padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 14px;
    text-decoration: none; transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

[hidden] { display: none !important; }
#page-content:focus { outline: none; }

.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* =========================================
   GLASS PANEL
========================================= */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.glass-panel:hover {
    border-color: var(--glass-hover-border);
    box-shadow: var(--shadow-md);
}

/* =========================================
   TYPOGRAPHY
========================================= */
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    text-wrap: balance;
}
p { font-weight: 400; text-wrap: pretty; }

.text-gradient {
    background: var(--text-gradient);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

/* =========================================
   FORM ELEMENTS
========================================= */
.input-glass {
    width: 100%;
    min-height: 48px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 16px; /* >=16px để iOS không tự zoom khi focus */
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.input-glass::placeholder { color: var(--text-subtle); }
.input-glass:focus {
    border-color: var(--brand-blue);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

/* Trên mobile, mọi ô nhập đều >= 16px để tránh iOS auto-zoom */
@media (max-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
}

select.input-glass,
select.task-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 40px;
}
select option { background-color: var(--bg-elevated); color: var(--text-main); font-weight: 500; }

@media (max-width: 768px) {
    select.input-glass, select.task-select { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
}

/* =========================================
   BUTTONS
========================================= */
.btn-primary,
.btn-secondary,
.btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 44px; /* Vùng chạm tối thiểu */
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700; font-size: 15px; line-height: 1.2;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary {
    background: var(--primary-gradient);
    background-size: 160% 160%;
    background-position: 0% 50%;
    color: var(--on-primary); border: none;
    box-shadow: 0 8px 24px -8px var(--btn-shadow);
}
.btn-primary:hover { transform: translateY(-2px); background-position: 100% 50%; box-shadow: 0 14px 32px -10px var(--btn-shadow); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--surface); color: var(--text-main);
    border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--brand-blue); transform: translateY(-1px); }

.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text-main); background: var(--surface); }

.btn-primary:disabled, .btn-secondary:disabled, .btn-ghost:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }

/* =========================================
   SCROLLBAR
========================================= */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); background-clip: padding-box; }

/* =========================================
   TOAST NOTIFICATIONS
========================================= */
#toast-container {
    position: fixed;
    bottom: max(24px, env(safe-area-inset-bottom));
    right: 24px;
    z-index: 100001;
    display: flex; flex-direction: column-reverse; gap: 10px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 280px; max-width: min(420px, calc(100vw - 32px));
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--toast-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    display: flex; align-items: center; gap: 12px;
    box-shadow: var(--shadow-lg);
    transform: translateY(24px); opacity: 0;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
    font-size: 14px; font-weight: 600; line-height: 1.45;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--brand-blue); }

@media (max-width: 600px) {
    #toast-container { left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
    .toast { min-width: 0; max-width: none; }
}

/* =========================================
   SCROLL REVEAL (chỉ ẩn khi JS sẵn sàng → không mất nội dung nếu JS lỗi)
========================================= */
.js-ready .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js-ready .reveal.active { opacity: 1; transform: none; }

/* =========================================
   GIẢM CHUYỂN ĐỘNG (WCAG 2.3.3)
========================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .js-ready .reveal { opacity: 1; transform: none; }
}
