/* Central Admin — giao diện sáng, gọn: thanh menu trái, bảng có lọc, thẻ trạng thái. Không dùng thư viện ngoài. */
:root {
  --bg: #f4f6f5; --panel: #ffffff; --ink: #18211d; --soft: #4d5a54; --mute: #7d8a84; --line: #dfe5e2; --line2: #eef2f0;
  --brand: #0e7c66; --brand-2: #0b6655; --brand-soft: #e2f3ee;
  --ok: #157a3f; --ok-soft: #e3f5ea; --warn: #9a5b00; --warn-soft: #fdf1dc; --bad: #b42318; --bad-soft: #fde7e5; --info: #175cd3; --info-soft: #e4edfd;
  --radius: 10px; --f: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.boot { padding: 40px; color: var(--mute); }
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: #12201b; color: #d7e3de; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; color: #fff; }
.side .brand img { width: 28px; height: 28px; }
.side .brand small { display: block; font-weight: 400; color: #8fa79d; font-size: 11.5px; }
.side a { display: flex; align-items: center; gap: 10px; color: #c3d2cb; padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.side a:hover { background: #1b2e27; color: #fff; }
.side a.on { background: var(--brand); color: #fff; }
.side .grow { flex: 1; }
.side .me { font-size: 12.5px; color: #8fa79d; padding: 8px 10px; border-top: 1px solid #22382f; }
.side .me b { color: #e6efeb; font-weight: 600; }
.main { min-width: 0; padding: 22px clamp(14px, 3vw, 32px) 60px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.top h1 { margin: 0; font-size: 21px; text-wrap: balance; }
.top .sub { color: var(--mute); font-size: 13px; }
.top .act { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card h2 { margin: 0 0 10px; font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 .r { margin-left: auto; font-weight: 400; display: flex; gap: 6px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--soft); font-size: 12.5px; }
.stat.bad .n { color: var(--bad); } .stat.warn .n { color: var(--warn); } .stat.ok .n { color: var(--ok); }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; white-space: nowrap; font-weight: 500; }
.btn:hover { border-color: #b9c6c0; background: #fafcfb; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.pri:hover { background: var(--brand-2); }
.btn.dan { color: var(--bad); border-color: #f2c2bd; } .btn.dan:hover { background: var(--bad-soft); }
.btn.dan.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line2); color: var(--soft); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.info { background: var(--info-soft); color: var(--info); } .pill.brand { background: var(--brand-soft); color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--mute); } .dot.ok { background: #22a95a; } .dot.bad { background: var(--bad); } .dot.warn { background: #e59a1a; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line2); vertical-align: top; }
th { font-size: 12px; color: var(--soft); font-weight: 600; background: #f9fbfa; position: sticky; top: 0; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7faf9; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--mute); } .soft { color: var(--soft); } .small { font-size: 12.5px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
input[type=text], input[type=password], input[type=number], input[type=email], input:not([type]), select, textarea { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; min-width: 0; }
textarea { height: auto; padding: 8px 10px; resize: vertical; width: 100%; }
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--soft); }
label.f input, label.f select, label.f textarea { width: 100%; color: var(--ink); }
label.ck { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.form { display: grid; gap: 12px; }
.form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.help { font-size: 12.5px; color: var(--mute); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: 13.5px; }
.kv dt { color: var(--mute); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; }
.note { border-radius: 8px; padding: 10px 12px; font-size: 13.5px; background: var(--info-soft); color: #173a74; }
.note.warn { background: var(--warn-soft); color: #6b3f00; } .note.bad { background: var(--bad-soft); color: #7a1a12; } .note.ok { background: var(--ok-soft); color: #0f5530; }
.secret { font-family: var(--mono); background: #10201a; color: #d6f5e9; padding: 12px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.slot { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; align-content: start; }
.slot .h { display: flex; align-items: center; gap: 8px; } .slot .h b { font-size: 15px; }
.slot .h .pill { margin-left: auto; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.steps span { padding: 5px 10px; border-radius: 99px; background: var(--line2); color: var(--soft); font-size: 12.5px; font-weight: 600; }
.steps span.on { background: var(--brand); color: #fff; } .steps span.done { background: var(--brand-soft); color: var(--brand); }
.list { display: grid; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 8px; background: #fbfcfb; border: 1px solid var(--line2); }
.alert .m { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.chk { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px dashed var(--line2); }
.empty { padding: 26px; text-align: center; color: var(--mute); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(400px, 100%); padding: 26px; }
.login h1 { margin: 0 0 4px; font-size: 20px; } .login p { margin: 0 0 16px; color: var(--mute); }
#modal-root .back { position: fixed; inset: 0; background: rgba(16, 28, 24, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
#modal-root .dlg { background: var(--panel); border-radius: 12px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px; display: grid; gap: 14px; }
#modal-root .dlg h3 { margin: 0; font-size: 17px; }
#modal-root .dlg .ft { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 6px; }
#toast div { background: #12201b; color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 6px 20px rgba(0,0,0,.18); max-width: 90vw; }
#toast div.err { background: var(--bad); }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
.tbl td.small, .tbl td.mono { overflow-wrap: anywhere; word-break: break-word; }
.small.bad { color: var(--bad); font-weight: 600; }
