:root {
  --bg: #15121b; --panel: #1e1a27; --panel2: #262131; --line: #342e42; --text: #f4eef8; --muted: #a79db6;
  --pink: #f48fc0; --pink-d: #d9709f; --cream: #fff1d2; --ok: #57f287; --bad: #ed4245; --warn: #fbbf24;
  --r: 12px; font-family: system-ui, "Segoe UI", Roboto, sans-serif; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); min-height: 100%; }
body { font-size: 15px; line-height: 1.45; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 15px; color: var(--cream); }
p { margin: 0; } a { color: var(--pink); }
.boot { padding: 60px 20px; text-align: center; color: var(--muted); }

/* login and notice pages */
.gate { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.gate-card { max-width: 420px; width: 100%; text-align: center; display: grid; gap: 14px; padding: 36px 28px; }
.logo { font-size: 52px; }

/* layout */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; font-weight: 700; font-size: 17px; }
.brand span:first-child { font-size: 26px; }
.nav { display: grid; gap: 3px; }
.nav button { all: unset; cursor: pointer; padding: 9px 12px; border-radius: 9px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.nav button:hover { background: var(--panel2); color: var(--text); }
.nav button[aria-current="page"] { background: var(--pink); color: #2a1020; font-weight: 600; }
.nav button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.me { margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); display: grid; gap: 8px; background: var(--panel2); }
.me .who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.me img, .me .ph { width: 34px; height: 34px; border-radius: 50%; background: var(--line); flex: none; }
.me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 28px clamp(16px, 4vw, 44px) 60px; max-width: 1100px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.head p { color: var(--muted); margin-top: 4px; }

/* blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.stack { display: grid; gap: 16px; }
.card > h2 { margin-bottom: 4px; }
.card > .sub { color: var(--muted); margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stat b { display: block; font-size: 26px; color: var(--cream); }
.stat span { color: var(--muted); font-size: 13px; }
.banner { padding: 14px 16px; border-radius: var(--r); border: 1px solid; margin-bottom: 16px; }
.banner.bad { background: #3a1519; border-color: var(--bad); }
.banner.ok { background: #14301f; border-color: #2c6b43; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* forms */
.field { display: grid; gap: 5px; align-content: start; }
.field > label { font-weight: 600; font-size: 13px; color: var(--cream); }
.field .hint { color: var(--muted); font-size: 12.5px; }
input, select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font: inherit; width: 100%; }
select[multiple] { min-height: 150px; }
input:focus, select:focus { border-color: var(--pink); }
.btn { all: unset; cursor: pointer; box-sizing: border-box; padding: 9px 16px; border-radius: 9px; background: var(--pink); color: #2a1020; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }
.btn:hover { background: var(--pink-d); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger:hover { background: #c93a3d; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* lists and tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--panel2); border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: #2c6b43; } .pill.bad { color: #ff8a8c; border-color: #7a2a2d; } .pill.warn { color: var(--warn); border-color: #7a5d12; }
.check { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .why { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 14px 0; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 10; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); box-shadow: 0 8px 28px #0008; }
.toast.ok { border-color: #2c6b43; } .toast.bad { border-color: var(--bad); }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { display: flex; flex-wrap: wrap; }
  .me { margin-top: 0; }
}
