/* ═══════════════════════════════════════════════
   DietorPay — Design System
   ═══════════════════════════════════════════════ */

:root {
  /* Colors — Dark mode with Lightning accent */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a26;
  --bg-card-hover: #22222e;
  --bg-input: #14141e;
  --bg-elevated: #1e1e2a;
  
  --border: #2a2a3a;
  --border-focus: #f7931a;
  --border-subtle: #1e1e2e;
  
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --text-inverse: #0a0a0f;
  
  --accent: #f7931a;
  --accent-hover: #ffaa33;
  --accent-glow: rgba(247, 147, 26, 0.15);
  --accent-glow-strong: rgba(247, 147, 26, 0.3);
  
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #eab308;
  --warning-bg: rgba(234, 179, 8, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);

  --gradient-hero: linear-gradient(135deg, #0a0a0f 0%, #1a0f00 50%, #0a0a0f 100%);
  --gradient-card: linear-gradient(135deg, var(--bg-card) 0%, #1e1a28 100%);
  --gradient-accent: linear-gradient(135deg, #f7931a, #ff6b00);
  --gradient-glow: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--accent-glow), transparent 40%);
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════════ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

/* ═══════════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════════ */

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.mono {
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════
   Navigation
   ═══════════════════════════════════════════════ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.95);
  border-bottom-color: var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.nav-brand img, .nav-brand svg {
  width: 32px;
  height: 32px;
}

.nav-brand span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bitcoin-nav-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  max-width: 260px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(26, 26, 38, 0.82);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.bitcoin-status-dot {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.45);
}

.bitcoin-status-dot.synced {
  background: var(--success);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.bitcoin-status-dot.unavailable {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

.bitcoin-status-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.bitcoin-status-fees {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: normal;
}

/* ═══════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-accent);
  color: var(--text-inverse);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow-strong);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════
   Inputs
   ═══════════════════════════════════════════════ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
}

.withdraw-scan-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.withdraw-scanner {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}

.withdraw-scanner[hidden] {
  display: none;
}

.withdraw-scanner video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg-primary);
}

.withdraw-scanner-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* ═══════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(247, 147, 26, 0.2);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-glow {
  position: relative;
  overflow: hidden;
}

.card-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.card-glow:hover::before {
  opacity: 1;
}

/* ═══════════════════════════════════════════════
   Hero / Landing
   ═══════════════════════════════════════════════ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 30px); }
}

.hero-content {
  max-width: 800px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: var(--accent-glow);
  border: 1px solid rgba(247, 147, 26, 0.3);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.hero h1 .highlight {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border-subtle);
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}

.hero-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Features Section */
.features {
  padding: 6rem 2rem;
  background: var(--bg-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.feature-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-slow);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(247, 147, 26, 0.3);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-glow);
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.section-header h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
}

/* ═══════════════════════════════════════════════
   Auth Modal
   ═══════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  max-width: 440px;
  width: 100%;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.modal-footer a {
  font-weight: 600;
}

.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 0.25rem;
}

.password-strength-bar {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--transition);
}

.password-strength-bar.active-weak { background: var(--danger); }
.password-strength-bar.active-medium { background: var(--warning); }
.password-strength-bar.active-strong { background: var(--success); }

/* ═══════════════════════════════════════════════
   Dashboard
   ═══════════════════════════════════════════════ */

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
}

.sidebar {
  grid-row: 1 / -1;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
  font-weight: 800;
  font-size: 1.125rem;
}

.sidebar-brand img {
  width: 28px;
  height: 28px;
}

.sidebar-brand span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.sidebar-link .icon {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
}

.sidebar-section-label {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  cursor: default;
  user-select: none;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.5rem 0.75rem;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.dashboard-bitcoin-status {
  width: 100%;
  max-width: none;
  margin-bottom: 0.75rem;
  justify-content: flex-start;
}

.dashboard-bitcoin-status-mobile {
  display: none;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 1rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-inverse);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dashboard main content */
.dash-main {
  padding: 2rem;
  overflow-y: auto;
  max-height: 100vh;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.dash-header h1 {
  font-size: 1.75rem;
}

.dash-greeting {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

/* Balance Cards */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.balance-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.balance-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-glow);
  transform: translate(40px, -40px);
  pointer-events: none;
}

.balance-card.btc { border-top: 2px solid var(--accent); }
.balance-card.chf { border-top: 2px solid var(--success); }
.balance-card.chf::after { background: var(--success-bg); }

.balance-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.balance-amount {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  position: relative;
  z-index: 1;
}

.balance-amount .currency {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-left: 0.25rem;
}

.balance-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════
   Dashboard Sections
   ═══════════════════════════════════════════════ */

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

/* Invoice Creator */
.invoice-creator {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.amount-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.amount-preset {
  padding: 0.375rem 0.875rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--transition);
}

.amount-preset:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* Invoice Result */
.invoice-result {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  display: none;
}

.invoice-result.show {
  display: block;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.qr-placeholder {
  width: 200px;
  height: 200px;
  margin: 1rem auto;
  background: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #333;
  padding: 0.5rem;
  word-break: break-all;
  font-family: var(--font-mono);
}

.qr-code-container {
  width: 240px;
  height: 240px;
  margin: 1.5rem auto;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-container svg {
  width: 100%;
  height: 100%;
}

.invoice-amount-display {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.5rem 0;
  font-family: var(--font-mono);
}

.invoice-string {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  word-break: break-all;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.invoice-string:hover {
  border-color: var(--accent);
}

.invoice-status {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.invoice-status.pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.invoice-status.settled {
  background: var(--success-bg);
  color: var(--success);
}

/* Invoice History */
.invoice-history-list {
  display: flex;
  flex-direction: column;
}

.invoice-history-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.invoice-history-item:last-child {
  border-bottom: none;
}

.invoice-history-item:hover {
  background: var(--bg-hover);
}

.invoice-history-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}

.invoice-history-item.settled .invoice-history-icon {
  background: var(--success-bg);
}

.invoice-history-item.expired .invoice-history-icon {
  background: var(--bg-input);
  opacity: 0.6;
}

.invoice-history-item.pending .invoice-history-icon {
  background: var(--warning-bg);
}

.invoice-history-details {
  flex: 1;
  min-width: 0;
}

.invoice-history-amount {
  font-weight: 700;
  font-size: 0.9375rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.invoice-history-memo {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-history-memo .no-memo {
  font-style: italic;
  color: var(--text-muted);
}

.invoice-history-meta {
  text-align: right;
  flex-shrink: 0;
}

.invoice-history-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  display: inline-block;
}

.invoice-history-status.status-settled {
  background: var(--success-bg);
  color: var(--success);
}

.invoice-history-status.status-pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.invoice-history-status.status-expired {
  background: var(--bg-input);
  color: var(--text-muted);
}

.invoice-history-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Admin */
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.admin-stat span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.admin-stat strong {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  white-space: nowrap;
}

.admin-table-wrap {
  max-height: min(640px, calc(100vh - 18rem));
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.admin-table th,
.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 1px 0 var(--border);
}

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

.admin-user-cell {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-width: 0;
}

.admin-user-cell strong,
.admin-user-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-balance-cell {
  display: flex;
  flex-direction: row !important;
  align-items: baseline;
  gap: 0.6rem !important;
}

.admin-amount-cell {
  white-space: nowrap;
}

.admin-user-cell span,
.admin-table td.mono span,
.admin-node-meta {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.admin-node-badge {
  display: inline-flex;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-node-badge.yes {
  background: var(--success-bg);
  color: var(--success);
}

.admin-node-badge.no {
  background: var(--bg-input);
  color: var(--text-muted);
}

.admin-empty {
  color: var(--text-muted);
  text-align: center !important;
  padding: 2rem !important;
}

/* Withdrawal & Conversion */
.action-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.action-tab {
  flex: 1;
  padding: 0.875rem;
  text-align: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.action-tab:hover {
  color: var(--text-primary);
}

.action-tab.active {
  color: var(--accent);
}

.action-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Conversion estimate */
.conversion-estimate {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
}

.estimate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.estimate-row:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

.estimate-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.estimate-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9375rem;
}

.estimate-value.chf {
  color: var(--success);
}

/* Transaction History */
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.tx-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition);
}

.tx-item:hover {
  border-color: var(--border);
}

.tx-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.tx-icon.deposit { background: var(--success-bg); }
.tx-icon.withdrawal { background: var(--danger-bg); }
.tx-icon.conversion { background: var(--info-bg); }

.tx-details {
  flex: 1;
  min-width: 0;
}

.tx-type {
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: capitalize;
}

.tx-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tx-amount {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.875rem;
}

.tx-amount.positive { color: var(--success); }
.tx-amount.negative { color: var(--danger); }

/* ═══════════════════════════════════════════════
   Alerts / Toast
   ═══════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease-out;
  border: 1px solid;
}

.toast.success {
  background: var(--success-bg);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.toast.error {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.toast.info {
  background: var(--info-bg);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--info);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════
   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); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  gap: 0.75rem;
}

/* ═══════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════ */

.footer {
  padding: 3rem 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
  .navbar {
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
  }

  .nav-links {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .bitcoin-nav-status {
    order: -1;
    max-width: 100%;
    font-size: 0.75rem;
    padding: 0.45rem 0.6rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .dashboard-bitcoin-status-mobile {
    display: inline-flex;
  }

  .mobile-nav {
    display: flex !important;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .withdraw-scan-actions,
  .withdraw-scanner-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-table-wrap {
    max-height: min(560px, calc(100vh - 16rem));
    border-radius: var(--radius-sm);
  }

  .modal {
    padding: 1.5rem;
  }
}

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 0.5rem;
  justify-content: space-around;
  z-index: 100;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-family: var(--font-sans);
  cursor: pointer;
}

.mobile-nav-btn.active {
  color: var(--accent);
}

.mobile-nav-btn .icon {
  font-size: 1.25rem;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
