/* Nen tang: bien mau (sang/toi), chu, bo cuc, menu. Thanh phan + hieu ung o vps-ui.css. */
:root {
  --bg: #f3f5fa; --surface: #ffffff; --surface-2: #f7f8fc; --line: #e5e8f0; --line-strong: #d3d8e4;
  --ink: #0f172a; --muted: #64748b; --brand: #3366ff; --brand-strong: #2152e8; --brand-ink: #ffffff;
  --ok: #10b981; --warn: #f59e0b; --danger: #ef4444; --info: #3366ff; --violet: #8b5cf6; --pink: #ec4899;
  --nav-bg: #0b1220; --nav-ink: #9aa6bd; --nav-hover: #141e33; --nav-active: #1b2742;
  --radius: 10px; --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05); --shadow: 0 8px 28px rgba(15, 23, 42, .08); --shadow-lg: 0 24px 60px rgba(15, 23, 42, .22);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1c; --surface: #111a2c; --surface-2: #162038; --line: #1f2b45; --line-strong: #2a3858;
    --ink: #e6ebf5; --muted: #8a97b0; --brand: #5b8cff; --brand-strong: #7aa2ff;
    --nav-bg: #070b15; --nav-hover: #10182b; --nav-active: #16213b;
    --shadow: 0 8px 28px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1c; --surface: #111a2c; --surface-2: #162038; --line: #1f2b45; --line-strong: #2a3858;
  --ink: #e6ebf5; --muted: #8a97b0; --brand: #5b8cff; --brand-strong: #7aa2ff;
  --nav-bg: #070b15; --nav-hover: #10182b; --nav-active: #16213b;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; transition: background .25s, color .25s; }
.hidden { display: none !important; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h2, h3 { letter-spacing: -.01em; }
svg.lucide { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; vertical-align: -3px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
textarea { font-family: var(--mono); font-size: 12.5px; min-height: 160px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
input[type=checkbox] { width: auto; min-height: auto; accent-color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
button { cursor: pointer; border: 1px solid transparent; border-radius: var(--radius); min-height: 36px; padding: 7px 14px; background: var(--brand); color: var(--brand-ink); font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, transform .1s, box-shadow .15s, border-color .15s; }
button:hover { background: var(--brand-strong); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
button:active { transform: translateY(1px) scale(.98); }
button:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
button.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
button.ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
button.danger { background: var(--danger); color: #fff; }
button.danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); box-shadow: 0 4px 14px color-mix(in srgb, var(--danger) 30%, transparent); }
button.ghost.danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
button.sm { min-height: 28px; padding: 3px 10px; font-size: 12px; border-radius: 8px; }
.icon-btn { background: transparent; color: inherit; min-height: 32px; width: 32px; padding: 0; border-radius: 8px; box-shadow: none; }
.icon-btn:hover { background: var(--nav-hover); box-shadow: none; }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 4px; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .7; }

/* ---- Dang nhap ---- */
#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 25%, transparent), transparent), radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--violet) 22%, transparent), transparent), var(--bg); }
#login .box { background: var(--surface); padding: 32px; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); width: 100%; max-width: 390px; animation: pop .4s var(--ease); }
#login h1 { margin: 0 0 4px; font-size: 22px; display: flex; align-items: center; gap: 10px; }

/* ---- Bo cuc + menu ---- */
#app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; transition: grid-template-columns .25s var(--ease); }
#app.nav-collapsed { grid-template-columns: 68px 1fr; }
#nav { background: var(--nav-bg); color: var(--nav-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; padding: 10px; gap: 2px; z-index: 30; }
#nav .brand { display: flex; align-items: center; gap: 10px; padding: 6px 6px 12px; color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; }
#nav .logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--violet)); color: #fff; flex-shrink: 0; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 45%, transparent); }
#nav .brand .icon-btn { margin-left: auto; color: var(--nav-ink); }
#nav .search-btn { background: var(--nav-hover); color: var(--nav-ink); border: 1px solid #1e2a44; justify-content: flex-start; margin-bottom: 8px; font-weight: 500; box-shadow: none; white-space: nowrap; }
#nav .search-btn:hover { background: var(--nav-active); color: #fff; }
#nav .search-btn kbd { margin-left: auto; }
#nav .gl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #5d6a84; padding: 12px 10px 4px; white-space: nowrap; }
#nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--nav-ink); border-radius: 8px; white-space: nowrap; position: relative; transition: background .15s, color .15s; text-decoration: none; }
#nav a:hover { background: var(--nav-hover); color: #fff; }
#nav a.active { background: var(--nav-active); color: #fff; }
#nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--brand), var(--violet)); }
#nav a .badge { margin-left: auto; }
#nav .foot { margin-top: auto; padding: 12px 6px 4px; font-size: 12px; border-top: 1px solid #172036; display: flex; flex-direction: column; gap: 4px; }
#nav .foot a { padding: 6px 10px; }
#nav .who { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; white-space: nowrap; }
#nav .avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--ok), var(--brand)); color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0; }
#app.nav-collapsed #nav .label, #app.nav-collapsed #nav .gl, #app.nav-collapsed #nav kbd { display: none; }
#app.nav-collapsed #nav a, #app.nav-collapsed #nav .search-btn { justify-content: center; }
#app.nav-collapsed #nav .brand { flex-direction: column; }
#app.nav-collapsed #nav .brand .icon-btn { margin: 0; }
#app.nav-collapsed #nav a .badge { position: absolute; top: 2px; right: 2px; padding: 0 5px; font-size: 10px; }
#topbar { display: none; }
#navBackdrop { display: none; }
#main { padding: 22px 28px; min-width: 0; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pagehead h2 { margin: 0; font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 800px) {
  #app, #app.nav-collapsed { grid-template-columns: 1fr; }
  #topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 25; padding: 8px 12px; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  #topbar .title { font-weight: 700; flex: 1; }
  #topbar .icon-btn:hover { background: var(--surface-2); }
  #nav { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-105%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  #app.nav-open #nav { transform: none; }
  #app.nav-open #navBackdrop { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 29; animation: fade .2s; }
  #app.nav-collapsed #nav .label, #app.nav-collapsed #nav kbd { display: inline; }
  #app.nav-collapsed #nav .gl { display: block; }
  #app.nav-collapsed #nav a, #app.nav-collapsed #nav .search-btn { justify-content: flex-start; }
  #app.nav-collapsed #nav .brand { flex-direction: row; }
  #nav .brand .icon-btn { display: none; }
  #main { padding: 16px; }
  .pagehead h2 { font-size: 19px; }
}
