@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap");

/* ═══════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════ */
:root {
  --bg-hue: 240;
  --bg-sat: 10%;
  --bg-lit: 5%;

  --bg-color: hsl(var(--bg-hue), var(--bg-sat), var(--bg-lit));
  --panel-bg: hsla(var(--bg-hue), var(--bg-sat), 15%, 0.45);
  --panel-border: hsla(var(--bg-hue), var(--bg-sat), 25%, 0.3);
  --panel-hover: hsla(var(--bg-hue), var(--bg-sat), 18%, 0.55);

  --text-main: hsl(0, 0%, 95%);
  --text-muted: hsl(0, 0%, 60%);
  --text-dim: hsl(0, 0%, 42%);

  --accent: hsl(164, 82%, 40%);
  --accent-soft: hsla(164, 82%, 40%, 0.12);
  --accent-glow: hsla(164, 82%, 40%, 0.25);

  --color-llm: hsl(210, 90%, 60%);
  --color-video: hsl(280, 70%, 60%);
  --color-compute: hsl(35, 90%, 55%);
  --color-other: hsl(145, 70%, 45%);

  --color-success: hsl(145, 70%, 45%);
  --color-warn: hsl(45, 90%, 55%);
  --color-danger: hsl(350, 70%, 55%);
  --color-info: hsl(210, 90%, 60%);

  --tier-free: hsl(215, 15%, 45%);
  --tier-pro: linear-gradient(135deg, hsl(164, 82%, 36%), hsl(239, 84%, 67%));
  --tier-ultra: linear-gradient(135deg, hsl(45, 93%, 47%), hsl(24, 94%, 50%));

  --font-sans: "Inter", system-ui, sans-serif;
  --font-display: "Outfit", system-ui, sans-serif;

  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.3s var(--ease-out);
  --transition-fast: all 0.15s var(--ease-out);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--accent-glow);
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  background-image:
    radial-gradient(
      ellipse at 10% 20%,
      hsla(164, 80%, 18%, 0.12),
      transparent 40%
    ),
    radial-gradient(
      ellipse at 90% 80%,
      hsla(240, 80%, 20%, 0.1),
      transparent 40%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      hsla(280, 60%, 15%, 0.06),
      transparent 50%
    );
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      hsla(0, 0%, 100%, 0.008) 2px,
      hsla(0, 0%, 100%, 0.008) 4px
    );
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  opacity: 0.85;
}

/* ═══════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: hsla(0, 0%, 100%, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsla(0, 0%, 100%, 0.2);
}

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
.dash-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════
   NAV BAR
   ═══════════════════════════════════════════ */
.dash-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.dash-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.dash-logo span {
  color: var(--text-dim);
}

.dash-breadcrumb {
  font-size: 0.8rem;
  font-weight: 400;
  font-family: var(--font-sans);
  color: var(--text-dim);
  margin: 0;
}

.dash-breadcrumb span {
  color: var(--text-muted);
}

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

.dash-nav-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition-fast);
  text-decoration: none;
}

.dash-nav-link:hover {
  color: var(--text-main);
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  opacity: 1;
}

/* ═══════════════════════════════════════════
   GLASSMORPHIC PANEL
   ═══════════════════════════════════════════ */
.panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.panel:hover {
  border-color: hsla(var(--bg-hue), var(--bg-sat), 35%, 0.3);
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    hsla(0, 0%, 100%, 0.08),
    transparent
  );
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title .icon {
  font-size: 1.1rem;
}

.panel-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════
   SECTION: PROFILE CARD
   ═══════════════════════════════════════════ */
.profile-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.profile-avatar-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  position: relative;
}

.profile-avatar-ring::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.profile-avatar-ring:hover::after {
  opacity: 1;
}

.profile-avatar-ring.free {
  background: var(--tier-free);
}
.profile-avatar-ring.free::after {
  background: hsla(215, 15%, 45%, 0.15);
}

.profile-avatar-ring.pro {
  background: var(--tier-pro);
}
.profile-avatar-ring.pro::after {
  background: hsla(164, 82%, 36%, 0.15);
}

.profile-avatar-ring.ultra {
  background: var(--tier-ultra);
}
.profile-avatar-ring.ultra::after {
  background: hsla(45, 93%, 47%, 0.15);
}

.profile-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: hsl(var(--bg-hue), var(--bg-sat), 10%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-main);
  overflow: hidden;
}

.profile-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

.profile-email {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tier-badge.free {
  background: hsla(215, 15%, 45%, 0.2);
  color: hsl(215, 15%, 65%);
  border: 1px solid hsla(215, 15%, 45%, 0.3);
}

.tier-badge.pro {
  background: hsla(164, 82%, 36%, 0.12);
  color: hsl(164, 70%, 55%);
  border: 1px solid hsla(164, 82%, 36%, 0.25);
}

.tier-badge.ultra {
  background: hsla(45, 93%, 47%, 0.12);
  color: hsl(40, 90%, 60%);
  border: 1px solid hsla(45, 93%, 47%, 0.25);
}

/* ═══════════════════════════════════════════
   SECTION: WALLET
   ═══════════════════════════════════════════ */
.wallet-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wallet-balance-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wallet-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.wallet-amount {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), hsl(200, 85%, 60%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wallet-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  margin-top: 2px;
}

.wallet-trend.positive {
  color: var(--color-success);
}

.wallet-trend.negative {
  color: var(--color-danger);
}

.btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  opacity: 1;
}

.btn:active {
  transform: translateY(0);
}

.btn-accent {
  background: var(--accent);
  border-color: transparent;
  color: hsl(0, 0%, 5%);
}

.btn-accent:hover {
  background: hsl(164, 82%, 45%);
  box-shadow: var(--shadow-glow);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-outline {
  background: transparent;
  border-color: var(--panel-border);
  color: var(--text-muted);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  color: var(--color-danger);
}

.btn-danger:hover {
  background: hsla(350, 70%, 55%, 0.1);
  border-color: hsla(350, 70%, 55%, 0.3);
}

/* ═══════════════════════════════════════════
   SECTION: USAGE TODAY (KPI + Progress)
   ═══════════════════════════════════════════ */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.usage-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.usage-stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.usage-stat-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), hsl(200, 85%, 60%));
  transition: width 0.6s var(--ease-out);
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, hsla(164, 82%, 70%, 0.4));
  border-radius: 0 4px 4px 0;
}

.progress-fill.warn {
  background: linear-gradient(90deg, var(--color-warn), hsl(30, 90%, 50%));
}

.progress-fill.warn::after {
  background: linear-gradient(90deg, transparent, hsla(45, 90%, 65%, 0.4));
}

.progress-fill.danger {
  background: linear-gradient(90deg, var(--color-danger), hsl(0, 80%, 50%));
}

.progress-fill.danger::after {
  background: linear-gradient(90deg, transparent, hsla(350, 80%, 65%, 0.4));
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.progress-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.progress-pct {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

/* ═══════════════════════════════════════════
   SECTION: COST BREAKDOWN (Pie Chart)
   ═══════════════════════════════════════════ */
.cost-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.chart-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 280px;
}

.chart-wrap canvas {
  max-width: 260px;
  max-height: 260px;
}

.cost-legend {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}

.cost-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cost-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cost-legend-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
}

.cost-legend-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.time-toggles {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.time-toggles button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.78rem;
  transition: var(--transition-fast);
}

.time-toggles button:hover {
  color: var(--text-muted);
}

.time-toggles button.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* ═══════════════════════════════════════════
   SECTION: RECENT ACTIVITY
   ═══════════════════════════════════════════ */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 480px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: var(--transition-fast);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.02);
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.activity-icon.llm {
  background: hsla(210, 90%, 60%, 0.12);
}
.activity-icon.video {
  background: hsla(280, 70%, 60%, 0.12);
}
.activity-icon.compute {
  background: hsla(35, 90%, 55%, 0.12);
}
.activity-icon.other {
  background: hsla(145, 70%, 45%, 0.12);
}

.activity-details {
  flex: 1;
  min-width: 0;
}

.activity-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-type {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.activity-cost {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-danger);
  white-space: nowrap;
}

.activity-cost.credit {
  color: var(--color-success);
}

.activity-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

/* ═══════════════════════════════════════════
   SECTION: MY WORKERS
   ═══════════════════════════════════════════ */
.workers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.worker-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
}

.worker-card:hover {
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.05);
}

.worker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.worker-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  color: var(--color-success);
}

.status-dot.online::before {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
  animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.offline {
  color: var(--text-dim);
}

.status-dot.offline::before {
  background: var(--text-dim);
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.worker-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.worker-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.worker-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.worker-stat-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.worker-gpu-bar {
  margin-top: 12px;
}

.worker-gpu-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════════
   SECTION: API KEYS (BYOK)
   ═══════════════════════════════════════════ */
.api-keys-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.api-key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.api-key-row:hover {
  border-color: var(--panel-border);
}

.api-key-provider-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
}

.api-key-info {
  flex: 1;
  min-width: 0;
}

.api-key-provider {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.api-key-status {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.api-key-status.configured {
  color: var(--color-success);
}

.api-key-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.api-key-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  width: 280px;
  transition: var(--transition);
}

.api-key-input::placeholder {
  color: var(--text-dim);
}

.api-key-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════
   TWO-COLUMN LAYOUT
   ═══════════════════════════════════════════ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ═══════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  color: var(--text-dim);
  text-align: center;
  gap: 8px;
}

.empty-state .icon {
  font-size: 2rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.85rem;
  max-width: 280px;
}

/* ═══════════════════════════════════════════
   LOADING / SKELETON
   ═══════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  width: 60%;
  margin-bottom: 8px;
}

.skeleton-value {
  height: 32px;
  width: 40%;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   TOAST SYSTEM
   ═══════════════════════════════════════════ */
#dash-toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
}

.dash-toast {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  min-width: 260px;
  max-width: 380px;
  animation: toastIn 0.3s var(--ease-out) forwards;
}

.dash-toast.error {
  border-left-color: var(--color-danger);
}

.dash-toast.info {
  border-left-color: var(--color-info);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }
.animate-in:nth-child(7) { animation-delay: 0.35s; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .profile-section {
    grid-template-columns: 1fr;
  }

  .cost-layout {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .three-col {
    grid-template-columns: 1fr;
  }

  .api-key-input {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .dash-container {
    padding: 1rem;
    gap: 1rem;
  }

  .dash-nav {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .panel {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .wallet-panel {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .wallet-amount {
    font-size: 2rem;
  }

  .profile-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .profile-meta {
    justify-content: center;
  }

  .usage-grid {
    grid-template-columns: 1fr 1fr;
  }

  .workers-grid {
    grid-template-columns: 1fr;
  }

  .api-key-row {
    flex-wrap: wrap;
  }

  .api-key-input-group {
    width: 100%;
  }

  .api-key-input {
    width: 100%;
    flex: 1;
  }

  .activity-item:hover {
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 480px) {
  .usage-grid {
    grid-template-columns: 1fr;
  }

  .dash-nav-right {
    flex-wrap: wrap;
  }
}

/* ═══════════════════════════════════════════
   SECTION: API ACCESS TOKEN
   ═══════════════════════════════════════════ */
.api-token-section {
  margin-top: 0;
}

.api-token-warning {
  background: hsla(45, 90%, 55%, 0.1);
  border: 1px solid hsla(45, 90%, 55%, 0.25);
  color: hsl(45, 90%, 65%);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.api-token-display-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-token-display {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  color: var(--accent);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  letter-spacing: 0.02em;
}

.api-token-display.masked {
  color: var(--text-muted);
}

.api-token-display:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.api-token-copy-feedback {
  position: fixed;
  background: var(--accent);
  color: #000;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 9999;
  animation: tokenCopyPop 0.8s var(--ease-out) forwards;
}

@keyframes tokenCopyPop {
  0%   { opacity: 1; transform: translateY(0); }
  80%  { opacity: 1; transform: translateY(-16px); }
  100% { opacity: 0; transform: translateY(-24px); }
}

/* ═══════════════════════════════════════════
   SECTION: INFRA MONITOR
   ═══════════════════════════════════════════ */
.infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.infra-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.infra-card-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.infra-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.75rem;
}

.infra-gauge-label {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: -6px;
}

.infra-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.infra-stat-row:last-child { border-bottom: none; }

.infra-stat-row span:first-child { color: var(--text-muted); }
.infra-stat-row span:last-child { color: var(--text-main); font-weight: 600; font-family: var(--font-display); }

.infra-stat-row.header {
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.infra-stat-row.header span { color: var(--text-dim) !important; font-weight: 600 !important; }

.infra-stat-row.dim span { color: var(--text-dim) !important; font-style: italic; }

.infra-big-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, hsl(210, 90%, 60%), hsl(280, 70%, 60%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0.25rem 0;
}

.infra-big-label {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.infra-vm-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.infra-vm-status.running {
  background: hsla(145, 70%, 45%, 0.15);
  color: hsl(145, 70%, 55%);
  border: 1px solid hsla(145, 70%, 45%, 0.3);
}

.infra-vm-status.stopped {
  background: hsla(350, 70%, 55%, 0.12);
  color: hsl(350, 70%, 65%);
  border: 1px solid hsla(350, 70%, 55%, 0.25);
}

.infra-vm-status.starting {
  background: hsla(45, 90%, 55%, 0.12);
  color: hsl(45, 90%, 65%);
  border: 1px solid hsla(45, 90%, 55%, 0.25);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.infra-vm-controls {
  display: flex;
  gap: 8px;
  margin-top: 0.75rem;
}

.infra-feed {
  margin-top: 0.5rem;
}

.infra-feed-title {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}
