*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface-2: #0f3460;
  --accent: #4fc3f7;
  --danger: #e74c3c;
  --success: #2ecc71;
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.5);
  --tab-height: 64px;
  --fab-size: 56px;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; overflow: hidden; }

#app { display: flex; flex-direction: column; height: 100vh; }

/* Tab content */
.tab-content { display: none; flex: 1; overflow: auto; }
.tab-content.active { display: flex; flex-direction: column; }

/* Tab bar */
#tab-bar {
  display: flex;
  height: var(--tab-height);
  background: var(--surface);
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 0 8px;
}
.tab-btn.active { color: var(--accent); }
.tab-icon { font-size: 20px; }
.tab-label { font-size: 11px; font-weight: 500; }

/* FAB */
#fab {
  position: fixed;
  right: 20px;
  bottom: calc(var(--tab-height) + 16px);
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background: var(--danger);
  border: none;
  font-size: 24px;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* Loading spinner */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Centered content helper */
.center { display: flex; align-items: center; justify-content: center; flex: 1; flex-direction: column; gap: 12px; text-align: center; padding: 24px; }

/* Error banner */
.error-banner { background: rgba(231,76,60,0.15); border: 1px solid var(--danger); border-radius: 8px; padding: 12px 16px; margin: 12px; font-size: 13px; }

/* Buttons */
.btn { padding: 12px 24px; border-radius: 8px; border: none; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%; }
.btn-primary { background: var(--accent); color: #1a1a2e; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: rgba(255,255,255,0.1); color: var(--text); }

/* Status badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-trial { background: rgba(79,195,247,0.2); color: var(--accent); }
.badge-active { background: rgba(46,204,113,0.2); color: var(--success); }
.badge-expired { background: rgba(231,76,60,0.2); color: var(--danger); }

/* Info card (map pin detail) */
.info-card {
  position: fixed;
  bottom: var(--tab-height);
  left: 0; right: 0;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  z-index: 200;
  transform: translateY(calc(100% + var(--tab-height)));
  transition: transform 0.25s ease;
}
.info-card.open { transform: translateY(0); }
.info-card-handle { width: 32px; height: 3px; background: rgba(255,255,255,0.3); border-radius: 2px; margin: 0 auto 12px; }
.info-card-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.info-card-actions { margin-top: 12px; display: flex; gap: 8px; }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--tab-height) + 12px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,50,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 300;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Report flow steps */
.step { display: none; flex-direction: column; flex: 1; padding: 16px; gap: 12px; }
.step.active { display: flex; }
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.category-btn { background: var(--surface); border: 2px solid transparent; border-radius: 10px; padding: 16px 10px; font-size: 14px; color: var(--text); cursor: pointer; text-align: center; }
.category-btn.selected { border-color: var(--accent); }

/* Account card */
.account-card { background: var(--surface); border-radius: 12px; padding: 20px; margin: 16px; }
.account-name { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.account-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.07); font-size: 14px; }
.account-row:last-child { border-bottom: none; }
