:root {
  --bg-0: #e8eef8;
  --bg-1: #f5f7fc;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-soft: rgba(255, 255, 255, 0.38);
  --border: rgba(255, 255, 255, 0.65);
  --border-dim: rgba(120, 140, 180, 0.18);
  --text: #1a1f36;
  --text-secondary: #4a5568;
  --muted: #7a8499;
  --accent: #007aff;
  --accent-2: #5e5ce6;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.14);
  --amber: #ff9f0a;
  --amber-soft: rgba(255, 159, 10, 0.14);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --shadow: 0 8px 32px rgba(30, 50, 100, 0.08), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  --shadow-lg: 0 20px 60px rgba(30, 50, 100, 0.12), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  --blur: 24px;
  --blur-strong: 40px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(0, 122, 255, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 5%, rgba(94, 92, 230, 0.16) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(52, 199, 89, 0.1) 0%, transparent 45%),
    linear-gradient(165deg, var(--bg-0) 0%, var(--bg-1) 50%, #eef2fa 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  min-height: 100vh;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(var(--blur-strong)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(180%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(0, 122, 255, 0.5);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.auth-card > p {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 15px;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #007aff 0%, #5e5ce6 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(0, 122, 255, 0.4);
  filter: brightness(1.05);
}

.btn-ghost {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--border-dim);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  background: var(--glass-strong);
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(255, 59, 48, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 59, 48, 0.2);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-google,
.btn-github {
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--border-dim);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.btn-google {
  background: var(--glass-strong);
  color: var(--text);
}

.btn-google:hover {
  background: #fff;
  box-shadow: var(--shadow);
}

.btn-github {
  background: rgba(36, 41, 47, 0.9);
  color: #fff;
  border-color: transparent;
}

.btn-github:hover {
  background: #24292f;
  box-shadow: 0 4px 16px rgba(36, 41, 47, 0.3);
}

.glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
}

.btn-github .glyph {
  background: rgba(255, 255, 255, 0.15);
}

.notice {
  min-height: 20px;
  font-size: 13px;
  color: var(--red);
  margin: 0 0 16px;
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.features li {
  position: relative;
  padding-left: 22px;
  font-size: 13px;
  color: var(--text-secondary);
}

.features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--green));
  box-shadow: 0 0 8px rgba(0, 122, 255, 0.35);
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: var(--glass-soft);
}

.identity-name {
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spacer {
  flex: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--glass-soft);
  border: 1px solid var(--border-dim);
  color: var(--muted);
  backdrop-filter: blur(8px);
}

.badge.active {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(52, 199, 89, 0.25);
}

.badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: rgba(255, 159, 10, 0.25);
}

.badge.error {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(255, 59, 48, 0.25);
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin-bottom: 18px;
  background: var(--glass-soft);
  border: 1px solid var(--border-dim);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.4);
}

.tab.active {
  background: var(--glass-strong);
  color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 122, 255, 0.12), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.panel {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  background: var(--glass-strong);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: 0 4px 16px rgba(30, 50, 100, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(30, 50, 100, 0.1);
}

.card-title {
  font-weight: 650;
  font-size: 15px;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.card-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

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

.empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
  font-size: 14px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input,
.field textarea,
.panel-head input,
input[type='text'],
input[type='search'],
textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-dim);
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.field input:focus,
.field textarea:focus,
.panel-head input:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

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

.hint {
  font-size: 12px;
  color: var(--muted);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-dim);
}

.switch-row:last-of-type {
  border-bottom: none;
}

.switch-text {
  flex: 1;
  min-width: 0;
}

.switch-text strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 2px;
}

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

.switch {
  position: relative;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  background: rgba(120, 130, 150, 0.25);
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.25s;
}

.switch span::before {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::before {
  transform: translateX(20px);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--glass-soft);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  font-size: 13px;
}

.activity-item .time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  min-width: 70px;
}

.activity-item .msg {
  flex: 1;
  color: var(--text-secondary);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 50, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(var(--blur-strong)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(180%);
  animation: modalIn 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 14px;
}

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

.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1100;
  max-width: 360px;
}

.toast {
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.toast.success {
  border-color: rgba(52, 199, 89, 0.3);
  color: #1a7a3a;
}

.toast.error {
  border-color: rgba(255, 59, 48, 0.3);
  color: var(--red);
}

.toast.info {
  border-color: rgba(0, 122, 255, 0.3);
  color: var(--accent);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.5);
}

.status-dot.pending {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(255, 159, 10, 0.5);
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.5);
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
  }

  .auth-card {
    padding: 28px 22px;
  }

  .panel {
    padding: 16px;
  }

  .tabs {
    overflow-x: auto;
  }

  .toast-stack {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}
