/* ── Dashboard layout & components ───────────────────────────── */
/* Inherits design tokens from theme.css */

/* ── Nav ────────────────────────────────────────────────────── */
.dash-nav {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.dash-brand-icon {
  font-size: 18px;
  line-height: 1;
}

.dash-brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.5px;
}

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

.dash-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--green);
  background: rgba(46, 204, 113, 0.12);
  padding: 4px 10px;
  border-radius: 4px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.3); }
}

.dash-time {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--fg-muted);
  letter-spacing: 0.5px;
}

/* ── Summary bar ─────────────────────────────────────────────── */
.summary-bar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.summary-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.summary-stat { text-align: center; flex: 1; min-width: 0; }

.summary-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.15;
  margin-bottom: 4px;
}

.summary-value.accent { color: var(--accent); }
.summary-value.green  { color: var(--green); }

.summary-label {
  font-size: 0.72rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.summary-divider {
  width: 1px;
  height: 44px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Main ────────────────────────────────────────────────────── */
.dash-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}

.dash-subtitle {
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.dash-filter-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.filter-btn {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  background: var(--bg-card);
  color: var(--fg);
}

.filter-btn.active {
  background: var(--accent-dim);
  border-color: rgba(201, 162, 39, 0.35);
  color: var(--accent);
}

/* ── Client grid ─────────────────────────────────────────────── */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* ── Client card ─────────────────────────────────────────────── */
.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.client-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  transition: background 0.2s;
}

.client-card[data-status="active"]::before   { background: var(--green); }
.client-card[data-status="paused"]::before   { background: var(--fg-muted); }
.client-card[data-status="degraded"]::before { background: var(--red); }

.client-card:hover {
  border-color: rgba(201, 162, 39, 0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-client-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 2px;
}

.card-industry {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 9px;
  border-radius: 4px;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-active  { background: rgba(46,204,113,0.15);  color: var(--green); }
.status-active  .status-dot { background: var(--green); animation: pulse-green 2s infinite; }

.status-paused  { background: rgba(138,135,128,0.15); color: var(--fg-muted); }
.status-paused  .status-dot { background: var(--fg-muted); }

.status-degraded { background: rgba(231,76,60,0.15);  color: var(--red); }
.status-degraded .status-dot { background: var(--red); animation: pulse-red 1.5s infinite; }

@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.card-agent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.card-agent-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--fg-muted);
}

.card-agent-name {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

/* Metrics row */
.card-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.card-metric {
  text-align: center;
  flex: 1;
}

.card-metric-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 3px;
}

.card-metric-value.accent { color: var(--accent); }
.card-metric-value.green  { color: var(--green); }
.card-metric-value.red    { color: var(--red); }

.card-metric-label {
  font-size: 0.68rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.card-metric-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.card-last-active {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.accent-text { color: var(--accent); }

/* Active pulse ring */
.pulse-indicator {
  position: relative;
  width: 12px;
  height: 12px;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(0.6); opacity: 0.9; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ── Footer ──────────────────────────────────────────────────── */
.dash-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.footer-sep { margin: 0 8px; opacity: 0.4; }

.footer-link {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-link:hover { color: var(--accent); }

/* ── Pricing section ─────────────────────────────────────────── */
.pricing-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  border-top: 1px solid var(--border);
}

.pricing-header {
  text-align: center;
  margin-bottom: 40px;
}

.pricing-eyebrow {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.pricing-heading {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 10px;
}

.pricing-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.6;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 760px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  border-color: rgba(201, 162, 39, 0.25);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.pricing-card.featured {
  border-color: rgba(201, 162, 39, 0.4);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(201,162,39,0.04) 100%);
}

.pricing-card.featured::before {
  content: 'MOST POPULAR';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 14px;
  border-radius: 0 0 8px 8px;
}

.pricing-plan-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.pricing-price {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.pricing-amount {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
}

.pricing-period {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

.pricing-features li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.pricing-cta {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s;
  border: none;
}

.pricing-cta-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg);
}

.pricing-cta-secondary:hover {
  background: var(--bg-card);
  border-color: rgba(201, 162, 39, 0.3);
  color: var(--accent);
}

.pricing-cta-primary {
  background: var(--accent);
  color: #0c0c0c;
}

.pricing-cta-primary:hover {
  background: #e0b830;
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.35);
  transform: translateY(-1px);
}

.pricing-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 24px;
  opacity: 0.7;
}

/* ── Payment success ─────────────────────────────────────────── */
.success-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.success-card {
  background: var(--bg-card);
  border: 1px solid rgba(46,204,113,0.3);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.success-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 12px;
}

.success-message {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.success-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #0c0c0c;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s;
}

.success-btn:hover { background: #e0b830; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .summary-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 32px;
  }
  .summary-divider { display: none; }
  .summary-stat { min-width: 100px; }
}

@media (max-width: 640px) {
  .dash-header {
    flex-direction: column;
  }
  .client-grid {
    grid-template-columns: 1fr;
  }
  .card-metrics {
    flex-wrap: wrap;
    gap: 12px;
  }
  .card-metric-divider { display: none; }
}
