:root {
  --primary: #1976d2;
  --primary-dark: #115293;
  --primary-light: #e3f2fd;
  --secondary: #00897b;
  --bg-gradient: linear-gradient(135deg, #0d1b2a 0%, #1b263b 50%, #0d1b2a 100%);
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --info: #0284c7;
  --info-bg: #e0f2fe;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.logo-icon {
  font-size: 28px;
}

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

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

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

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Scope Badges */
.scope-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.scope-full {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #86efac;
}

.scope-read_only {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid #7dd3fc;
}

.scope-limited_transfer {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #fde047;
}

/* Balance Hero Card */
.balance-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.balance-card::after {
  content: '🏦';
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-size: 140px;
  opacity: 0.12;
  pointer-events: none;
}

.balance-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
}

.balance-amount {
  font-size: 44px;
  font-weight: 800;
  margin: 8px 0 16px;
}

.active-passkey-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  font-size: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 18px;
  width: 100%;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3);
}

.btn-success {
  background: #16a34a;
  color: #ffffff;
}

.btn-success:hover:not(:disabled) {
  background: #15803d;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

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

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-input, .form-select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  font-size: 15px;
  transition: border-color 0.2s;
  background: #ffffff;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: #2563eb;
}

.form-helper {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Radio Group Cards (for Scope selection) */
.scope-option-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #ffffff;
}

.scope-option-card:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.scope-option-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.scope-option-card input[type="radio"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

/* Tables & Lists */
.tx-list, .passkey-list {
  list-style: none;
}

.tx-item, .passkey-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.tx-item:last-child, .passkey-item:last-child {
  border-bottom: none;
}

.tx-item:hover, .passkey-item:hover {
  background: var(--surface-alt);
}

.tx-main, .passkey-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tx-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.tx-deposit {
  background: #dcfce7;
}

.tx-transfer {
  background: #fee2e2;
}

.tx-amount-plus {
  color: var(--success);
  font-weight: 700;
  font-size: 16px;
}

.tx-amount-minus {
  color: var(--danger);
  font-weight: 700;
  font-size: 16px;
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

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

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

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

/* Footer */
.footer {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  margin-top: 30px;
  padding-bottom: 20px;
}

.hidden {
  display: none !important;
}
