:root { --bg: #f7f7f8; --card: #fff; --line: #e9e9ee; --line2: #dedee6; --text: #1f1f29; --muted: #73737f;
  --purple: #8960ee; --purple-soft: #efeafe; --purple-text: #7548d3; --grad: linear-gradient(100deg, #9866ef, #7c64ed);
  --ok: #1f9d6b; --ok-soft: #e6f6ef; --warn: #a76a00; --warn-soft: #fff4dc; --bad: #c0392b; --bad-soft: #fdecea;
  --font: "Segoe UI", Tahoma, Arial, sans-serif; color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.btn { border: 0; border-radius: 6px; padding: 7px 14px; cursor: pointer; background: #f1f1f5; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn.p { background: var(--grad); color: #fff; }
.btn.ghost { background: #fff; border: 1px solid var(--line2); }
.btn.danger { background: #fff; border: 1px solid #f1c4bf; color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; padding: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.err { color: var(--bad); min-height: 20px; margin: 0; font-size: 13px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 0%, #efeafe 0, var(--bg) 60%); }
.login-card { width: min(380px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 12px 40px #25203214; }
.login-card .logo { width: auto; height: 56px; align-self: center; }
.login-card h1 { font-size: 19px; text-align: center; margin: 4px 0 6px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
label input, label select, label textarea { font-weight: 400; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand img { width: auto; height: 26px; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tabs button { border: 0; background: none; padding: 0 12px; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--purple-text); border-bottom-color: var(--purple); font-weight: 600; }
.me { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); }
main { max-width: 1200px; margin: 0 auto; padding: 20px 24px 60px; }
.tab { display: none; }
.tab.on { display: block; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; text-align: left; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.on { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input { flex: 1 1 260px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.uname { font-weight: 600; }
.sub { display: block; color: var(--muted); font-size: 12px; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.off { background: #f1f1f5; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; max-width: 360px; }
.empty { text-align: center; color: var(--muted); padding: 40px; }

.modal { position: fixed; inset: 0; background: rgba(25,22,36,.28); display: grid; place-items: center; z-index: 20; padding: 16px; }
.dlg { background: #fff; border-radius: 10px; width: min(480px, 100%); box-shadow: 0 12px 40px #25203226; max-height: 92vh; overflow: auto; }
.dh { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.dh .x { margin-left: auto; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.db { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.df { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.row2 { display: flex; gap: 8px; }
.row2 input { flex: 1; }
.creds { background: #f7f7fa; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-family: Consolas, monospace; line-height: 1.8; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 16px; }
.activity li:last-child { border-bottom: 0; }
.activity time { color: var(--muted); white-space: nowrap; font-size: 12.5px; min-width: 120px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2b2838; color: #fff; padding: 10px 16px; border-radius: 8px; display: none; z-index: 30; }
#toast.err { background: var(--bad); }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } .top { gap: 10px; padding: 0 12px; } .brand span { display: none; } main { padding: 14px 12px 40px; } }
