:root {
  --blue: #2098f3;
  --bg: #f4f6fa;
  --text: #20242a;
  --muted: #7f8792;
  --line: #e7eaf0;
  --danger: #e5484d;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

.auth-view {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  background: linear-gradient(145deg, #24a6ff 0%, #0876df 58%, #065fc2 100%);
}

.auth-bg,
.auth-bubble {
  position: absolute;
  inset: 0;
}

.auth-bubble {
  width: 420px;
  height: 280px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.auth-bubble.one {
  left: -130px;
  top: -80px;
}

.auth-bubble.two {
  inset: auto -150px 90px auto;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 30px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(0, 42, 100, 0.25);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-logo {
  flex: 0 0 auto;
  background: var(--blue);
}

.auth-logo::before {
  background: var(--blue);
}

.auth-brand h1 {
  font-size: 24px;
}

.auth-brand p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: grid;
  gap: 14px;
}

.password-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -3px;
}

.remember {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.remember input {
  width: auto;
  min-height: auto;
}

.link-btn {
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
}

.auth-submit,
.auth-secondary {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
}

.auth-submit {
  margin-top: 4px;
  color: #fff;
  background: var(--blue);
}

.auth-secondary {
  color: var(--blue);
  background: #eaf6ff;
}

.auth-tip {
  color: #8a93a0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.app-view {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  padding: 24px 18px;
  color: #fff;
  background: linear-gradient(180deg, #1fa2fb, #0874df);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.brand-icon {
  position: relative;
  width: 44px;
  height: 34px;
  background: #fff;
  border-radius: 8px;
}

.brand-icon::before {
  position: absolute;
  left: 0;
  top: -9px;
  width: 22px;
  height: 14px;
  content: "";
  background: #fff;
  border-radius: 7px 7px 0 0;
}

.brand strong, .brand span { display: block; }
.brand span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.nav-item {
  display: block;
  width: 100%;
  height: 42px;
  margin-bottom: 10px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.main {
  margin-left: 240px;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

h1, h2, p { margin: 0; }
h1 { font-size: 28px; }
.topbar p {
  margin-top: 8px;
  color: var(--muted);
}

.server-tip {
  padding: 10px 14px;
  color: #526071;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section { display: none; }
.section.active { display: block; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card, .panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31, 53, 86, 0.05);
}

.stat-card { padding: 18px; }
.stat-card span {
  color: var(--muted);
  font-size: 13px;
}
.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
}

.panel { padding: 20px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.panel-head h2 { font-size: 18px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #59616c;
  font-size: 13px;
}

.wide { grid-column: 1 / -1; }

input, textarea, select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(32, 152, 243, 0.12);
}

.primary, .ghost, .danger-btn, .icon-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
}

.primary {
  color: #fff;
  background: var(--blue);
}

.ghost {
  color: var(--blue);
  background: #eaf6ff;
}

.danger-btn {
  color: #fff;
  background: var(--danger);
}

.icon-btn {
  width: 38px;
  padding: 0;
  color: #6b7280;
  background: #f2f4f7;
  font-size: 22px;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toggle-card strong {
  display: block;
  margin-bottom: 5px;
}

.toggle-card span {
  color: var(--muted);
  font-size: 12px;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
}

.switch input { display: none; }

.slider {
  position: absolute;
  inset: 0;
  background: #c8ced8;
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  content: "";
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.actions {
  display: flex;
  gap: 10px;
}

.actions input { width: 220px; }
.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: #647084;
  font-size: 12px;
  font-weight: 600;
  background: #f8fafc;
}

td { font-size: 14px; }

.status {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.status.active {
  color: #0f8b52;
  background: #e8f8ef;
}

.status.expired {
  color: #997018;
  background: #fff5d7;
}

.status.deleted {
  color: #b42328;
  background: #ffe8e8;
}

.status.paused {
  color: #7a4d00;
  background: #fff1cc;
}

.status.banned {
  color: #b42328;
  background: #ffe4e4;
}

.reason-cell {
  max-width: 260px;
  color: #667085;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 23, 38, 0.42);
}

.modal.hidden { display: none; }

.modal-card {
  width: min(720px, 100%);
  padding: 22px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(16, 24, 40, 0.22);
}

.check-row {
  flex-direction: row;
  align-items: center;
  margin-top: 14px;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .main {
    margin-left: 0;
    padding: 18px;
  }

  .stats-grid, .form-grid, .toggle-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
