:root {
  --bg: #000000;
  --text: #ffffff;
  --secondary: rgba(235, 235, 245, 0.6);
  --tertiary: rgba(235, 235, 245, 0.3);
  --separators: rgba(84, 84, 88, 0.55);
  --card-bg: #1c1c1e;
  --card-bg2: #2c2c2e;
  --green: #00d35a;
  --red: #ff453a;
  --orange: #ff9f0a;
  --cyan: #64d2ff;
  --blue: #0a84ff;
  --yellow: #ffd60a;
  --pink: #ff6b9a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, sans-serif;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  padding-top: env(safe-area-inset-top);
  overflow-x: hidden;
  user-select: none;
}

/* Nav */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--separators);
}

.nav-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card-bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
}

.error-banner {
  background: var(--red);
  color: #fff;
  padding: 6px 16px;
  font-size: 13px;
  display: none;
  text-align: center;
}

/* Balance Hero */
.balance-section {
  padding: 24px 16px 8px;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.paper-badge {
  background: var(--orange);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.multiplier-pill {
  background: rgba(0, 211, 90, 0.15);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
}

.balance-odometer {
  font-size: 48px;
  font-weight: 700;
  font-family: "SF Pro Display", -apple-system, sans-serif;
  letter-spacing: -0.5px;
}

.today-change {
  font-size: 15px;
  color: var(--green);
  font-weight: 500;
  margin-top: 4px;
}

/* Charts */
.chart-container {
  width: 100%;
  height: 220px;
  padding: 0 16px;
  margin: 12px 0;
  position: relative;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.range-switch {
  display: flex;
  justify-content: space-around;
  padding: 8px 16px;
  margin-bottom: 16px;
}

.range-btn {
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 14px;
  cursor: pointer;
}

.range-btn.active {
  background: var(--card-bg2);
  color: var(--text);
}

/* Agent Carousel */
.section-header {
  font-size: 17px;
  font-weight: 600;
  padding: 0 16px;
  margin: 20px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 12px;
  padding: 0 16px;
  -webkit-overflow-scrolling: touch;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel .agent-card {
  flex: 0 0 calc(100vw - 32px);
  max-width: 380px;
  scroll-snap-align: center;
}

.agent-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 16px;
  position: relative;
  box-sizing: border-box;
  flex: none;
  height: auto;
}

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

.agent-name {
  font-size: 19px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.agent-card-body {
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.4;
}

/* Activity Rows */
.activity-list {
  padding: 0 16px;
}

.activity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--card-bg);
  cursor: pointer;
}

.act-title {
  font-size: 15px;
  font-weight: 500;
}

.act-subtitle {
  font-size: 12px;
  color: var(--secondary);
  margin-top: 2px;
}

.act-val {
  font-size: 15px;
  font-weight: 600;
  text-align: right;
}

/* Bottom Tab Bar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(28, 28, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--separators);
  z-index: 1000;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--text);
}

/* Screens */
.screen {
  display: none;
}
.screen.active {
  display: block;
}

/* Responsive wrap & squish for larger screens (iPad, desktop, tablets) */
@media (min-width: 680px) {
  .screen.active {
    max-width: 1200px;
    margin: 0 auto;
  }
  .fleet-roster-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 14px !important;
  }
  .carousel {
    flex-wrap: wrap;
    scroll-snap-type: none;
  }
  .carousel .agent-card {
    flex: 1 1 280px;
    max-width: none;
  }
}

/* Button styles */
.fomo-btn {
  width: calc(100% - 32px);
  margin: 16px;
  padding: 16px;
  background: var(--green);
  color: #000;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: block;
  text-align: center;
  text-decoration: none;
}
