:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --primary:#2563eb;
  --danger:#dc2626;
  --blue:#2563eb;
  --green:#16a34a;
  --amber:#f59e0b;
  --shadow:0 6px 24px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.06);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color:var(--text); background:var(--bg);
}
.app-header{
  position:sticky; top:0; z-index:10; background:var(--card); box-shadow:var(--shadow);
  display:flex; align-items:center; justify-content:space-between; padding:12px 20px;
}
.brand{display:flex; gap:12px; align-items:center}
.logo{font-size:28px}
.title h1{font-size:18px; margin:0}
.subtitle{margin:2px 0 0; color:var(--muted); font-size:12px}

.status-wrap{display:flex; gap:8px}

.container{max-width:1200px; margin:20px auto; padding:0 16px; display:flex; flex-direction:column; gap:16px}

.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow)}
.card-header{display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border-bottom:1px solid var(--line)}
.card-header h2{margin:0; font-size:16px}
.card-body{padding:16px}
.card-body.no-pad{padding:0}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start}
.grid12{display:grid; grid-template-columns:7fr 5fr; gap:16px}
.col-7{grid-column:1}
.col-5{grid-column:2}
@media(max-width:1000px){
  .grid12{grid-template-columns:1fr}
  .col-7,.col-5{grid-column:auto}
  .grid2{grid-template-columns:1fr}
}

.field label{display:block; font-weight:600; margin-bottom:6px}
.input, input[type="text"], input[type="password"]{
  width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:#fff; font-size:14px;
}
.input-with-actions{display:flex; gap:8px}
.input-with-actions input{flex:1}

.checkbox{display:inline-flex; align-items:center; gap:8px; user-select:none}
.checkbox input{width:16px; height:16px}

.actions{display:flex; gap:8px; align-items:center}

.btn{
  border:1px solid var(--line); background:#fff; padding:9px 14px; border-radius:10px; cursor:pointer; font-weight:600;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.btn:disabled{opacity:.5; cursor:not-allowed}
.btn-primary{background:var(--primary); color:#fff; border-color:transparent}
.btn-danger{background:var(--danger); color:#fff; border-color:transparent}
.btn-light{background:#f3f4f6}

.badge{
  display:inline-block; padding:4px 8px; border-radius:999px; font-size:12px; border:1px solid var(--line); background:#fff;
}
.badge-gray{background:#eef2ff; border-color:#e5e7eb}
.badge-blue{background:#dbeafe; border-color:#bfdbfe}
.badge-green{background:#dcfce7; border-color:#bbf7d0}
.badge-red{background:#fee2e2; border-color:#fecaca}

.table{width:100%; border-collapse:collapse; font-size:14px}
.table th,.table td{padding:10px 12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle}
.table tr:hover{background:#fafafa}

.list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px}
.list li{padding:8px 10px; border:1px solid var(--line); border-radius:10px; display:flex; justify-content:space-between; align-items:center; background:#fff}

.console{
  height:280px; overflow:auto; background:#0b1020; color:#d1e7ff; border-radius:12px; padding:12px; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:12px;
  border:1px solid #0d1b2a;
}
.console .line{white-space:pre-wrap; margin:0}
.console .tag{display:inline-block; margin-right:8px; padding:1px 6px; border-radius:6px; font-size:11px}
.tag-join{background:#064e3b; color:#a7f3d0}
.tag-quit{background:#7c2d12; color:#fed7aa}
.tag-log{background:#1e293b; color:#cbd5e1}
.tag-other{background:#3b0764; color:#e9d5ff}

.dot{width:10px; height:10px; border-radius:50%; display:inline-block; vertical-align:middle; margin-right:6px}
.online{background:var(--green)}
.offline{background:#9ca3af}

.footer{display:flex; justify-content:space-between; align-items:center; padding:16px; color:var(--muted)}

.toast{
  position:fixed; left:50%; transform:translateX(-50%); bottom:20px; background:#111827; color:#fff; padding:10px 14px; border-radius:10px; box-shadow:var(--shadow); opacity:0; pointer-events:none; transition:opacity .25s;
}
.toast.show{opacity:1}

.right{display:flex; align-items:center; gap:8px}
.filters{flex-wrap:wrap}

.muted{color:var(--muted); font-size:12px}

.radio-center{display:flex; justify-content:center}
