:root {
  --bg: #0b0d12;
  --surface: #141820;
  --surface2: #1c2230;
  --border: #2a3144;
  --text: #eef0f6;
  --muted: #8b93a8;
  --accent: #4f8cff;
  --accent-hover: #3d7aef;
  --success: #3ecf8e;
  --error: #f06464;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card h1 { color: var(--accent); font-size: 1.8rem; }
.login-card p { color: var(--muted); margin-bottom: 8px; }

.login-card input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 1rem;
}

.error { color: var(--error); font-size: 0.85rem; min-height: 1.2em; }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.panel-header h1 { font-size: 1.3rem; }
.panel-header p { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.header-actions { display: flex; gap: 10px; align-items: center; }

.panel-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 80px);
}

.panel-nav {
  width: 220px;
  padding: 20px 12px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
}

.nav-item {
  display: block;
  padding: 10px 14px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}

.nav-item:hover, .nav-item.active {
  background: var(--surface2);
  color: var(--text);
}

.panel-content {
  flex: 1;
  padding: 24px 28px 60px;
  overflow-y: auto;
}

.save-status {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: none;
}

.save-status.show { display: block; }
.save-status.success { background: rgba(62,207,142,0.15); color: var(--success); border: 1px solid rgba(62,207,142,0.3); }
.save-status.error { background: rgba(240,100,100,0.15); color: var(--error); border: 1px solid rgba(240,100,100,0.3); }

.settings-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.settings-group h2 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.group-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.field .hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.field .badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--muted);
  margin-left: 8px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.field textarea { min-height: 100px; resize: vertical; }

.field-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-check input { width: 18px; height: 18px; accent-color: var(--accent); }

.btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); }
.btn-test { background: var(--surface2); color: var(--text); border: 1px solid var(--border); font-size: 0.8rem; padding: 6px 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 768px) {
  .panel-layout { flex-direction: column; }
  .panel-nav { width: 100%; height: auto; position: static; display: flex; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .nav-item { white-space: nowrap; width: auto; }
}
