/* Developer Master Portal - Clean White Light Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Light / White Theme */
  --bg-main: #f8f9fc;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4ff;
  --bg-surface: #f1f5f9;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: rgba(79, 70, 229, 0.08);
  --accent-cyan: #0891b2;
  --accent-cyan-soft: rgba(8, 145, 178, 0.1);
  --accent-amber: #d97706;
  --accent-amber-soft: rgba(217, 119, 6, 0.1);
  --accent-emerald: #059669;
  --accent-emerald-soft: rgba(5, 150, 105, 0.1);
  --accent-rose: #e11d48;
  --accent-rose-soft: rgba(225, 29, 72, 0.1);
  --text-main: #0f172a;
  --text-sub: #334155;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 32px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --navbar-h: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ─── NAVBAR ─────────────────────────────────── */
.dev-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.25rem;
  height: var(--navbar-h);
  width: 100%;
  max-width: 100vw;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 0.75rem;
  overflow: hidden;
}

.dev-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.dev-logo .logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.dev-logo span {
  color: var(--primary);
}

.badge-dev {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  border: 1px solid rgba(79, 70, 229, 0.2);
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-config {
  background: var(--bg-surface);
  color: var(--text-sub);
  border: 1px solid var(--border);
  padding: 0 0.85rem;
  height: 38px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-config:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.btn-sync {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 1rem;
  height: 38px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-sync:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transform: translateY(-1px);
}

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

/* ─── MAIN CONTAINER ─────────────────────────── */
.dev-container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
  overflow-x: hidden;
}

/* ─── CONFIG MODAL BOX ───────────────────────── */
.config-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.config-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.config-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.config-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.config-field input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: border-color 0.2s;
  outline: none;
}

.config-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.config-field input::placeholder {
  color: var(--text-faint);
}

.btn-save-api {
  background: var(--accent-emerald);
  color: white;
  font-weight: 700;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.btn-save-api:hover {
  background: #047857;
  transform: translateY(-1px);
}

/* ─── PAGE HEADER ────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.page-header-sub {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.page-header-sub::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-emerald);
  animation: pulse-glow 2.2s infinite;
}

/* ─── SUMMARY METRICS GRID ───────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.summary-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 2px 2px;
}

.summary-card.cyan::after { background: linear-gradient(90deg, #06b6d4, #0891b2); }
.summary-card.amber::after { background: linear-gradient(90deg, #f59e0b, #d97706); }
.summary-card.emerald::after { background: linear-gradient(90deg, #10b981, #059669); }
.summary-card.indigo::after { background: linear-gradient(90deg, #6366f1, #4f46e5); }

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.summary-card.cyan .summary-icon { background: var(--accent-cyan-soft); }
.summary-card.amber .summary-icon { background: var(--accent-amber-soft); }
.summary-card.emerald .summary-icon { background: var(--accent-emerald-soft); }
.summary-card.indigo .summary-icon { background: var(--primary-soft); }

.summary-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.summary-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.summary-sub {
  font-size: 0.72rem;
  color: var(--text-faint);
  line-height: 1.3;
}

/* ─── SECTION HEADER ─────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* ─── CLIENTS GRID ───────────────────────────── */
.clients-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ─── CLIENT CARD ────────────────────────────── */
.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;     /* prevent card children from escaping */
  min-width: 0;
  width: 100%;
}

.client-card:hover {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: var(--shadow);
}

.client-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.client-header-left {
  flex: 1;
  min-width: 0;
}

.client-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.client-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  word-break: break-word;
  max-width: 100%;
}

.client-sub code {
  background: var(--bg-surface);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--primary);
  border: 1px solid var(--border);
  word-break: break-all;
  display: inline-block;
  max-width: 100%;
}

.client-domain {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  background: var(--accent-cyan-soft);
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(8, 145, 178, 0.2);
  transition: all 0.15s;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-domain:hover {
  background: rgba(8, 145, 178, 0.18);
}

/* Status Badge */
.badge-status-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border: 1px solid rgba(5, 150, 105, 0.25);
  padding: 0.28rem 0.7rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-emerald);
  animation: pulse-glow 2.2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(5, 150, 105, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

/* ─── USAGE SECTION ──────────────────────────── */
.usage-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.usage-group {
  background: var(--bg-surface);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.usage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.usage-title {
  color: var(--text-sub);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.usage-value {
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}

.progress-bar-bg {
  width: 100%;
  height: 7px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2%;
}

.progress-bar-fill.warning {
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-rose));
}

/* ─── SERVER SPEC GRID ───────────────────────── */
.server-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  font-size: 0.78rem;
  background: var(--bg-surface);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.server-spec-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  overflow: hidden;
}

.server-spec-grid .lbl {
  color: var(--text-faint);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-spec-grid .val {
  color: var(--text-sub);
  font-weight: 600;
  font-size: 0.76rem;
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── BILLING BOX ────────────────────────────── */
.billing-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.2s;
  overflow: hidden;
  min-width: 0;
}

.billing-box.warning {
  border-color: rgba(217, 119, 6, 0.4);
  background: var(--accent-amber-soft);
}

.billing-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.billing-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.billing-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.billing-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

.billing-fee {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.btn-renew-alert {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border: 1px solid rgba(217, 119, 6, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-paid {
  font-size: 0.7rem;
  color: var(--accent-emerald);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ─── INSTALL PWA BANNER ─────────────────────── */
.pwa-install-bar {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  align-items: center;
  gap: 0.75rem;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-install-bar.visible {
  display: flex;
}

.pwa-install-text {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}

.pwa-install-text strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
}

.btn-pwa-install {
  background: white;
  color: var(--primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.btn-pwa-install:hover { opacity: 0.9; }

.btn-pwa-dismiss {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}

.btn-pwa-dismiss:hover { color: white; }

/* ─── OFFLINE INDICATOR ──────────────────────── */
.offline-bar {
  display: none;
  background: var(--accent-amber);
  color: white;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  position: sticky;
  top: var(--navbar-h);
  z-index: 99;
}

.offline-bar.visible {
  display: block;
}

/* ─── LOADING SKELETON ───────────────────────── */
@keyframes shimmer {
  0% { background-position: -400% 0; }
  100% { background-position: 400% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--border) 50%, var(--bg-surface) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.6s ease infinite;
  border-radius: 8px;
}

/* ─── RESPONSIVE: TABLET & DESKTOP ──────────── */
@media (min-width: 640px) {
  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .summary-val {
    font-size: 1.65rem;
  }

  .clients-grid {
    grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  }

  .dev-container {
    padding: 1.75rem 1.5rem 4rem;
  }

  .page-header-title {
    font-size: 1.6rem;
  }
}

@media (min-width: 1024px) {
  .dev-container {
    padding: 2rem 2rem 4rem;
  }

  .dev-navbar {
    padding: 0 2rem;
  }
}

/* ─── MOBILE SPECIFIC ────────────────────────── */
@media (max-width: 480px) {
  .dev-container {
    padding: 1rem 0.85rem 95px;
  }

  .badge-dev {
    display: none;
  }

  .btn-config .btn-text {
    display: none;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .summary-val {
    font-size: 1.15rem;
  }

  .summary-card {
    padding: 0.85rem 0.9rem;
  }

  .summary-icon {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
  }

  .client-card {
    padding: 1rem;
  }

  .client-title {
    font-size: 0.95rem;
  }

  .server-spec-grid {
    padding: 0.7rem 0.75rem;
    gap: 0.45rem;
  }

  .server-spec-grid .val {
    font-size: 0.74rem;
  }

  .billing-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .billing-right {
    align-items: flex-start;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
  }

  .cf-monitoring-panel {
    padding: 1rem;
  }

  .cf-panel-title h2 {
    font-size: 1.05rem;
  }

  .cf-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .cf-stat-card {
    padding: 0.75rem 0.85rem;
  }

  .cf-stat-val {
    font-size: 1.15rem;
  }

  .cf-details-grid {
    grid-template-columns: 1fr;
  }

  .cf-traffic-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── CLOUDFLARE ACCOUNT TELEMETRY PANEL ─────── */
.cf-monitoring-panel {
  background: var(--bg-card);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.06), var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.cf-monitoring-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f97316, #fb923c, #ea580c);
}

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

.cf-panel-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cf-logo-icon {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  background: rgba(249, 115, 22, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(249, 115, 22, 0.2);
  flex-shrink: 0;
}

.cf-panel-title h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.cf-panel-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.cf-token-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.cf-token-badge.demo {
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.cf-token-badge.live {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.cf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: pulse-glow 2s infinite;
}

/* CF Stats Grid */
.cf-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.cf-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
  transition: all 0.2s ease;
}

.cf-stat-card:hover {
  border-color: rgba(249, 115, 22, 0.3);
  background: var(--bg-card-hover);
}

.cf-stat-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.cf-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.cf-stat-sub {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-weight: 500;
}

/* CF Details Grid */
.cf-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.cf-detail-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
}

.cf-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.cf-box-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.cf-badge-tag {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.cf-badge-tag.green {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border-color: rgba(5, 150, 105, 0.2);
}

/* CF Table & Matrix Items */
.cf-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.8rem;
}

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

.cf-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cf-item-name {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cf-item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cf-pill-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  white-space: nowrap;
}

.cf-pill-status.active {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
}

.cf-pill-status.proxied {
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
}

/* ─── HTTP HEALTH BAR WIDGET ─────────────────── */
.http-health-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.http-health-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.http-health-title {
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.http-health-status {
  color: var(--accent-emerald);
  font-size: 0.78rem;
}

.http-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 99px;
  display: flex;
  overflow: hidden;
  gap: 2px;
}

.http-bar-fill {
  height: 100%;
  transition: width 0.6s ease;
}

.http-bar-fill.success { background: var(--accent-emerald); }
.http-bar-fill.warning { background: var(--accent-amber); }
.http-bar-fill.danger { background: var(--accent-rose); }

.http-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.leg-item.success { color: var(--accent-emerald); }
.leg-item.warning { color: var(--accent-amber); }
.leg-item.danger { color: var(--accent-rose); }

/* ─── PER-PROJECT TRAFFIC GRID ───────────────── */
.cf-pages-traffic-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-top: 1.25rem;
}

.cf-traffic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

.cf-traffic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.cf-traffic-card:hover {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: var(--shadow-sm);
}

.cf-traffic-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.cf-traffic-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-traffic-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  font-size: 0.72rem;
  background: var(--bg-surface);
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
}

.cf-traffic-metrics .m-lbl {
  color: var(--text-muted);
}

.cf-traffic-metrics .m-val {
  font-weight: 700;
  color: var(--text-main);
}

/* ─── PWA MOBILE BOTTOM NAVIGATION BAR ──────── */
.pwa-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 990;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}

.pwa-nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 12px;
  transition: all 0.15s ease;
  flex: 1;
}

.pwa-nav-item .pwa-nav-icon {
  font-size: 1.15rem;
  transition: transform 0.15s;
}

.pwa-nav-item.active {
  color: var(--primary);
  font-weight: 800;
}

.pwa-nav-item.active .pwa-nav-icon {
  transform: translateY(-2px) scale(1.1);
}

@media (max-width: 768px) {
  .dev-container {
    padding-bottom: 90px;
  }
}

@media (min-width: 769px) {
  .pwa-bottom-nav {
    display: none;
  }
}




