:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #dfe3e8;
  --text: #1c2430;
  --muted: #6b7684;
  --accent: #2f6feb;
  --danger: #c0392b;
  --warn-bg: #fff6e0;
  --warn-line: #e8c97a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.hidden { display: none !important; }
.screen { min-height: 100vh; }
.center { display: flex; align-items: center; justify-content: center; padding: 24px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); margin: 4px 0 0; }

.card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h1 { margin: 0 0 4px; font-size: 20px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

input, select {
  font: inherit;
  color: var(--text);
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  min-width: 0;
}

input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button {
  font: inherit;
  padding: 9px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover { filter: brightness(1.06); }
button:disabled { opacity: .5; cursor: default; }

button.link {
  background: none;
  color: var(--accent);
  padding: 6px 4px;
}

button.danger { background: var(--danger); }
button.quiet { background: #eceff3; color: var(--text); }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand { font-size: 16px; }
.topbar nav { display: flex; gap: 4px; }

.tab {
  background: none;
  color: var(--muted);
  padding: 6px 12px;
}

.tab.active { background: #eaf0fd; color: var(--accent); }
.who { font-size: 13px; color: var(--muted); }
.quota { font-size: 13px; color: var(--muted); }

main { padding: 20px 16px 48px; max-width: 1100px; margin: 0 auto; }

.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.row-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.row-form input { width: 160px; }

.secret {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.secret code {
  font-size: 16px;
  background: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  user-select: all;
}

.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.grid th, .grid td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}

.grid th { background: #f0f2f5; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.grid tr:last-child td { border-bottom: 0; }
.grid td.actions { white-space: nowrap; text-align: right; }
.grid td.actions button { padding: 5px 10px; font-size: 13px; margin-left: 4px; }
.grid input { width: 90px; padding: 5px 7px; font-size: 13px; }

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #eceff3;
  color: var(--muted);
}

.badge.admin { background: #eaf0fd; color: var(--accent); }
.badge.blocked { background: #fdecea; color: var(--danger); }

tr.is-blocked td:not(.actions) { opacity: .55; }

@media (max-width: 620px) {
  .row-form input { width: 100%; }
  .grid { display: block; overflow-x: auto; }
}
