:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --danger: #dc2626;
  --success: #059669;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top right, #eef4ff 0%, var(--bg) 45%);
  color: var(--ink);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

h1 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
h2 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
.subtitle { margin: 0 0 22px; font-size: 14px; color: var(--muted); line-height: 1.6; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.field input, .field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.inline-row { display: flex; gap: 10px; }
.inline-row input { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); text-decoration: none; }
.btn-secondary { background: #f1f5f9; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { background: #e2e8f0; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: #fee2e2; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.links-row {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 13px;
}

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* Dashboard / Account Center */
.center-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 18px 48px;
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title h1 { margin: 0; font-size: 22px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  margin-bottom: 18px;
}

.profile-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.meta-item {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.meta-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.meta-value { font-size: 14px; font-weight: 600; word-break: break-all; }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.app-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #f8fafc;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.app-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.08);
  text-decoration: none;
}
.app-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.app-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.app-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #dbeafe; color: #1e40af; font-weight: 600; }
.app-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.app-cta { font-size: 13px; font-weight: 600; color: var(--primary); }

.session-list { display: flex; flex-direction: column; gap: 10px; }
.session-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafafa;
}
.session-info { font-size: 13px; }
.session-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 22px;
}
