:root {
  --bg: #f3f5f8;
  --panel: #fff;
  --text: #152033;
  --muted: #667085;
  --line: #d9e0ea;
  --brand: #1a4fd6;
  --danger: #b42318;
  --ok: #067647;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(21, 32, 51, 0.06);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 400px at 10% -10%, #dbe7ff 0%, transparent 60%),
    var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }
.wrap { width: min(1200px, calc(100% - 2rem)); margin: 2rem auto 3rem; }
.wrap.narrow { width: min(420px, calc(100% - 2rem)); }
h1, h2 { margin: 0 0 0.35rem; }
.muted { color: var(--muted); margin: 0; }
.top, .editor-head, .aside-head, .actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}
aside, .panel, #login-view {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
aside { padding: 1rem; }
.panel, #login-view { padding: 1.25rem; }
#tenant-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}
#tenant-list li button {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
#tenant-list li button small {
  color: var(--muted);
  font-weight: 500;
}
#tenant-list li button:hover,
#tenant-list li button.active {
  background: #eef3ff;
  border-color: #c9d7ff;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}
label.block { margin-top: 0.9rem; }
.site-line { margin-top: 1rem; }
label.check {
  flex-direction: row;
  align-items: center;
  font-weight: 500;
}
input, textarea, button {
  font: inherit;
}
input, textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
button {
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: #e8eefc;
  color: var(--brand);
  font-weight: 650;
  cursor: pointer;
}
button.primary { background: var(--brand); color: #fff; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.error { color: var(--danger); min-height: 1.2em; }
.status { min-height: 1.4em; margin: 0.5rem 0 0; }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }
#login-form { display: grid; gap: 0.85rem; margin-top: 1rem; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}
