:root {
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;
  --bg-1: #fff4e6;
  --bg-2: #e7f5f4;
  --bg-3: #f8fafc;
  --ink-1: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --accent: #1f8b84;
  --accent-2: #f59e0b;
  --accent-3: #e76f51;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink-1);
  background:
    radial-gradient(circle at top left, rgba(31, 139, 132, 0.2), transparent 45%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.2), transparent 40%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  line-height: 1.5;
}

.bg-shapes::before,
.bg-shapes::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.22;
  z-index: 0;
  animation: float 16s ease-in-out infinite;
}

.bg-shapes::before {
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -80px;
  left: -120px;
}

.bg-shapes::after {
  background: radial-gradient(circle, var(--accent-3) 0%, transparent 70%);
  bottom: -120px;
  right: -80px;
  animation-delay: -6s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(18px);
  }
}

.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 252, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.login-screen[hidden] {
  display: none !important;
}

.login-card {
  width: min(420px, 90vw);
  padding: 32px;
  background: var(--surface);
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
  animation: fadeInUp 0.6s ease;
}

.login-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  font-family: var(--font-display);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 26px;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--ink-3);
  font-size: 14px;
  margin-bottom: 20px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-error {
  color: var(--accent-3);
  font-size: 13px;
  min-height: 18px;
}

.app {
  position: relative;
  z-index: 1;
  padding: 32px 4vw 48px;
  animation: fadeInUp 0.6s ease;
}

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

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

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 28px;
}

.brand-subtitle {
  color: var(--ink-3);
  font-size: 14px;
}

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

.health-card {
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  min-width: 150px;
}

.health-title {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.health-status {
  font-weight: 600;
  color: var(--accent);
}

.user-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 139, 132, 0.15);
  color: var(--accent);
  font-weight: 600;
}

.app-body {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 24px;
}

.nav-btn {
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 600;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn.is-active,
.nav-btn:hover {
  background: var(--surface-strong);
  border-color: var(--border);
  color: var(--ink-1);
  box-shadow: var(--shadow);
}

.app-main {
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  animation: fadeInUp 0.5s ease;
}

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

.panel-header h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 24px;
}

.panel-header p {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
}

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

.panel-body {
  display: grid;
  gap: 16px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--surface-strong);
  border-radius: 20px;
  padding: 18px;
  border: 1px solid var(--border);
}

.card-title {
  color: var(--ink-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-value {
  font-size: 22px;
  font-weight: 600;
  margin-top: 6px;
}

.endpoint-list {
  display: grid;
  gap: 18px;
}

.endpoint-group {
  background: var(--surface-strong);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--border);
}

.endpoint-group h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.endpoint-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 120px;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
  font-size: 14px;
}

.endpoint-item:first-of-type {
  border-top: none;
}

.endpoint-method {
  font-weight: 600;
  color: var(--accent);
}

.endpoint-auth {
  color: var(--ink-3);
}

.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: 14px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  white-space: nowrap;
}

.table th {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.table tr:last-child td {
  border-bottom: none;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.enable {
  background: rgba(31, 139, 132, 0.15);
  color: var(--accent);
}

.badge.disable {
  background: rgba(231, 111, 81, 0.18);
  color: var(--accent-3);
}

.btn {
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31, 139, 132, 0.2);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink-2);
}

.btn-ghost:hover {
  background: var(--surface-strong);
  box-shadow: none;
}

.btn-sm {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.icon-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink-3);
}

.input,
.select,
.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  font-family: var(--font-body);
  font-size: 14px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.2);
  display: grid;
  place-items: center;
  z-index: 6;
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  width: min(760px, 92vw);
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px 24px 24px;
  animation: fadeInUp 0.4s ease;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
}

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

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

.secret-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--surface-strong);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  z-index: 6;
  min-width: 240px;
}

.secret-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.secret-value {
  font-size: 14px;
  font-weight: 600;
  margin: 10px 0 14px;
  word-break: break-all;
}

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  z-index: 6;
}

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

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

  .app-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
