/* ==========================================================================
   Arbitova — Developer Dashboard CSS
   Design: Dark-first, Stripe-inspired fintech aesthetic
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Surfaces */
  --bg: #0a0a0a;
  --surface: #1a1a1a;
  --surface-raised: #222222;
  --border: #2a2a2a;
  --border-light: #333333;

  /* Text */
  --text: #fafafa;
  --text-secondary: #888888;
  --text-dim: #555555;

  /* Accent — teal-green (trust/money) */
  --accent: #00d4aa;
  --accent-hover: #00e8bb;
  --accent-muted: rgba(0, 212, 170, 0.12);
  --accent-border: rgba(0, 212, 170, 0.3);

  /* Semantic */
  --error: #ff4444;
  --error-bg: rgba(255, 68, 68, 0.1);
  --error-border: rgba(255, 68, 68, 0.25);
  --warning: #ffaa00;
  --warning-bg: rgba(255, 170, 0, 0.1);
  --warning-border: rgba(255, 170, 0, 0.25);
  --success: #00cc66;
  --success-bg: rgba(0, 204, 102, 0.1);
  --success-border: rgba(0, 204, 102, 0.25);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  --info-border: rgba(59, 130, 246, 0.25);

  /* Radii */
  --radius-card: 8px;
  --radius-btn: 6px;
  --radius-input: 4px;

  /* Fonts */
  --font-heading: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Sidebar */
  --sidebar-width: 240px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-raised: #f0f0f0;
  --border: #e0e0e0;
  --border-light: #d0d0d0;
  --text: #111111;
  --text-secondary: #666666;
  --text-dim: #999999;
  --accent: #00b892;
  --accent-hover: #00a37f;
  --accent-muted: rgba(0, 184, 146, 0.1);
  --accent-border: rgba(0, 184, 146, 0.3);
  --error-bg: rgba(255, 68, 68, 0.08);
  --warning-bg: rgba(255, 170, 0, 0.08);
  --success-bg: rgba(0, 204, 102, 0.08);
  --info-bg: rgba(59, 130, 246, 0.08);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 2.5rem; letter-spacing: -0.03em; }
h2 { font-size: 2rem; letter-spacing: -0.02em; }
h3 { font-size: 1.5rem; letter-spacing: -0.01em; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background: var(--accent);
  color: #000;
}

/* Fade-in animation — applied to page load */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s var(--ease) both;
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — filled accent */
.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.25);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Secondary — outlined */
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

/* Ghost — text only */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 10px 12px;
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .btn-ghost:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Size variants */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}


/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 20px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.form-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
}


/* ==========================================================================
   BADGE
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}


/* ==========================================================================
   LANDING PAGE
   ========================================================================== */

.landing {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Landing Nav ---------- */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .landing-nav {
  background: rgba(245, 245, 245, 0.85);
}

.landing-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.landing-nav-logo span {
  color: var(--accent);
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.landing-nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.landing-nav-links a:hover {
  color: var(--text);
}

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

/* ---------- Landing Hero ---------- */
.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 120px 40px 80px;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.6s var(--ease) both;
}

.landing-hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.landing-hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, #00e8bb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 40px;
  line-height: 1.7;
}

.landing-hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Landing Code Block ---------- */
.landing-code {
  max-width: 720px;
  margin: 0 auto 100px;
  padding: 0 40px;
  animation: fadeIn 0.6s 0.15s var(--ease) both;
}

.landing-code pre {
  background: #111111;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.landing-code .code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.landing-code .code-header + pre {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Syntax tokens */
.landing-code .token-keyword { color: #c792ea; }
.landing-code .token-string { color: #c3e88d; }
.landing-code .token-comment { color: #546e7a; font-style: italic; }
.landing-code .token-function { color: #82aaff; }
.landing-code .token-number { color: #f78c6c; }
.landing-code .token-operator { color: #89ddff; }
.landing-code .token-property { color: #ffcb6b; }
.landing-code .token-punctuation { color: #89ddff; }

/* ---------- Landing Features ---------- */
.landing-features {
  max-width: 1100px;
  margin: 0 auto 100px;
  padding: 0 40px;
}

.landing-features-title {
  text-align: center;
  margin-bottom: 60px;
}

.landing-features-title h2 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.landing-features-title p {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.feature-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 0 30px rgba(0, 212, 170, 0.06);
}

.feature-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-card);
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- Landing Quote ---------- */
.landing-quote {
  max-width: 800px;
  margin: 0 auto 100px;
  padding: 0 40px;
  text-align: center;
}

.landing-quote blockquote {
  font-size: 1.4rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
  position: relative;
}

.landing-quote blockquote::before {
  content: '\201C';
  font-size: 4rem;
  color: var(--accent);
  position: absolute;
  top: -20px;
  left: -10px;
  line-height: 1;
  opacity: 0.5;
}

.landing-quote cite {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: normal;
}

.landing-quote cite strong {
  color: var(--text);
}

/* ---------- Landing CTA ---------- */
.landing-cta {
  text-align: center;
  padding: 80px 40px;
  margin-bottom: 60px;
}

.landing-cta h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.landing-cta p {
  font-size: 1.05rem;
  margin-bottom: 32px;
  color: var(--text-secondary);
}

.landing-cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ---------- Landing Footer ---------- */
.landing-footer {
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.landing-footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.landing-footer-links a {
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
}

.landing-footer-links a:hover {
  color: var(--text);
}


/* ==========================================================================
   DASHBOARD LAYOUT
   ========================================================================== */

.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo span {
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 8px 12px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 1px 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-btn);
  border-left: 3px solid transparent;
  transition: all 0.15s var(--ease);
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .sidebar-link:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-muted);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar-link-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  opacity: 0.8;
}

.sidebar-link.active .sidebar-link-icon {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px 40px;
  min-height: 100vh;
  overflow-y: auto;
}

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

.main-header h1 {
  font-size: 1.75rem;
}

.page-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 4px;
}


/* ==========================================================================
   STAT CARDS
   ========================================================================== */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

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

.stat-card:hover {
  border-color: var(--border-light);
}

.stat-card-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-card-value.accent {
  color: var(--accent);
}

.stat-card-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 8px;
}

.stat-card-change.positive {
  color: var(--success);
}

.stat-card-change.negative {
  color: var(--error);
}

.stat-card-footer {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 6px;
}


/* ==========================================================================
   TRANSACTION TABLE
   ========================================================================== */

.tx-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 32px;
}

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

.tx-table-header h3 {
  font-size: 1rem;
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.tx-table thead th {
  text-align: left;
  padding: 12px 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tx-table tbody td {
  padding: 14px 20px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

.tx-table tbody tr {
  transition: background 0.15s var(--ease);
}

.tx-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .tx-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.tx-table .tx-amount {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text);
}

.tx-table .tx-id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Transaction status badges */
.tx-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
}

.tx-status-escrowed {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.tx-status-completed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.tx-status-disputed {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}

.tx-status-refunded {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.tx-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}


/* ==========================================================================
   API KEY BOX
   ========================================================================== */

.api-key-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 24px;
}

.api-key-box-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.api-key-box-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.api-key-box-value {
  flex: 1;
  padding: 10px 14px;
  background: #111111;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

[data-theme="light"] .api-key-box-value {
  background: #f0f0f0;
}

.api-key-box-value.masked {
  color: var(--text-dim);
  letter-spacing: 0.15em;
}

.api-key-box-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}


/* ==========================================================================
   CODE BLOCK
   ========================================================================== */

.code-block {
  position: relative;
  background: #111111;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 24px;
  overflow: hidden;
}

[data-theme="light"] .code-block {
  background: #f8f8f8;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

[data-theme="light"] .code-block-header {
  background: rgba(0, 0, 0, 0.03);
}

.code-block-lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-block-copy {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-family: var(--font-body);
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.code-block-copy:hover {
  color: var(--text);
  border-color: var(--border-light);
}

.code-block-copy.copied {
  color: var(--success);
  border-color: var(--success-border);
}

.code-block pre {
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.code-block code {
  font-family: inherit;
}

/* Syntax highlighting tokens */
.token-keyword { color: #c792ea; }
.token-string { color: #c3e88d; }
.token-comment { color: #546e7a; font-style: italic; }
.token-function { color: #82aaff; }
.token-number { color: #f78c6c; }
.token-operator { color: #89ddff; }
.token-property { color: #ffcb6b; }
.token-punctuation { color: #89ddff; }
.token-class { color: #ffcb6b; }
.token-variable { color: #f07178; }
.token-boolean { color: #ff5370; }

[data-theme="light"] .token-keyword { color: #7c4dff; }
[data-theme="light"] .token-string { color: #558b2f; }
[data-theme="light"] .token-comment { color: #90a4ae; }
[data-theme="light"] .token-function { color: #1565c0; }
[data-theme="light"] .token-number { color: #e65100; }


/* ==========================================================================
   QUICK START
   ========================================================================== */

.quick-start {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  margin-bottom: 32px;
}

.quick-start h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.quick-start > p {
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.quick-start-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.quick-start-step {
  display: flex;
  gap: 16px;
}

.quick-start-step-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.quick-start-step-content {
  flex: 1;
  min-width: 0;
}

.quick-start-step-content h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.quick-start-step-content p {
  font-size: 0.85rem;
  margin-bottom: 12px;
}


/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  min-width: 300px;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  font-size: 0.875rem;
  color: var(--text);
  pointer-events: auto;
  animation: toastIn 0.3s var(--ease) both;
}

[data-theme="light"] .toast {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.toast-out {
  animation: toastOut 0.25s var(--ease) both;
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

.toast-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.toast-close {
  flex-shrink: 0;
  padding: 4px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.15s var(--ease);
}

.toast-close:hover {
  color: var(--text);
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }


/* ==========================================================================
   MODAL
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s var(--ease) both;
}

[data-theme="light"] .overlay {
  background: rgba(0, 0, 0, 0.35);
}

.overlay.hidden {
  display: none;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.25s var(--ease) both;
}

[data-theme="light"] .modal {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

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

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

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius-input);
  font-size: 1.2rem;
  transition: all 0.15s var(--ease);
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 680px; }


/* ==========================================================================
   CARDS (generic)
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 1rem;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}


/* ==========================================================================
   MOBILE HAMBURGER
   ========================================================================== */

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 60;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}


/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.text-accent { color: var(--accent); }
.text-secondary { color: var(--text-secondary); }
.text-dim { color: var(--text-dim); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.hidden { display: none !important; }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
  border: none;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 2.5rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 360px;
  margin-bottom: 20px;
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

/* Loading overlay for sections */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}


/* ==========================================================================
   RESPONSIVE — Tablet (<1024px)
   ========================================================================== */

@media (max-width: 1024px) {
  .landing-hero h1 {
    font-size: 2.8rem;
  }

  .landing-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-content {
    padding: 24px 24px;
  }
}


/* ==========================================================================
   RESPONSIVE — Mobile (<768px)
   ========================================================================== */

@media (max-width: 768px) {
  /* Sidebar collapses */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .hamburger {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Stat cards stack */
  .stat-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Tables scroll */
  .tx-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tx-table {
    min-width: 600px;
  }

  /* Landing */
  .landing-nav {
    padding: 12px 20px;
  }

  .landing-nav-links {
    display: none;
  }

  .landing-hero {
    padding: 80px 20px 60px;
  }

  .landing-hero h1 {
    font-size: 2rem;
  }

  .landing-hero p {
    font-size: 1rem;
  }

  .landing-hero-ctas {
    flex-direction: column;
    width: 100%;
  }

  .landing-hero-ctas .btn {
    width: 100%;
  }

  .landing-code {
    padding: 0 16px;
    margin-bottom: 60px;
  }

  .landing-features {
    padding: 0 20px;
    margin-bottom: 60px;
  }

  .landing-features-grid {
    grid-template-columns: 1fr;
  }

  .landing-quote {
    padding: 0 20px;
  }

  .landing-quote blockquote {
    font-size: 1.1rem;
  }

  .landing-cta {
    padding: 60px 20px;
  }

  .landing-cta-actions {
    flex-direction: column;
  }

  .landing-footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 24px 20px;
  }

  /* API key box */
  .api-key-box-row {
    flex-direction: column;
    align-items: stretch;
  }

  .api-key-box-actions {
    justify-content: flex-end;
  }

  /* Quick start */
  .quick-start {
    padding: 20px;
  }

  /* Modal */
  .modal {
    max-height: 90vh;
    margin: 10px;
  }

  /* Toast */
  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }
}


/* ==========================================================================
   RESPONSIVE — Small mobile (<480px)
   ========================================================================== */

@media (max-width: 480px) {
  .landing-hero h1 {
    font-size: 1.7rem;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.15rem; }

  .stat-card-value {
    font-size: 1.6rem;
  }

  .btn-lg {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .code-block pre {
    padding: 16px;
    font-size: 0.78rem;
  }
}


/* ==========================================================================
   SCROLLBAR (dark theme polish)
   ========================================================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #ccc;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}


/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
  .sidebar,
  .hamburger,
  .toast-container,
  .overlay {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  body {
    background: #fff;
    color: #000;
  }
}
