:root {
  --bg: #EDEFEC;
  --card: #F4F5F2;
  --line: #DDE0DB;
  --ink: #24302B;
  --muted: #9AA39C;
  --accent: #2E8B6F;
  --danger: #C62828;
  --ok: #2E7D32;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
}
.hidden { display: none !important; }

.screen {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}

.card {
  width: min(360px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 22px;
  box-shadow: 0 8px 28px rgba(36,48,43,0.08);
}
.card.wide { width: min(420px, 100%); }
.card.wide-panel { width: min(480px, 100%); }

.logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(145deg, var(--accent), #267a62);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 16px;
}

h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

input[type=password] {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); font-size: 18px; letter-spacing: 0.15em;
  margin-bottom: 12px; background: #fff;
}
input:focus { outline: 2px solid rgba(46,139,111,0.35); border-color: var(--accent); }

.btn {
  border: none; border-radius: 12px; padding: 14px 18px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
.btn.primary { width: 100%; background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); padding: 8px 12px; }

.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }

.status-block {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  margin-bottom: 22px;
}
.dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  background: var(--muted);
}
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(46,125,50,0.15); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 4px rgba(198,40,40,0.12); }
.status-label { font-weight: 700; font-size: 16px; }
.status-detail { font-size: 13px; color: var(--muted); margin-top: 2px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px; font-size: 16px; font-weight: 600;
  -webkit-user-select: none; user-select: none;
}

.switch { position: relative; width: 52px; height: 32px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #c5ccc7; border-radius: 999px; transition: .2s;
}
.slider:before {
  content: ""; position: absolute; width: 26px; height: 26px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: .2s; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: 0.5; cursor: wait; }

.error { color: var(--danger); font-size: 14px; margin: 12px 0 0; }
.ok { color: var(--ok); font-size: 14px; margin: 12px 0 0; }

.section-title {
  margin: 24px 0 10px; font-size: 15px; font-weight: 700;
}
.users-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
}
.user-meta { min-width: 0; flex: 1; }
.user-login { font-weight: 700; font-size: 15px; }
.user-name { font-size: 13px; color: var(--muted); margin-top: 2px; }
.user-status { font-size: 12px; margin-top: 4px; }
.user-status.blocked { color: var(--danger); font-weight: 600; }
.user-status.ok { color: var(--ok); }
.btn.sm {
  padding: 8px 12px; font-size: 13px; flex-shrink: 0;
  min-width: 120px;
}
.btn.danger { background: var(--danger); color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
