/* dashboard.css — developer portal */

.dash-page {
  min-height: 100dvh;
  background: var(--bg);
}

/* ── Nav ── */
.dash-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.dash-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.auth-logo-mark {
  color: var(--accent);
  font-size: 1.2rem;
}

.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dash-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.dash-nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.dash-nav-links a:hover,
.dash-nav-links a.active {
  color: var(--fg);
}

/* "What's new" changelog badge in dashboard nav */
.dash-nav-whats-new {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.dash-nav-new-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.dash-email {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.dash-logout {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  color: var(--fg-dim);
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.dash-logout:hover {
  color: var(--fg);
  border-color: var(--fg-dim);
}

/* ── Main layout ── */
.dash-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Welcome banner ── */
.dash-welcome-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(0, 212, 170, 0.07);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

.banner-icon {
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.dash-welcome-banner strong {
  color: var(--fg);
}

/* ── Key reveal ── */
.dash-key-reveal {
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: var(--radius);
  padding: 24px;
}

.key-reveal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.key-reveal-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 170, 0.2);
  padding: 4px 12px;
  border-radius: 100px;
}

.key-reveal-warning {
  font-size: 0.82rem;
  color: #ffcc33;
}

.key-reveal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow: hidden;
}

.key-reveal-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--fg);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.key-copy-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.key-copy-btn:hover { opacity: 0.8; }

.key-reveal-hint {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--fg-dim);
}

.key-reveal-hint code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Stats row ── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.dash-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}

.dash-stat:hover { border-color: rgba(0, 212, 170, 0.2); }

.dash-stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 10px;
}

.dash-stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
}

.dash-stat-sub {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--fg-dim);
}

/* ── Cards ── */
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.dash-card-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.dash-chart-wrap {
  padding: 20px 24px 16px;
}

/* ── Table ── */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dash-table thead th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

.dash-table tbody tr {
  border-bottom: 1px solid rgba(30, 30, 42, 0.6);
  transition: background 0.15s;
}

.dash-table tbody tr:last-child { border-bottom: none; }
.dash-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.dash-table td {
  padding: 14px 24px;
  color: var(--fg);
}

.key-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.td-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}

.td-muted { color: var(--fg-dim) !important; }

.dash-empty {
  padding: 32px 24px;
  color: var(--fg-dim);
  font-size: 0.9rem;
}

.dash-empty-state {
  text-align: center;
  padding: 40px 24px;
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.dash-empty-state .empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}

.dash-empty-state .empty-desc {
  font-size: 0.85rem;
  color: var(--fg-dim);
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ── Onboarding checklist ── */
.dash-checklist {
  border-color: rgba(0,212,170,0.2);
}

.dash-checklist .dash-card-header {
  border-color: rgba(0,212,170,0.15);
}

.checklist-items {
  display: flex;
  flex-direction: column;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item:hover {
  background: rgba(255,255,255,0.02);
}

.checklist-item.done .checklist-marker {
  background: rgba(0,212,170,0.12);
  border-color: rgba(0,212,170,0.3);
  color: var(--accent);
}

.checklist-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checklist-content {
  flex: 1;
  min-width: 0;
}

.checklist-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 3px;
}

.checklist-desc {
  font-size: 0.8rem;
  color: var(--fg-dim);
  line-height: 1.5;
}

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

.checklist-desc a:hover {
  text-decoration: underline;
}

.checklist-item.done .checklist-title,
.checklist-item.done .checklist-desc {
  color: var(--fg-muted);
}

/* ── Buttons ── */
.dash-btn-sm {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.dash-btn-sm:hover { opacity: 0.8; }

.dash-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0a0a0f;
  background: var(--accent);
  border: none;
  border-radius: 7px;
  padding: 10px 20px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.dash-btn:hover { opacity: 0.9; }
.dash-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.dash-btn-outline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 20px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.dash-btn-outline:hover { border-color: var(--fg-dim); }

/* ── Code card ── */
.dash-card-code .code-block {
  border: none;
  border-radius: 0;
}

/* ── Billing note ── */
.dash-billing-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.85rem;
  color: var(--fg-dim);
  line-height: 1.6;
}

.dash-billing-note svg { flex-shrink: 0; margin-top: 1px; }

.dash-billing-note strong { color: var(--fg); }

.dash-billing-note a {
  color: var(--accent);
  text-decoration: none;
}

.dash-billing-note a:hover { text-decoration: underline; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 440px;
}

.modal-box h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

/* ── Responsive ── */
@media (max-width: 600px) {
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .dash-stats .dash-stat:last-child { grid-column: span 2; }
  .dash-nav { padding: 0 16px; }
  .dash-main { padding: 24px 16px 60px; }
  .auth-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .dash-stats { grid-template-columns: 1fr; }
  .dash-stats .dash-stat:last-child { grid-column: span 1; }

  .dash-table { overflow-x: auto; display: block; }
  .dash-table thead { white-space: nowrap; }

  .key-reveal-row { flex-wrap: wrap; }
  .key-reveal-code { font-size: 11px; }

  .dash-logout { min-height: 44px; }
  .dash-btn { min-height: 44px; }
  .dash-btn-sm { min-height: 44px; }
  .dash-btn-outline { min-height: 44px; }

  .modal-box { padding: 24px 16px; }
}
