@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* ============================================================
   BitRent — Design System
   Dark Bitcoin theme: #F7931A orange on #0a0a0a black
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --btc: #F7931A;
  --btc-dark: #d4780d;
  --btc-glow: rgba(247, 147, 26, 0.2);
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;

  --nostr: #9333ea;
  --nostr-glow: rgba(147, 51, 234, 0.15);

  --bg0: #080808;
  --bg1: #0f0f0f;
  --bg2: #171717;
  --bg3: #222222;
  --border: #2a2a2a;
  --border-bright: #3a3a3a;

  --text: #f1f1f1;
  --text-muted: #888;
  --text-dim: #555;

  --radius: 8px;
  --radius-lg: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--btc); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.page { padding: 32px 0 80px; }

/* ---- Nav ---- */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,8,8,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { font-size: 1.25rem; font-weight: 700; color: var(--btc); letter-spacing: -0.5px; }
.nav-brand span { color: var(--text-muted); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-user { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }
.nav-badge {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 10px; font-size: 0.75rem;
}
.nav-badge.admin { border-color: var(--btc); color: var(--btc); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.875rem; font-weight: 600; font-family: var(--font);
  padding: 10px 20px; border-radius: var(--radius); border: none;
  cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-primary {
  background: var(--btc); color: #000;
}
.btn-primary:hover { background: #ffa030; box-shadow: 0 0 16px var(--btc-glow); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-bright); background: var(--bg2); }
.btn-danger { background: #2d1111; color: var(--red); border: 1px solid #4a1212; }
.btn-danger:hover { background: #3d1414; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-bright); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ---- Cards ---- */
.card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-sm { padding: 16px; }
.card:hover { border-color: var(--border-bright); }
.card.highlight { border-color: var(--btc); box-shadow: 0 0 24px var(--btc-glow); }

/* ---- Miner Cards Grid ---- */
.miners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.miner-card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; cursor: pointer;
  transition: all 0.2s ease; position: relative;
}
.miner-card:hover { border-color: var(--btc); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.miner-card.unavailable { opacity: 0.5; cursor: not-allowed; }
.miner-card.unavailable:hover { transform: none; border-color: var(--border); }

.miner-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.miner-name { font-size: 1rem; font-weight: 600; }
.miner-model { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.miner-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.miner-stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.miner-stat-value { font-size: 1.1rem; font-weight: 600; margin-top: 2px; }
.miner-stat-value.btc { color: var(--btc); }

/* ---- Status Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-online { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-offline { background: rgba(239,68,68,0.12); color: var(--red); }
.badge-active { background: rgba(247,147,26,0.15); color: var(--btc); }
.badge-pending { background: rgba(234,179,8,0.12); color: var(--yellow); }
.badge-completed { background: rgba(136,136,136,0.12); color: var(--text-muted); }
.badge-rented { background: rgba(239,68,68,0.12); color: var(--red); }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  width: 100%; max-width: 480px; max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px); transition: transform 0.2s ease;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-title { font-size: 1.15rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.4rem; padding: 0 4px; }
.modal-close:hover { color: var(--text); }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
input, select, textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font);
  font-size: 0.9rem; padding: 10px 14px; transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--btc); }
select option { background: var(--bg3); }

/* ---- Duration Selector ---- */
.duration-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.duration-btn {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 4px;
  text-align: center; cursor: pointer; transition: all 0.15s;
  font-size: 0.85rem; color: var(--text-muted);
}
.duration-btn:hover { border-color: var(--btc); color: var(--text); }
.duration-btn.selected { background: var(--btc-glow); border-color: var(--btc); color: var(--btc); font-weight: 600; }
.duration-label { font-size: 0.75rem; display: block; margin-top: 2px; color: var(--text-dim); }
.duration-btn.selected .duration-label { color: var(--btc-dark); }

/* ---- Price Summary ---- */
.price-summary {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin: 16px 0;
}
.price-row { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 8px; }
.price-row:last-child { margin-bottom: 0; border-top: 1px solid var(--border); padding-top: 10px; font-weight: 700; font-size: 1rem; }
.price-btc { color: var(--btc); }

/* ---- QR Code Payment ---- */
.qr-wrapper {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 20px 0;
}
#qrcode canvas, #qrcode img { border-radius: var(--radius); border: 4px solid #fff; }
.invoice-copy {
  display: flex; gap: 8px; width: 100%; align-items: center;
}
.invoice-text {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.payment-status-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3); border-radius: var(--radius);
  padding: 14px; width: 100%;
}
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--btc); border-radius: 50%;
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--bg2); padding: 12px 16px; text-align: left;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border);
}
td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ---- Stats Cards ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-value.btc { color: var(--btc); }
.stat-sub { font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }

/* ---- Section Headers ---- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 1.1rem; font-weight: 700; }

/* ---- Empty State ---- */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted); border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.empty-text { font-size: 0.875rem; }

/* ---- Alert ---- */
.alert { border-radius: var(--radius); padding: 12px 16px; font-size: 0.875rem; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.alert-info { background: rgba(247,147,26,0.1); border: 1px solid rgba(247,147,26,0.3); color: #fdba74; }

/* ---- Countdown ---- */
.countdown { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; color: var(--btc); letter-spacing: 1px; }

/* ---- Hero (index page) ---- */
.hero {
  min-height: calc(100vh - 60px); display: flex; align-items: center;
  justify-content: center; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(247,147,26,0.08) 0%, transparent 60%);
}
.hero-title { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.hero-title span { color: var(--btc); }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 520px; margin: 0 auto 36px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; max-width: 480px;
  margin: 48px auto 0;
}
.hero-stat { background: var(--bg1); padding: 20px; text-align: center; }
.hero-stat-num { font-size: 1.5rem; font-weight: 700; color: var(--btc); }
.hero-stat-lbl { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ---- Features Section ---- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 60px 0; }
.feature-card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  transition: border-color 0.2s;
}
.feature-card:hover { border-color: var(--btc); }
.feature-icon { font-size: 1.8rem; margin-bottom: 12px; }
.feature-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.feature-text { font-size: 0.85rem; color: var(--text-muted); line-height: 1.7; }

/* ---- Login Modal ---- */
.wallet-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.wallet-opt {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
  transition: all 0.15s; font-size: 0.9rem; font-weight: 500;
}
.wallet-opt:hover { border-color: var(--btc); background: var(--btc-glow); }
.wallet-opt-icon { font-size: 1.5rem; width: 32px; text-align: center; }
.wallet-opt-sub { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }

/* ---- Mining Config Card ---- */
.config-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font-mono); font-size: 0.82rem;
  padding: 16px;
}
.config-row { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.config-row:last-child { border-bottom: none; }
.config-key { color: var(--text-muted); min-width: 120px; flex-shrink: 0; }
.config-val { color: var(--text); word-break: break-all; }
.config-val.btc { color: var(--btc); }

/* ---- Progress Bar ---- */
.progress-bar-wrap { background: var(--bg3); border-radius: 20px; height: 6px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; border-radius: 20px; background: var(--btc); transition: width 0.5s ease; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border); padding: 24px 0;
  text-align: center; color: var(--text-dim); font-size: 0.8rem;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .miners-grid { grid-template-columns: 1fr; }
  .duration-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   New Components
   ============================================================ */

/* ---- Bottom Sheet ---- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: all; }
.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg1); border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0; padding: 0 24px 40px;
  max-height: 92vh; overflow-y: auto; z-index: 301;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
}
.sheet-backdrop.open .bottom-sheet { transform: translateY(0); }
.sheet-handle {
  width: 40px; height: 4px; background: var(--border-bright);
  border-radius: 2px; margin: 14px auto 22px; cursor: grab;
}
.sheet-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.sheet-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
@media (min-width: 640px) {
  .bottom-sheet {
    left: 50%; right: auto; width: 500px;
    transform: translateX(-50%) translateY(100%);
    border-radius: 20px 20px 0 0;
  }
  .sheet-backdrop.open .bottom-sheet { transform: translateX(-50%) translateY(0); }
}

/* ---- Checkout Step Indicator ---- */
.checkout-steps {
  display: flex; align-items: center; margin-bottom: 24px;
}
.cs-item { display: flex; align-items: center; flex: 1; }
.cs-circle {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); display: flex;
  align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0; transition: all 0.25s;
}
.cs-label { font-size: 0.72rem; color: var(--text-muted); margin-left: 8px; white-space: nowrap; }
.cs-line { flex: 1; height: 1px; background: var(--border); margin: 0 8px; }
.cs-item.active .cs-circle { border-color: var(--btc); color: var(--btc); background: var(--btc-glow); }
.cs-item.active .cs-label { color: var(--btc); font-weight: 600; }
.cs-item.done .cs-circle { border-color: var(--green); background: var(--green); color: #000; }
.cs-item.done .cs-line { background: var(--green); }

/* ---- Skeleton Loaders ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { height: 220px; border-radius: var(--radius-lg); }
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 20px; padding: 10px 14px;
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.filter-label {
  font-size: 0.72rem; color: var(--text-dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.filter-chip {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px; font-size: 0.78rem;
  cursor: pointer; color: var(--text-muted); transition: all 0.15s;
  white-space: nowrap; user-select: none;
}
.filter-chip:hover { border-color: var(--btc); color: var(--text); }
.filter-chip.active { background: var(--btc-glow); border-color: var(--btc); color: var(--btc); font-weight: 600; }
.filter-sep { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }
.filter-sort {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px; font-size: 0.78rem;
  color: var(--text-muted); cursor: pointer; margin-left: auto;
}

/* ---- Miner Card V2 ---- */
.miner-card-v2 {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: all 0.2s; position: relative; overflow: hidden;
  cursor: pointer;
}
.miner-card-v2::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: transparent; transition: background 0.2s;
}
.miner-card-v2:hover { border-color: var(--btc); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.miner-card-v2:hover::before { background: var(--btc); }
.miner-card-v2.unavailable { opacity: 0.5; cursor: not-allowed; }
.miner-card-v2.unavailable:hover { transform: none; border-color: var(--border); }
.miner-card-v2.unavailable:hover::before { background: transparent; }

.mcv2-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.mcv2-name { font-size: 1rem; font-weight: 700; }
.mcv2-model { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.mcv2-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.mcv2-stat-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.mcv2-stat-val { font-size: 1.05rem; font-weight: 700; font-family: var(--font-mono); margin-top: 1px; }
.mcv2-stat-val.btc { color: var(--btc); }

.efficiency-bar-wrap { margin-bottom: 12px; }
.efficiency-bar-top { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text-muted); margin-bottom: 4px; }
.efficiency-bar-bg { background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; height: 8px; overflow: hidden; }
.efficiency-bar-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--green), var(--btc)); transition: width 0.4s ease; box-shadow: 0 0 6px rgba(247,147,26,0.4); }

.dur-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.dur-chip {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 9px; font-size: 0.75rem;
  color: var(--text-muted); cursor: pointer; transition: all 0.13s;
  user-select: none;
}
.dur-chip:hover { border-color: var(--btc); color: var(--text); }
.dur-chip.sel { background: var(--btc-glow); border-color: var(--btc); color: var(--btc); font-weight: 700; }

/* ---- Mining Room Card ---- */
.mining-room-card {
  background: linear-gradient(135deg, var(--bg1) 0%, rgba(247,147,26,0.04) 100%);
  border: 1px solid rgba(247,147,26,0.25);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.mining-room-card::after {
  content: ''; position: absolute; top: -60%; right: -15%;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(247,147,26,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.mr-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.mr-name { font-size: 1.1rem; font-weight: 700; }
.mr-countdown { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; color: var(--btc); letter-spacing: 2px; }

.mr-live-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.mr-live-stat { text-align: center; background: rgba(0,0,0,0.3); border-radius: var(--radius); padding: 10px 6px; }
.mr-live-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 3px; }
.mr-live-val { font-family: var(--font-mono); font-size: 1rem; font-weight: 700; }
.mr-live-val.green { color: var(--green); }
.mr-live-val.yellow { color: var(--yellow); }
.mr-live-val.danger { color: var(--red); }
.mr-live-val.btc { color: var(--btc); }

.live-dot { display: inline-block; width: 7px; height: 7px; background: var(--green); border-radius: 50%; margin-right: 6px; animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.75); } }

/* ---- Toast Notifications ---- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; font-size: 0.875rem;
  min-width: 240px; max-width: 340px; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  pointer-events: all; display: flex; align-items: center; gap: 10px;
  animation: toast-in 0.3s ease;
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }
.toast.info { border-color: var(--btc); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); height: 0; padding: 0; margin: 0; } }
.toast.closing { animation: toast-out 0.25s ease forwards; }

/* ---- Compact Hero ---- */
.compact-hero { padding: 48px 0 36px; text-align: center; }
.compact-hero-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; margin-bottom: 10px; }
.compact-hero-title span { color: var(--btc); }
.compact-hero-sub { font-size: 1rem; color: var(--text-muted); max-width: 480px; margin: 0 auto 20px; }
.hero-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 5px 14px; font-size: 0.78rem; color: var(--text-muted); margin: 4px; }
.hero-pill strong { color: var(--text); }

/* ---- Onboarding Banner ---- */
.onboarding-banner {
  background: linear-gradient(135deg, rgba(147,51,234,0.08), rgba(247,147,26,0.08));
  border: 1px solid rgba(147,51,234,0.25);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 28px;
}
.onboarding-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.onboarding-text { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }
.onboarding-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.onboarding-btn {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  text-decoration: none; color: var(--text); font-size: 0.875rem;
  font-weight: 500; transition: all 0.15s; cursor: pointer;
}
.onboarding-btn:hover { border-color: var(--nostr); background: var(--nostr-glow); text-decoration: none; }
.onboarding-btn-icon { font-size: 1.4rem; flex-shrink: 0; }
.onboarding-btn-sub { font-size: 0.72rem; color: var(--text-muted); }

/* ---- Admin Fleet Cards ---- */
.fleet-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.fleet-card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 14px; transition: border-color 0.15s;
}
.fleet-card:hover { border-color: var(--border-bright); }
.fleet-card.offline { border-color: rgba(239,68,68,0.3); }
.fleet-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.fleet-dot.online { background: var(--green); animation: live-pulse 2s infinite; }
.fleet-dot.offline { background: var(--red); }
.fleet-dot.rented { background: var(--btc); }
.fleet-dot.maintenance { background: var(--yellow); }
.fleet-info { flex: 1; min-width: 0; }
.fleet-name { font-weight: 600; font-size: 0.9rem; }
.fleet-model { font-size: 0.72rem; color: var(--text-muted); }
.fleet-metrics { display: flex; gap: 16px; font-family: var(--font-mono); font-size: 0.8rem; }
.fleet-metric { text-align: right; }
.fleet-metric-label { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; display: block; }
.fleet-metric-val { font-weight: 600; }
.fleet-metric-val.warn { color: var(--yellow); }
.fleet-metric-val.danger { color: var(--red); }
@media (max-width: 640px) { .fleet-metrics { display: none; } }

/* ---- Admin Revenue Chart (CSS bar chart) ---- */
.rev-chart { display: flex; align-items: flex-end; gap: 3px; height: 48px; }
.rev-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; }
.rev-bar { width: 100%; background: rgba(247,147,26,0.3); border-radius: 3px 3px 0 0; min-height: 3px; transition: background 0.2s; cursor: default; }
.rev-bar:hover { background: rgba(247,147,26,0.7); }
.rev-bar-tip { position: absolute; bottom: 105%; left: 50%; transform: translateX(-50%); background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: 3px 7px; font-size: 0.68rem; white-space: nowrap; display: none; z-index: 10; pointer-events: none; }
.rev-bar-wrap:hover .rev-bar-tip { display: block; }
.rev-bar-label { font-size: 0.58rem; color: var(--text-dim); }

/* ---- Funnel ---- */
.funnel { display: flex; align-items: center; margin: 12px 0; }
.funnel-step { flex: 1; text-align: center; padding: 10px 4px; background: var(--bg2); border: 1px solid var(--border); border-right: none; }
.funnel-step:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.funnel-step:last-child { border-right: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; }
.funnel-num { font-size: 1.3rem; font-weight: 700; font-family: var(--font-mono); }
.funnel-lbl { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }

/* ---- Mobile bottom padding (for bottom sheet) ---- */
@media (max-width: 640px) {
  .page { padding-bottom: 100px; }
}

/* ---- Payment Success animation ---- */
.success-burst {
  text-align: center; padding: 32px 0;
}
.success-icon { font-size: 4rem; margin-bottom: 16px; animation: success-pop 0.5s cubic-bezier(0.18,0.89,0.32,1.28); }
@keyframes success-pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- NWC Status indicator (in nav) ---- */
.nwc-status { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); }
.nwc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.nwc-dot.ok { background: var(--green); animation: live-pulse 3s infinite; }

/* ============================================================
   Design V2 — Onboarding Steps, Styled QR, Terminal, Cockpit
   ============================================================ */

/* ---- Onboarding Steps ---- */
.ob-banner-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.onboarding-steps { display: flex; flex-direction: column; gap: 0; }
.onboarding-step {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0; opacity: 0; transform: translateX(-14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  border-bottom: 1px solid var(--border);
}
.onboarding-step:last-child { border-bottom: none; }
.onboarding-step.visible { opacity: 1; transform: none; }
.ob-num {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border-bright); display: flex;
  align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
  transition: all 0.3s ease; margin-top: 2px;
}
.ob-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.ob-content { flex: 1; }
.ob-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 3px; }
.ob-sub { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; }
.ob-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Styled QR Code ---- */
.qr-styled-outer { position: relative; display: inline-block; margin: 0 auto; }
.qr-glow-ring {
  position: absolute; inset: -8px; border-radius: 18px;
  background: conic-gradient(var(--btc) 0%, #ffd080 25%, var(--btc) 50%, #ffd080 75%, var(--btc) 100%);
  animation: qr-spin 6s linear infinite;
  z-index: 0;
}
.qr-styled-frame {
  position: relative; z-index: 1; background: #fff;
  border-radius: 12px; padding: 6px; overflow: hidden;
  box-shadow: 0 0 20px rgba(247,147,26,0.25);
}
.qr-styled-frame svg { display: block; }
.qr-bolt {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,0.15); z-index: 2;
  pointer-events: none;
}
@keyframes qr-spin { to { transform: rotate(360deg); } }
.qr-copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 16px; cursor: pointer;
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  transition: all 0.2s; font-family: var(--font);
}
.qr-copy-btn:hover { border-color: var(--btc); }
.qr-copy-btn.copied { border-color: var(--green); color: var(--green); }
.qr-copy-btn.copied::before { content: '✓ '; }

/* ---- Terminal Receipt ---- */
.terminal {
  background: #0d1117; border: 1px solid #30363d;
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px;
}
.terminal-header {
  background: #161b22; padding: 8px 14px;
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: #8b949e; font-family: var(--font-mono);
  border-bottom: 1px solid #30363d;
}
.term-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.term-dot.r { background: #ff5f57; }
.term-dot.y { background: #febc2e; }
.term-dot.g { background: #28c840; }
.terminal-body {
  padding: 16px; font-family: var(--font-mono); font-size: 0.82rem;
  min-height: 140px; line-height: 1.6;
}
.term-line { opacity: 0; margin-bottom: 2px; white-space: pre; animation: term-in 0.15s ease forwards; }
@keyframes term-in { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
.term-ok { color: #3fb950; }
.term-key { color: #8b949e; }
.term-val { color: #e6edf3; }
.term-btc { color: var(--btc); }
.term-cursor { display: inline-block; background: #3fb950; width: 7px; height: 13px; vertical-align: text-bottom; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Cockpit Timer ---- */
.cockpit-live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3);
  color: var(--green); border-radius: 20px; padding: 4px 14px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase;
}
.cockpit-wrap {
  display: flex; justify-content: center; align-items: center;
  position: relative; width: 200px; height: 200px;
  margin: 16px auto 24px;
}
.cockpit-ring {
  position: absolute; top: 0; left: 0;
  width: 200px; height: 200px;
  transform: rotate(-90deg);
}
.ring-bg { fill: none; stroke: var(--bg3); stroke-width: 8; }
.ring-fill {
  fill: none; stroke: var(--btc); stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
  filter: drop-shadow(0 0 8px rgba(247,147,26,0.5));
}
.ring-fill.urgent { stroke: var(--red); filter: drop-shadow(0 0 8px rgba(239,68,68,0.7)); }
.cockpit-center { position: relative; z-index: 1; text-align: center; }
.cockpit-label {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 2.5px;
  color: var(--text-dim); margin-bottom: 4px;
}
.cockpit-time {
  font-family: var(--font-mono); font-size: 2.6rem; font-weight: 700;
  color: var(--btc); line-height: 1; letter-spacing: 3px;
}
.cockpit-time.urgent { color: var(--red); }
.cockpit-sublabel { font-size: 0.65rem; color: var(--text-muted); margin-top: 6px; }
.cockpit-stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px;
}
.cockpit-stat {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 8px; text-align: center;
}
.cockpit-stat-label {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim); margin-bottom: 4px;
}
.cockpit-stat-val {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700;
  word-break: break-all; color: var(--text);
}

/* ---- Best Diff Block ---- */
.cockpit-best-diff-wrap {
  background: linear-gradient(135deg, rgba(247,147,26,0.08), rgba(247,147,26,0.03));
  border: 1px solid rgba(247,147,26,0.3);
  border-radius: var(--radius-lg); padding: 14px 16px;
  text-align: center; margin-bottom: 12px;
  position: relative; overflow: hidden;
}
.cockpit-best-diff-wrap::before {
  content: ''; position: absolute; top: -40%; right: -10%;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(247,147,26,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.cockpit-best-label {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 2px;
  color: var(--text-dim); margin-bottom: 6px;
}
.cockpit-best-val {
  font-family: var(--font-mono); font-size: 2rem; font-weight: 700;
  color: var(--btc); line-height: 1; letter-spacing: 1px;
}
.cockpit-best-sub {
  font-size: 0.68rem; color: var(--text-muted); margin-top: 5px;
  font-family: var(--font-mono);
}
