:root {
  color-scheme: light;
  --bg: #f4efe4;
  --panel: #fffdf8;
  --panel-border: rgba(32, 47, 37, 0.12);
  --sidebar: linear-gradient(180deg, #183326 0%, #224736 100%);
  --text: #1e2f25;
  --muted: #60756b;
  --accent: #0e8f5b;
  --accent-strong: #0b6d46;
  --accent-soft: rgba(14, 143, 91, 0.12);
  --warning: #ca6a2a;
  --danger: #c64d3f;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 20px 40px rgba(24, 51, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(14, 143, 91, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f3ea 0%, #f2ecdf 100%);
  color: var(--text);
  font-family: var(--sans);
}

.page-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: #f4fbf7;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 22px;
  font-weight: 700;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 12px;
  opacity: 0.76;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item {
  color: inherit;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

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

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  line-height: 1.6;
}

.main-content {
  padding: 28px;
  display: grid;
  gap: 20px;
  align-content: start;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

h1 {
  margin: 0;
  font-size: 28px;
}

.config-form,
.OAuthPage-module__cardContent___1sXLA {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label,
.meta-label {
  font-size: 13px;
  color: var(--muted);
}

.input,
.textarea {
  width: 100%;
  border: 1px solid rgba(32, 47, 37, 0.16);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(14, 143, 91, 0.72);
  box-shadow: 0 0 0 4px rgba(14, 143, 91, 0.14);
}

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

.action-row,
.OAuthPage-module__authUrlActions___venPj,
.callback-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

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

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-secondary {
  background: #eff6f2;
  color: var(--text);
}

.btn-sm {
  padding: 10px 14px;
  border-radius: 12px;
}

.hint-block {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--accent-soft);
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.OAuthPage-module__authUrlBox___Iu1d4 {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(14, 143, 91, 0.18);
  background: rgba(14, 143, 91, 0.06);
}

.OAuthPage-module__authUrlLabel___mYFJB {
  margin-bottom: 10px;
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
}

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

.meta-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f7faf8;
  border: 1px solid rgba(32, 47, 37, 0.08);
  display: grid;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(14, 143, 91, 0.16);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 13px;
}

.status-badge.muted {
  background: rgba(96, 117, 107, 0.14);
  color: var(--muted);
}

.status-badge.warn {
  background: rgba(202, 106, 42, 0.14);
  color: var(--warning);
}

.status-badge.error {
  background: rgba(198, 77, 63, 0.14);
  color: var(--danger);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 18px;
  }

  .main-content {
    padding: 18px;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }
}
