/* Dashboard Bot Đảo Rồng — v2.4 (06/11/2026): giao diện Discord / MEE6, nhấn HỒNG.
   • Thanh trên kiểu MEE6 (logo · Plugins · Tài nguyên · ngôn ngữ · tài khoản) — .xbar trong base.css
   • Trang chọn server: thẻ banner mờ + avatar tròn + nút Go (hồng) / Setup (xám) như MEE6
   • Trong server: thanh bên giống danh sách kênh Discord (#2b2d31), nội dung trên nền #313338
   Tên class giữ nguyên bản cũ (dash.js không đổi logic). */

:root {
  --d-bg: #313338;
  --d-side: #2b2d31;
  --d-card: #2b2d31;
  --d-card-2: #35373c;
  --d-input: #1e1f22;
  --d-input-line: #4e5058;      /* viền ô nhập: đủ sáng để thấy ô trên nền tối */
  --d-line: rgba(255, 255, 255, .06);
  --d-line-2: rgba(255, 255, 255, .12);
  --d-line-3: rgba(235, 69, 158, .55);
  --d-hair: rgba(255, 255, 255, .05);
  --on: #23a55a;
  --danger: #f23f43;
  --t-essentials: #eb459e;
  --t-moderation: #f23f43;
  --t-community: #23a55a;
  --t-utilities: #5865f2;
  --t-social: #00a8fc;
}

body.dash { min-height: 100vh; font-size: 15px; background: var(--d-bg); }

/* ------------------------------------------------------------ khung trong server */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.main { min-width: 0; padding: 28px clamp(16px, 3.4vw, 40px) 120px; }
.wrapc { max-width: 1080px; margin: 0 auto; }

.side {
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding: 12px 8px 10px; background: var(--d-side); scrollbar-width: thin; scrollbar-color: #1a1b1e transparent;
}
.side-brand { display: none; }
.gswitch {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-bottom: 1px solid rgba(0, 0, 0, .3); border-radius: 6px 6px 0 0; color: var(--text);
  box-shadow: 0 1px 0 rgba(4, 4, 5, .2);
}
.gswitch:hover { background: rgba(255, 255, 255, .04); }
.gswitch .gtxt { min-width: 0; flex: 1; display: grid; }
.gswitch b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.gswitch small { font-size: .76rem; color: var(--muted); }
.gswitch .ico { width: 16px; height: 16px; color: var(--muted); }

.gicon {
  width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  background: var(--pink); color: #fff; font-weight: 700; font-size: 1rem;
}

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-group { margin: 16px 0 4px; padding: 0 8px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.side-link {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 8px; border-radius: 4px;
  text-decoration: none; color: var(--muted); font-size: .94rem; font-weight: 500; transition: background-color .1s ease, color .1s ease;
}
.side-link:hover { background: rgba(78, 80, 88, .3); color: var(--text-2); }
.side-link[aria-current="page"] { background: rgba(78, 80, 88, .6); color: #fff; }
.side-link[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: #fff; }
.side-link .ico { width: 18px; height: 18px; opacity: .8; }
.side-link .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; flex: none; background: #4e5058; }
.side-link .dot.on { background: var(--on); }

.side-user { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; background: #232428; font-size: .88rem; color: var(--text); }
.side-user img, .side-user .gicon { width: 32px; height: 32px; font-size: .85rem; }
.side-user .uname { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.icon-btn .ico { width: 18px; height: 18px; }

.lang-mini { display: inline-flex; border-radius: 4px; padding: 2px; background: #1e1f22; }
.lang-mini button { border: 0; background: none; color: var(--muted); font-size: .68rem; font-weight: 700; padding: 2px 6px; border-radius: 3px; cursor: pointer; }
.lang-mini button[aria-pressed="true"] { background: var(--bg-5); color: #fff; }

.mbar { display: none; }
.scrim { display: none; }

/* ------------------------------------------------------------ chữ & khối dùng chung */
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; font-size: .86rem; color: var(--muted); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--pink-2); text-decoration: underline; }
.crumbs .sep { opacity: .5; }

.ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; }
.ph .grow { flex: 1; min-width: 240px; }
.ph h1 { margin: 0; font-weight: 800; font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.15; color: var(--text); letter-spacing: -.01em; }
.ph p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }

.hud { position: relative; background: var(--d-card); border-radius: 8px; }
.hud.pad { padding: 20px 22px; }
.hud + .hud, .hud + .blk, .blk + .hud, .blk + .blk { margin-top: 16px; }
.hud-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 16px 20px 12px; border-bottom: 1px solid var(--d-hair); }
.hud-h h2 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.hud-h p { margin: 0; color: var(--muted); font-size: .86rem; flex-basis: 100%; }
.hud-h .more { margin-left: auto; font-size: .86rem; color: var(--link); text-decoration: none; white-space: nowrap; }
.hud-h .more:hover { text-decoration: underline; }
.hud-b { padding: 6px 20px 16px; }
.starred::after { content: none; }

.sec-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--d-line-2); }
.sec-title small { font-size: .78rem; color: var(--dim); font-weight: 600; }

.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin: 0 0 16px; border-radius: 6px; font-size: .9rem;
  background: rgba(88, 101, 242, .1); border: 1px solid rgba(88, 101, 242, .35); color: var(--text-2); }
.note::before { content: "i"; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--blurple); color: #fff; font-size: .72rem; font-weight: 800; }
.note.bad { background: rgba(242, 63, 67, .1); border-color: rgba(242, 63, 67, .4); }
.note.bad::before { content: "!"; background: var(--danger); }
.note b { color: var(--text); }
.note a { color: var(--link); }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: rgba(255, 255, 255, .07); color: var(--text-2); }
.tag.on { background: rgba(35, 165, 90, .18); color: #4ae18a; }
.tag.gold { background: var(--pink-soft); color: var(--pink-2); }
.tag.ban, .tag.softban { background: rgba(242, 63, 67, .18); color: #ff8b8e; }
.tag.kick { background: rgba(240, 178, 50, .16); color: #ffcf6e; }
.tag.timeout, .tag.warn { background: rgba(240, 178, 50, .16); color: #ffcf6e; }
.tag.unban, .tag.untimeout { background: rgba(35, 165, 90, .18); color: #4ae18a; }

.hint { margin: 4px 0 0; font-size: .82rem; line-height: 1.45; color: var(--muted); }
.loading { padding: 70px 16px; text-align: center; color: var(--muted); }
.loading::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--bg-5); border-top-color: var(--pink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ nút gạt */
.sw { position: relative; flex: none; width: 40px; height: 24px; padding: 0; border: 0; border-radius: 999px; cursor: pointer; background: #80848e; transition: background-color .15s ease; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); transition: transform .15s ease; }
.sw[aria-checked="true"] { background: var(--pink); }
.sw[aria-checked="true"]::after { transform: translateX(16px); }
.sw:disabled { opacity: .55; cursor: progress; }
.sw:focus-visible { outline: 2px solid var(--pink-2); outline-offset: 3px; }

/* ------------------------------------------------------------ ô hình tính năng */
.ptile { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; color: #fff; background: var(--tint, var(--pink)); }
.ptile .ico { width: 22px; height: 22px; }
.ptile.lg { width: 56px; height: 56px; border-radius: 14px; }
.ptile.lg .ico { width: 28px; height: 28px; }

/* ------------------------------------------------------------ tổng quan */
.ghero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px 22px; overflow: hidden;
  background: linear-gradient(180deg, rgba(235, 69, 158, .18), rgba(235, 69, 158, 0) 70%), var(--d-card); }
.ring { position: relative; flex: none; display: grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; box-shadow: 0 0 0 4px var(--d-card), 0 0 0 6px rgba(255, 255, 255, .08); }
.ring .gicon { width: 80px; height: 80px; font-size: 2rem; }
.ghero .gtitle { flex: 1; min-width: 220px; }
.ghero h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; line-height: 1.15; color: var(--text); }
.ghero .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; color: var(--muted); font-size: .9rem; }
.ghero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.ghero .meta b { color: var(--text); }
.ghero .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.btn .ico { width: 16px; height: 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.kpi { padding: 14px 16px; background: var(--d-card); border-radius: 8px; }
.kpi span { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.kpi b { display: block; margin-top: 6px; font-size: 1.7rem; font-weight: 800; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi small { display: block; margin-top: 6px; font-size: .8rem; color: var(--muted); }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; min-height: 150px;
  background: var(--d-card); border-radius: 8px; border: 1px solid transparent; transition: background-color .12s ease, border-color .12s ease; }
.pcard:hover { background: var(--d-card-2); border-color: var(--d-line-2); }
.pcard.on { border-color: rgba(235, 69, 158, .22); }
.pcard .pc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pcard .pc-top .sw, .pcard .pc-top .tag { position: relative; z-index: 2; }
.pcard h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text); }
.pcard p { margin: 4px 0 0; font-size: .86rem; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .pc-main { text-decoration: none; color: inherit; flex: 1; }
.pcard .pc-main::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.pcard .pc-foot { display: flex; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--muted); }
.pcard .pc-foot .go { color: var(--link); font-weight: 600; }

.two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.two > .hud { margin: 0; }
.chart { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--body); font-size: 11px; fill: var(--muted); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--d-hair); }
.rows li:last-child { border-bottom: 0; }
.rows .pos { width: 22px; text-align: center; font-weight: 800; color: var(--muted); }
.rows li:nth-child(-n+3) .pos { color: var(--pink-2); }
.rows img, .rows .av { width: 34px; height: 34px; flex: none; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--bg-5); color: #fff; font-weight: 700; }
.rows .grow { flex: 1; min-width: 0; }
.rows .grow b { display: block; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows small { color: var(--muted); font-size: .8rem; }

.empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: .9rem; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { padding: 10px 12px; text-align: left; font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--d-line-2); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--d-hair); vertical-align: top; color: var(--text-2); }
.tbl tr:hover td { background: rgba(255, 255, 255, .02); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child, .tbl th:first-child { padding-left: 20px; }
.tbl td:last-child, .tbl th:last-child { padding-right: 20px; }
.tbl td.r { white-space: nowrap; color: var(--muted); }
.tbl td b { color: var(--text); }
.tbl tr.off td { opacity: .5; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--d-hair); }
.toolbar .inp { max-width: 340px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 14px; border-top: 1px solid var(--d-hair); color: var(--muted); font-size: .88rem; }

/* ------------------------------------------------------------ trang tính năng */
.phead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px; }
.phead .ptxt { flex: 1; min-width: 220px; }
.phead h1 { margin: 0; font-size: clamp(1.4rem, 2.8vw, 1.8rem); font-weight: 800; line-height: 1.15; color: var(--text); }
.phead p { margin: 4px 0 0; color: var(--muted); max-width: 62ch; }
.ptoggle { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; border-radius: 6px; background: var(--d-input); }
.ptoggle .st { display: grid; line-height: 1.2; }
.ptoggle .st small { font-size: .68rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.ptoggle .st b { font-size: .92rem; color: var(--text-2); }
.ptoggle.on .st b { color: #4ae18a; }

.fcard .hud-h { padding-bottom: 10px; }
.field { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 6px 28px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--d-hair); }
.field:last-child { border-bottom: 0; }
.field .flab { padding-top: 9px; }
.field .flab > label, .field .flab > .flabel { display: block; font-weight: 600; color: var(--text); line-height: 1.35; }
.field.is-bool { align-items: center; }
.field.is-bool .flab { padding-top: 0; }
.field.is-bool .fctl { display: flex; justify-content: flex-end; }
.field.full { grid-template-columns: minmax(0, 1fr); }
.field.full .flab { padding-top: 0; }
.fctl { min-width: 0; }

.inp, .sel, textarea.inp {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 4px; border: 1px solid var(--d-input-line);
  background: var(--d-input); color: var(--text); transition: border-color .12s ease, box-shadow .12s ease;
}
textarea.inp { min-height: 92px; resize: vertical; line-height: 1.5; }
.sel { appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--d-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23b5bac1' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") right 12px center no-repeat; }
.sel option, .sel optgroup { background: #2b2d31; color: var(--text); }
.inp:hover, .sel:hover { border-color: #6d6f78; }
.inp:focus, .sel:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
.inp::placeholder { color: var(--dim); }
.num { max-width: 9.5rem; }
.counter { margin-top: 4px; text-align: right; font-size: .76rem; color: var(--muted); }
.counter.over { color: var(--danger); font-weight: 700; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 40px; padding: 3px; border-radius: 4px; border: 0; background: var(--d-input); cursor: pointer; }
.color-row .inp { max-width: 8.5rem; font-family: var(--mono); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 40px; padding: 5px; border-radius: 4px; background: var(--d-input); border: 1px solid var(--d-input-line); }
.chips:focus-within { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 9px; border-radius: 4px; font-size: .85rem; font-weight: 600; background: var(--bg-5); color: var(--text); }
.chip i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; line-height: 1; font-size: 1rem; }
.chip button:hover { background: rgba(242, 63, 67, .2); color: #ff8b8e; }
.chips .sel, .chips .inp { flex: 1; min-width: 9rem; min-height: 28px; padding: 2px 30px 2px 6px; border: 0; box-shadow: none; background-color: transparent; }
.chips .inp { padding-right: 6px; }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; padding-top: 2px; }
.checks label { display: flex; align-items: center; gap: 9px; min-height: 32px; cursor: pointer; color: var(--text-2); font-size: .92rem; }
.checks input { width: 17px; height: 17px; accent-color: var(--pink); }

.vars { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.vars button { padding: 2px 7px; border-radius: 4px; border: 0; background: var(--bg-5); color: var(--pink-2); font-family: var(--mono); font-size: .76rem; cursor: pointer; }
.vars button:hover { background: var(--pink); color: #fff; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item { border-radius: 6px; background: #26272b; border: 1px solid var(--d-line-2); }
.item[open] { border-color: var(--d-line-2); }
.item > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; font-weight: 600; color: var(--text); }
.item > summary::-webkit-details-marker { display: none; }
.item > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s ease; margin: 0 2px; }
.item[open] > summary::before { transform: rotate(45deg); }
.item > summary .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-tools { display: flex; gap: 2px; }
.item-tools button { width: 30px; height: 30px; border-radius: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.item-tools button:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.item-tools button.del:hover { background: rgba(242, 63, 67, .18); color: #ff8b8e; }
.item-body { padding: 2px 14px 10px; border-top: 1px solid var(--d-hair); }
.item-body .field { grid-template-columns: minmax(0, 34%) minmax(0, 1fr); }
.item .item { background: var(--d-card); }
.add-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.empty-list { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--d-line-2); border-radius: 6px; font-size: .9rem; }

/* xem trước tin nhắn kiểu Discord */
.dc-preview { margin-top: 4px; padding: 14px; border-radius: 6px; background: #313338; color: #dbdee1; font-size: .9rem; border: 1px solid var(--d-line-2); }
.dc-preview .dc-text { white-space: pre-wrap; margin-bottom: 6px; }
.dc-embed { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; max-width: 520px; padding: 9px 13px 12px; border-radius: 4px; border-left: 4px solid var(--pink); background: #2b2d31; }
.dc-embed .a { font-size: .8rem; font-weight: 700; color: #f2f3f5; }
.dc-embed .t { font-weight: 700; color: #f2f3f5; }
.dc-embed .t a { color: #00a8fc; }
.dc-embed .d { white-space: pre-wrap; }
.dc-embed .fs { grid-column: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; }
.dc-embed .f { grid-column: span 3; }
.dc-embed .f.in { grid-column: span 1; }
.dc-embed .f b { display: block; font-size: .82rem; color: #f2f3f5; }
.dc-embed .img { grid-column: 1 / -1; max-height: 240px; border-radius: 4px; object-fit: cover; }
.dc-embed .th { grid-column: 2; grid-row: 1 / span 3; width: 72px; height: 72px; border-radius: 4px; object-fit: cover; }
.dc-embed .ft { grid-column: 1 / -1; font-size: .76rem; color: #b5bac1; }
.dc-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dc-btns span { padding: 5px 14px; border-radius: 4px; background: #4e5058; color: #fff; font-size: .84rem; font-weight: 600; }

.actions-list { display: grid; gap: 12px; }
.action-card { padding: 14px 16px; border-radius: 6px; background: var(--d-input); }
.action-card h3 { margin: 0 0 4px; font-size: 1rem; color: var(--text); }
.action-card .field { grid-template-columns: minmax(0, 34%) minmax(0, 1fr); }
.action-card.danger { border: 1px solid rgba(242, 63, 67, .4); background: rgba(242, 63, 67, .06); }

/* thanh lưu kiểu Discord ("Careful — you have unsaved changes!") */
.savebar {
  position: fixed; left: calc(50% + 132px); bottom: 20px; z-index: 50; transform: translate(-50%, 160%); transition: transform .22s cubic-bezier(.2, .8, .2, 1);
  display: flex; align-items: center; gap: 10px; width: min(92vw, 640px); padding: 10px 10px 10px 18px; border-radius: 8px;
  background: #111214; box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.savebar.show { transform: translate(-50%, 0); }
.savebar .msg { flex: 1; font-weight: 600; color: var(--text); }
.savebar .btn.line { border: 0; color: var(--text); }
.savebar .btn.line:hover { text-decoration: underline; background: none; }
.savebar .btn.gold { background: var(--green); }
.savebar .btn.gold:hover { background: #1a8b4a; }

/* ------------------------------------------------------------ chọn server / đăng nhập (kiểu MEE6) */
.solo { min-height: calc(100vh - 64px); padding: 34px 18px 60px; }
.solo-top { display: none; }
.pick { max-width: 1080px; margin: 0 auto; }
.pick h1 { margin: 0; text-align: center; font-size: clamp(1.7rem, 3.6vw, 2.2rem); font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.pick > p { margin: 8px 0 34px; text-align: center; color: var(--muted); }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px 36px; }
.gcard { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--text); }
.gcard .gban { position: relative; height: 152px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: #232428; }
.gcard .gban .blur { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(22px) brightness(.55) saturate(1.2); transform: scale(1.1); }
.gcard .gban .blur.fallback { background: radial-gradient(circle at 30% 30%, rgba(235, 69, 158, .55), transparent 60%), radial-gradient(circle at 75% 70%, rgba(88, 101, 242, .5), transparent 60%), #232428; filter: blur(4px); }
.gcard .gban .gicon, .gcard .gban img.gicon { position: relative; width: 80px; height: 80px; font-size: 2rem; box-shadow: 0 0 0 3px #fff; }
.gcard .grow2 { display: flex; align-items: center; gap: 12px; }
.gcard .gname { flex: 1; min-width: 0; }
.gcard .gname b { display: block; font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .gname small { color: var(--muted); font-size: .86rem; }
.gcard .btn { min-width: 68px; min-height: 46px; font-size: 1rem; }
.gcard:hover .gban .blur { filter: blur(22px) brightness(.65) saturate(1.3); }
.gcard:hover .btn.pink { background: var(--pink-3); }
.gcard.off { opacity: .9; }
.ring { position: relative; }

.login { position: relative; max-width: 480px; margin: 6vh auto 0; padding: 34px 32px 28px; text-align: center; background: var(--d-card); border-radius: 8px; box-shadow: var(--shadow-lg); }
.login-logo { display: block; width: min(100%, 300px); height: auto; margin: -4px auto 16px; }
.login h1 { margin: 0 0 8px; font-size: 1.6rem; font-weight: 800; color: var(--text); }
.login p { margin: 0 auto 12px; max-width: 40ch; color: var(--muted); }
.login .row { display: flex; flex-direction: column; gap: 10px; margin: 22px auto 0; max-width: 340px; }
.login .row .btn { width: 100%; min-height: 44px; }
.login .fine { margin-top: 20px; font-size: .82rem; color: var(--muted); }
.login .fine a { color: var(--link); }
.login .note { text-align: left; }

.demo-ribbon { position: fixed; bottom: 14px; right: 14px; z-index: 60; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  background: var(--pink); color: #fff; font-size: .74rem; font-weight: 800; letter-spacing: .06em; box-shadow: var(--shadow); }

/* ------------------------------------------------------------ điện thoại */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 64px auto 0 0; z-index: 80; width: min(86vw, 300px); height: auto; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 18px 0 50px rgba(0, 0, 0, .5); }
  .side.open { transform: translateX(0); }
  .scrim { display: block; position: fixed; inset: 64px 0 0 0; z-index: 70; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .mbar { position: sticky; top: 64px; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #2b2d31; border-bottom: 1px solid rgba(0, 0, 0, .3); }
  .mbar b { flex: 1; min-width: 0; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mbar .icon-btn { width: 38px; height: 38px; color: var(--text); }
  .mbar .gicon { width: 30px; height: 30px; }
  .main { padding: 18px 12px 120px; }
  .savebar { left: 50%; }
  .field, .item-body .field, .action-card .field { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .field .flab { padding-top: 0; }
  .field.is-bool { grid-template-columns: minmax(0, 1fr) auto; }
  .ptoggle { width: 100%; justify-content: space-between; }
  .ggrid { gap: 28px; }
}
@media (max-width: 520px) {
  .kpis { gap: 8px; }
  .kpi { padding: 12px; }
  .kpi b { font-size: 1.4rem; }
  .hud-h, .hud-b { padding-left: 14px; padding-right: 14px; }
  .tbl td:first-child, .tbl th:first-child { padding-left: 14px; }
  .login { padding: 28px 18px 22px; }
}

.empty-pick { max-width: 560px; margin: 0 auto; text-align: center; padding: 34px 28px; }
.empty-pick h2 { margin: 0 0 8px; font-size: 1.3rem; color: var(--text); }
.empty-pick p { margin: 0 auto; max-width: 46ch; color: var(--muted); }


/* ------------------------------------------------------------ bộ soạn tin (v2.6): soạn bên trái, xem trước dính bên phải */
.field.is-embed { grid-template-columns: minmax(0, 1fr); }
.field.is-embed > .flab { padding-top: 0; }
.eb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 44%); gap: 18px; align-items: start; }
.eb-edit { display: grid; gap: 12px; min-width: 0; }
.eb-kind { display: inline-flex; width: max-content; padding: 3px; border-radius: 6px; background: var(--d-input); border: 1px solid var(--d-input-line); }
.eb-kind button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 4px; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.eb-kind button.on { background: var(--pink); color: #fff; }
.eb-embed { display: grid; gap: 10px; }
.eb-group { border-radius: 6px; background: #26272b; border: 1px solid var(--d-line-2); }
.eb-group > summary { padding: 9px 12px; font-weight: 700; font-size: .9rem; color: var(--text); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.eb-group > summary::-webkit-details-marker { display: none; }
.eb-group > summary::before { content: ""; width: 6px; height: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s ease; }
.eb-group[open] > summary::before { transform: rotate(45deg); }
.eb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 2px 12px 12px; }
.eb-f { display: grid; gap: 5px; min-width: 0; }
.eb-f.wide { grid-column: 1 / -1; }
.eb-f > label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.eb-f .vars { margin-top: 2px; }
.eb-inline { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.eb-inline input { width: 16px; height: 16px; accent-color: var(--pink); }
.eb-fields { display: grid; gap: 8px; }
.eb-field { display: grid; gap: 6px; padding: 8px; border-radius: 6px; background: var(--d-card-2); }
.eb-field-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.eb-field .icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.eb-field .icon-btn:hover { background: rgba(242, 63, 67, .18); color: #ff8b8e; }
.inp.mono { font-family: var(--mono); }
.eb-pv { position: sticky; top: 84px; min-width: 0; border-radius: 8px; background: #313338; border: 1px solid var(--d-line-2); overflow: hidden; }
.eb-pv-h { padding: 8px 12px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #2b2d31; border-bottom: 1px solid var(--d-line); }
.eb-pv-body { padding: 12px 12px 14px; max-height: calc(100vh - 170px); overflow: auto; }
.eb-pv-note { margin: 0; padding: 0 12px 10px; font-size: .74rem; color: var(--dim); }
.dc-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; color: #dbdee1; font-size: .92rem; line-height: 1.375; }
.dc-ava { width: 40px; height: 40px; border-radius: 50%; }
.dc-body { min-width: 0; }
.dc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.dc-head b { color: #f2f3f5; font-weight: 600; }
.dc-app { padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: .62rem; font-weight: 700; line-height: 16px; height: 16px; display: inline-flex; align-items: center; }
.dc-head small { color: #949ba4; font-size: .72rem; }
.dc-text { white-space: pre-wrap; word-wrap: break-word; }
.dc-msg .mention { padding: 0 2px; border-radius: 3px; background: rgba(88, 101, 242, .3); color: #c9cdfb; font-weight: 500; }
.dc-msg code { padding: 1px 4px; border-radius: 3px; background: #2b2d31; font-family: var(--mono); font-size: .85em; }
.dc-msg .q { display: block; padding-left: 10px; border-left: 4px solid #4e5058; }
.dc-embed { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; max-width: 432px; margin-top: 4px; padding: 8px 16px 14px 12px; border-radius: 4px; border-left: 4px solid var(--pink); background: #2b2d31; }
.dc-main { display: grid; gap: 6px; min-width: 0; padding-top: 4px; }
.dc-embed .a { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; color: #f2f3f5; }
.dc-embed .a img, .dc-embed .ft img { width: 22px; height: 22px; border-radius: 50%; }
.dc-embed .t { font-weight: 700; color: #f2f3f5; }
.dc-embed .t.link { color: #00a8fc; }
.dc-embed .d { white-space: pre-wrap; font-size: .875rem; }
.dc-embed .fs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dc-embed .f { grid-column: 1 / -1; font-size: .875rem; }
.dc-embed .f.in { grid-column: span 1; }
.dc-embed .f b { display: block; margin-bottom: 2px; font-size: .875rem; font-weight: 700; color: #f2f3f5; }
.dc-embed .f span { white-space: pre-wrap; }
.dc-embed .th { grid-column: 2; grid-row: 1; width: 80px; height: 80px; border-radius: 4px; object-fit: cover; margin-top: 4px; }
.dc-embed .img { grid-column: 1 / -1; width: 100%; max-height: 300px; border-radius: 4px; object-fit: cover; }
.dc-embed .ft { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: .75rem; color: #b5bac1; }
.dc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-btns span { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 16px; border-radius: 4px; background: #4e5058; color: #fff; font-size: .875rem; font-weight: 500; line-height: 1; }
.dc-empty { margin-top: 4px; padding: 10px 12px; border-radius: 4px; border: 1px dashed var(--d-line-2); color: var(--muted); font-size: .84rem; }
@media (max-width: 1180px) {
  .eb { grid-template-columns: minmax(0, 1fr); }
  .eb-pv { position: relative; top: 0; order: -1; }
}
@media (max-width: 520px) { .eb-grid { grid-template-columns: minmax(0, 1fr); } }
