/* LiveHub Studio Cloud — giao diện tối sang trọng */
:root {
  --bg: #07080d;
  --bg-2: #0b0d14;
  --surface: #10131c;
  --surface-2: #161a26;
  --surface-3: #1d2231;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #eef0f6;
  --muted: #8b91a5;
  --dim: #5d6378;
  --gold: #f0c766;
  --gold-2: #c8913a;
  --gold-grad: linear-gradient(135deg, #fbe3a0 0%, #f0c766 35%, #c8913a 100%);
  --rose: #ff4f86;
  --cyan: #35d6f5;
  --green: #34d399;
  --red: #ff5470;
  --amber: #fbbf24;
  --violet: #a78bfa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 40px -24px rgba(0,0,0,.8);
  --sidebar: 252px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(240, 199, 102, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(53, 214, 245, .05), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.num, .tnum { font-variant-numeric: tabular-nums; }
::selection { background: rgba(240, 199, 102, .3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232838; border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- khung ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, rgba(16, 19, 28, .9), rgba(10, 12, 18, .9));
  border-right: 1px solid var(--line); backdrop-filter: blur(12px); z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--gold-grad); color: #1a1205; box-shadow: 0 8px 24px -8px rgba(240, 199, 102, .55);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-weight: 700; letter-spacing: .2px; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 1.6px; text-transform: uppercase; }
.nav-label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 1.4px; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted);
  font-weight: 500; transition: background .15s, color .15s; position: relative;
}
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(240,199,102,.14), rgba(240,199,102,.02)); }
.nav a.active::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav a.active svg { color: var(--gold); }
.nav .badge-count { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: rgba(255, 79, 134, .16); color: var(--rose); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, #2b3146, #1b1f2d); border: 1px solid var(--line-2); color: var(--gold); overflow: hidden;
}
.avatar.lg { width: 44px; height: 44px; font-size: 16px; border-radius: 14px; }
.user-meta { min-width: 0; flex: 1; }
.user-meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 12px; color: var(--muted); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; transition: .15s; flex: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,.03); }
.icon-btn svg { width: 18px; height: 18px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 16px 32px;
  background: rgba(7, 8, 13, .72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -.2px; }
.topbar .crumb { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.conn { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; white-space: nowrap; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.conn.on i { background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, .15); }
.conn.off i { background: var(--red); }
.org-chip { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.org-chip b { color: var(--text); font-weight: 600; }
.content { padding: 28px 32px 60px; max-width: 1560px; width: 100%; }

/* ---------- thẻ ---------- */
.grid { display: grid; gap: 18px; }
.g-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mt { margin-top: 18px; }
.card {
  background: linear-gradient(180deg, rgba(22, 26, 38, .92), rgba(15, 18, 27, .92));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; position: relative;
}
.card-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-h .sub { color: var(--muted); font-size: 12px; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 16px 20px 20px; }
.card-b.flush { padding: 8px 0 6px; }
.kpi { padding: 20px; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kpi .label svg { width: 16px; height: 16px; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -.6px; margin-top: 10px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .foot { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpi.hero { background: radial-gradient(500px 200px at 100% 0%, rgba(240,199,102,.16), transparent 70%), linear-gradient(180deg, rgba(30, 27, 22, .95), rgba(16, 15, 15, .95)); border-color: rgba(240, 199, 102, .22); }
.kpi.hero .value { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .glyph { position: absolute; right: -12px; bottom: -18px; width: 110px; height: 110px; opacity: .06; color: var(--gold); }
.delta { font-weight: 600; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; }
.delta.up { color: var(--green); background: rgba(52, 211, 153, .12); }
.delta.down { color: var(--red); background: rgba(255, 84, 112, .12); }
.est { white-space: nowrap; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--amber); border: 1px solid rgba(251, 191, 36, .3); padding: 0 6px; border-radius: 6px; }
.flash { animation: flash .9s ease; }
@keyframes flash { 0% { text-shadow: 0 0 0 rgba(240,199,102,0); transform: scale(1); } 30% { text-shadow: 0 0 24px rgba(240,199,102,.6); transform: scale(1.02); } 100% { transform: scale(1); } }

.chart { width: 100%; height: 300px; }
.chart.sm { height: 240px; }

/* ---------- danh sách ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line); min-width: 0; }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t2 { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row .amt small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); flex: none; }
.rank.r1 { background: var(--gold-grad); color: #2a1c05; }
.rank.r2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.rank.r3 { background: linear-gradient(135deg, #f0b48a, #a8643a); color: #2b1407; }
.bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--gold-grad); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.cyan > i { background: linear-gradient(90deg, #1fb6d8, var(--cyan)); }
.bar.rose > i { background: linear-gradient(90deg, #d93a6e, var(--rose)); }

.ticker { max-height: 470px; overflow: hidden; position: relative; }
.ticker::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: linear-gradient(transparent, rgba(15,18,27,1)); pointer-events: none; }
.tick { animation: tickIn .5s cubic-bezier(.2,.8,.2,1); }
.tick.big { background: linear-gradient(90deg, rgba(240, 199, 102, .12), transparent); }
.tick.big .amt { color: var(--gold); }
.tick.sim { opacity: .55; }
@keyframes tickIn { from { opacity: 0; transform: translateY(-12px); background: rgba(240,199,102,.18); } to { opacity: 1; transform: none; } }
.gift-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; font-size: 18px; background: var(--surface-3); border: 1px solid var(--line); }
.gift-ic img { width: 28px; height: 28px; object-fit: contain; }

/* ---------- huy hiệu ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { color: #ff6b8f; background: rgba(255, 79, 134, .12); border-color: rgba(255, 79, 134, .25); }
.pill.live i { animation: pulse 1.4s infinite; }
.pill.connecting { color: var(--amber); background: rgba(251, 191, 36, .1); }
.pill.error { color: var(--red); background: rgba(255, 84, 112, .12); }
.pill.offline, .pill.ended { color: var(--muted); background: rgba(255,255,255,.05); }
.pill.ok { color: var(--green); background: rgba(52, 211, 153, .12); }
.pill.warn { color: var(--amber); background: rgba(251, 191, 36, .1); }
.pill.bad { color: var(--red); background: rgba(255, 84, 112, .12); }
.pill.muted { color: var(--muted); background: rgba(255,255,255,.05); }
.pill.gold { color: var(--gold); background: rgba(240, 199, 102, .1); border-color: rgba(240,199,102,.25); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 79, 134, .7); } 70% { box-shadow: 0 0 0 7px rgba(255, 79, 134, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 79, 134, 0); } }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--dim); flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, .14); }
.dot.off { background: #474d60; }

/* ---------- kênh ---------- */
.ch-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ch-card { padding: 18px; cursor: pointer; transition: transform .15s, border-color .15s; display: flex; flex-direction: column; gap: 14px; }
.ch-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.ch-card.is-live { border-color: rgba(255, 79, 134, .28); background: radial-gradient(400px 160px at 100% 0%, rgba(255, 79, 134, .1), transparent 70%), linear-gradient(180deg, rgba(22, 26, 38, .92), rgba(15, 18, 27, .92)); }
.ch-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ch-top .grow { min-width: 0; flex: 1; }
.ch-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-dev { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ch-stats div { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.ch-stats b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-stats span { font-size: 11px; color: var(--muted); }
.ch-err { font-size: 12px; color: var(--red); background: rgba(255,84,112,.08); border-radius: 8px; padding: 6px 10px; }
.ch-avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff; flex: none; position: relative; }
.ch-avatar.live::after { content: ''; position: absolute; inset: -3px; border-radius: 16px; border: 2px solid var(--rose); }

/* ---------- bảng ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(255,255,255,.015); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.02); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td .t2 { font-size: 12px; color: var(--muted); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; opacity: .4; display: block; margin: 0 auto 10px; }

/* ---------- form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255,255,255,.18); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--gold-grad); color: #231705; border-color: transparent; box-shadow: 0 8px 22px -10px rgba(240, 199, 102, .7); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--red); border-color: rgba(255, 84, 112, .3); background: rgba(255, 84, 112, .06); }
.btn.danger:hover { background: rgba(255, 84, 112, .14); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn.lg { padding: 13px 20px; font-size: 14px; border-radius: 13px; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.primary.busy::after { border-color: rgba(0,0,0,.2); border-top-color: #231705; }
@keyframes spin { to { transform: rotate(360deg); } }
.input, select.input {
  width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.input:focus { border-color: rgba(240, 199, 102, .55); box-shadow: 0 0 0 3px rgba(240, 199, 102, .12); }
select.input { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238b91a5' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input[type=date].input::-webkit-calendar-picker-indicator { filter: invert(.7); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; flex: 1; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.seg button:hover:not(.on) { color: var(--text); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 12px; cursor: pointer; background: transparent; color: var(--muted); font-weight: 500; }
.chip:hover, .chip.on { color: var(--gold); border-color: rgba(240,199,102,.4); background: rgba(240,199,102,.06); }

/* ---------- điều khiển ---------- */
.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.theme-card {
  border-radius: 14px; border: 1px solid var(--line-2); padding: 0; overflow: hidden; cursor: pointer; background: var(--surface-2); text-align: left;
  transition: transform .15s, border-color .15s, box-shadow .15s; position: relative;
}
.theme-card:hover { transform: translateY(-2px); }
.theme-card.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240,199,102,.2); }
.theme-card.on::after { content: '✓'; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #231705; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.theme-swatch { height: 64px; position: relative; overflow: hidden; }
.theme-swatch::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 120%, rgba(255,255,255,.35), transparent 50%); mix-blend-mode: overlay; }
.theme-name { padding: 9px 12px; font-weight: 600; font-size: 13px; }
.ctl-block { display: flex; flex-direction: column; gap: 12px; }
.ctl-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.ctl-row .field { flex: 1; min-width: 110px; }
.big-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.status-strip { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.status-strip .sep { width: 1px; height: 18px; background: var(--line-2); }

/* ---------- bảng xếp hạng game ---------- */
.lb-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255,255,255,.07) 0); position: relative; flex: none; }
.ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; font-size: 18px; font-variant-numeric: tabular-nums; }
.ring small { position: relative; display: block; font-size: 10px; color: var(--muted); text-align: center; margin-top: -4px; }
.countdown { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }

/* ---------- license ---------- */
.lic { padding: 20px; overflow: hidden; background: radial-gradient(420px 180px at 100% 0%, rgba(240,199,102,.12), transparent 70%), linear-gradient(180deg, rgba(26, 24, 22, .95), rgba(16, 15, 16, .95)); border-color: rgba(240,199,102,.18); }
.lic-key { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 18px; letter-spacing: 1.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; flex-wrap: wrap; }
.lic-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lic-meta div span { display: block; font-size: 11.5px; color: var(--muted); }
.lic-meta div b { font-size: 15px; }
.meter { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.meter .bar { flex: 1; margin: 0; }
.meter span { font-size: 12px; color: var(--muted); width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- toast & modal ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; max-width: calc(100vw - 40px); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: 0 18px 40px -10px rgba(0,0,0,.7); min-width: 260px; max-width: 380px; animation: toastIn .3s ease; font-size: 13px; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--green); } .toast.err svg { color: var(--red); } .toast.info svg { color: var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 90; padding: 16px; animation: fade .2s; }
.modal { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); }
.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal p { color: var(--muted); margin: 0 0 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal .stack { display: flex; flex-direction: column; gap: 12px; }
@keyframes fade { from { opacity: 0; } }

.muted { color: var(--muted); }
.gold { color: var(--gold); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; }
.hide { display: none !important; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 30px 0 14px; }
.section-title h2 { margin: 0; font-size: 16px; }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.notice { padding: 12px 16px; border-radius: 12px; background: rgba(251,191,36,.07); border: 1px solid rgba(251,191,36,.2); color: #f4d27a; font-size: 13px; }
.backdrop { display: none; }

/* ---------- đăng nhập ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-glow { position: fixed; width: 900px; height: 900px; border-radius: 50%; background: radial-gradient(circle, rgba(240,199,102,.13), transparent 60%); top: -380px; right: -260px; pointer-events: none; }
.login-glow.b { background: radial-gradient(circle, rgba(255,79,134,.08), transparent 60%); top: auto; bottom: -460px; left: -300px; right: auto; }
.login-card { width: 100%; max-width: 420px; padding: 34px 30px; position: relative; }
.login-card .brand { padding: 0 0 26px; }
.login-card h2 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.4px; }
.login-card p.lead { color: var(--muted); margin: 0 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.form-err { color: var(--red); font-size: 13px; min-height: 18px; }
.modal .form-err:empty { display: none; }
.login-foot { margin-top: 22px; text-align: center; color: var(--dim); font-size: 12px; }
.dots { position: fixed; inset: 0; pointer-events: none; opacity: .35; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 26px 26px; mask-image: radial-gradient(circle at 50% 40%, black, transparent 70%); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .g-2-1, .g-1-1, .g-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .25s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 30px 0 60px rgba(0,0,0,.6); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  .menu-btn { display: grid; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar h1 { font-size: 17px; }
  .org-chip { display: none; }
  .content { padding: 18px 16px 50px; }
  .kpi .value { font-size: 24px; }
  .kpi { padding: 16px; }
  .grid { gap: 14px; }
  .card-h { padding: 16px 16px 0; }
  .card-b { padding: 14px 16px 16px; }
  .row { padding: 10px 16px; }
  .chart { height: 240px; }
  .lic-meta { grid-template-columns: repeat(2, 1fr); }
  .toasts { right: 12px; left: 12px; bottom: 12px; }
  .toast { max-width: none; }
  .conn span { display: none; }
  .conn { padding: 8px; }
}
@media (max-width: 520px) {
  .g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 20px; }
  .kpi .foot { font-size: 11px; }
  .filters .field { min-width: calc(50% - 6px); }
  .big-actions { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  td, th { padding: 10px; }
}
