/* ── Rydoo Website Design Tokens ──────────────────────────────────────────── */
/* Derived from https://www.rydoo.com — deep navy, vibrant purple, clean white */

:root {
  /* Static palette */
  --palette-navy:       #0B0B1A;
  --palette-indigo:     #1E1B4B;
  --palette-purple:     #7C3AED;
  --palette-violet:     #8B5CF6;
  --palette-lavender:   #A78BFA;
  --palette-green:      #10B981;
  --palette-red:        #EF4444;
  --palette-amber:      #F59E0B;
  --palette-sky:        #0EA5E9;

  /* Typography — Inter (rydoo.com uses geometric sans) with system fallbacks */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Radius — generous like rydoo.com */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 100px;

  /* Timing */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Gradient accents (decorative purple glows like rydoo.com) */
  --gradient-purple: linear-gradient(135deg, #7C3AED 0%, #A78BFA 50%, #C4B5FD 100%);
  --gradient-cta: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
}

/* ── Light theme (default) ───────────────────────────────────────────────── */

:root,
[data-theme="light"] {
  --color-paris:        #1E1B4B;
  --color-purple-rain:  #7C3AED;
  --color-purple-hover: #6D28D9;
  --color-salmon:       #FDF4FF;

  --color-green:        #10B981;
  --color-green-light:  #ECFDF5;
  --color-red:          #EF4444;
  --color-red-light:    #FEF2F2;
  --color-yellow:       #F59E0B;
  --color-yellow-light: #FFFBEB;
  --color-blue:         #0EA5E9;
  --color-blue-light:   #F0F9FF;

  --color-gray-900:     #0F0F23;
  --color-gray-700:     #374151;
  --color-gray-500:     #6B7280;
  --color-gray-300:     #D1D5DB;
  --color-gray-200:     #E5E7EB;
  --color-gray-100:     #F3F4F6;
  --color-white:        #FFFFFF;

  --bg-app:             #F9FAFB;
  --bg-surface:         #FFFFFF;
  --bg-surface-hover:   #F9FAFB;
  --bg-elevated:        #FFFFFF;
  --bg-input:           #FFFFFF;
  --bg-navbar:          #0B0B1A;
  --bg-overlay:         rgba(11, 11, 26, 0.6);
  --bg-badge:           #F3F4F6;

  --border-primary:     #E5E7EB;
  --border-subtle:      #F3F4F6;

  --text-primary:       #0F0F23;
  --text-secondary:     #374151;
  --text-tertiary:      #6B7280;
  --text-on-dark:       #FFFFFF;
  --text-link:          #7C3AED;

  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:  0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 20px 40px -12px rgba(124, 58, 237, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* ── Dark theme ──────────────────────────────────────────────────────────── */

[data-theme="dark"] {
  --color-paris:        #C4B5FD;
  --color-purple-rain:  #A78BFA;
  --color-purple-hover: #8B5CF6;
  --color-salmon:       #2E1065;

  --color-green:        #34D399;
  --color-green-light:  rgba(52, 211, 153, 0.12);
  --color-red:          #F87171;
  --color-red-light:    rgba(248, 113, 113, 0.12);
  --color-yellow:       #FBBF24;
  --color-yellow-light: rgba(251, 191, 36, 0.10);
  --color-blue:         #38BDF8;
  --color-blue-light:   rgba(56, 189, 248, 0.10);

  --color-gray-900:     #F3F4F6;
  --color-gray-700:     #D1D5DB;
  --color-gray-500:     #6B7280;
  --color-gray-300:     #374151;
  --color-gray-200:     #1F2937;
  --color-gray-100:     #111827;
  --color-white:        #0F0F23;

  --bg-app:             #0B0B1A;
  --bg-surface:         #111827;
  --bg-surface-hover:   #1F2937;
  --bg-elevated:        #1F2937;
  --bg-input:           #1F2937;
  --bg-navbar:          #060611;
  --bg-overlay:         rgba(0, 0, 0, 0.7);
  --bg-badge:           #1F2937;

  --border-primary:     #1F2937;
  --border-subtle:      #111827;

  --text-primary:       #F3F4F6;
  --text-secondary:     #D1D5DB;
  --text-tertiary:      #6B7280;
  --text-on-dark:       #F3F4F6;
  --text-link:          #A78BFA;

  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg:  0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 20px 40px -12px rgba(139, 92, 246, 0.2), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

/* ── Reset & base ────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light dark;
}

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-app);
  line-height: 1.5;
  transition: background var(--transition-base), color var(--transition-base);
}

a { color: var(--text-link); }

/* ── Layout ──────────────────────────────────────────────────────────────── */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header / Navbar ─────────────────────────────────────────────────────── */

.navbar {
  background: var(--bg-navbar);
  color: var(--text-on-dark);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background var(--transition-base);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.navbar__brand svg {
  width: 100px;
  height: 26px;
  opacity: 0.95;
  flex-shrink: 0;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar__status {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  opacity: 0.8;
}

.navbar__user {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Theme toggle ────────────────────────────────────────────────────────── */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-on-dark);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .icon-moon,
[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform 0.1s, box-shadow var(--transition-fast);
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--gradient-cta);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-purple-hover);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn--about {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.btn--about:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
}

/* ── Main content ────────────────────────────────────────────────────────── */

.main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 64px;
}

/* ── Stats bar ───────────────────────────────────────────────────────────── */

.stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background var(--transition-base), border-color var(--transition-base), transform var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-1px);
}

.stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-paris);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-card__label {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Server metrics ──────────────────────────────────────────────────────── */

.server-metrics {
  margin-bottom: 24px;
}

.server-metrics__header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.server-metrics__header svg {
  color: var(--text-tertiary);
}

.server-metrics__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  transition: background var(--transition-base), border-color var(--transition-base);
}

.metric-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition-base);
}

.metric-card__icon--cpu  { background: rgba(124, 58, 237, 0.10); color: var(--color-purple-rain); }
.metric-card__icon--mem  { background: var(--color-green-light); color: var(--color-green); }
.metric-card__icon--disk { background: var(--color-yellow-light); color: var(--color-yellow); }
.metric-card__icon--net  { background: var(--color-blue-light); color: var(--color-blue); }

.metric-card__data {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.metric-card__value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.metric-card__label {
  font-size: 0.625rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card__bar {
  width: 100%;
  height: 4px;
  background: var(--border-primary);
  border-radius: 2px;
  overflow: hidden;
}

.metric-card__bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.metric-card__bar-fill--cpu  { background: var(--gradient-cta); }
.metric-card__bar-fill--mem  { background: var(--color-green); }
.metric-card__bar-fill--disk { background: var(--color-yellow); }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 240px;
  padding: 9px 16px 9px 40px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.8125rem;
  background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238E8EA9' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 10-1.397 1.398h-.001l3.85 3.85a1 1 0 001.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 110-10 5 5 0 010 10z'/%3E%3C/svg%3E") 14px center no-repeat;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-base);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-purple-rain);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.filter-select {
  padding: 9px 14px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.8125rem;
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-base);
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-purple-rain);
}

/* ── Application grid ────────────────────────────────────────────────────── */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

/* ── Application card ────────────────────────────────────────────────────── */

.app-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-base), background var(--transition-base);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.app-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.3);
}

.app-card__header {
  padding: 18px 18px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.app-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-paris);
  line-height: 1.35;
}

.app-card__description {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card__body {
  padding: 0 18px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-card__footer {
  border-top: 1px solid var(--border-subtle);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-hover);
  transition: background var(--transition-base);
}

/* ── Badges / pills ──────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background var(--transition-base), color var(--transition-base);
}

.badge--running {
  background: var(--color-green-light);
  color: var(--color-green);
}

.badge--error {
  background: var(--color-red-light);
  color: var(--color-red);
}

.badge--idle {
  background: var(--bg-badge);
  color: var(--text-tertiary);
}

.badge--building {
  background: var(--color-yellow-light);
  color: var(--color-yellow);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.badge--type {
  background: var(--color-blue-light);
  color: var(--color-blue);
}

.badge--warning {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .badge--warning {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.badge--build {
  background: var(--bg-badge);
  color: var(--text-secondary);
}

/* ── Info rows ───────────────────────────────────────────────────────────── */

.info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.info-row svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.info-row a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.info-row a:hover {
  text-decoration: underline;
}

/* ── Links ───────────────────────────────────────────────────────────────── */

.link-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.link-icon:hover {
  text-decoration: underline;
  color: var(--color-purple-hover);
}

.link-icon svg {
  width: 13px;
  height: 13px;
}

/* ── Detail panel / slide-over ────────────────────────────────────────────── */

.detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.detail-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.detail-panel {
  width: 500px;
  max-width: 100%;
  background: var(--bg-surface);
  height: 100vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--transition-base), background var(--transition-base);
}

.detail-overlay.open .detail-panel {
  transform: translateX(0);
}

.detail-panel__header {
  position: sticky;
  top: 0;
  background: var(--bg-navbar);
  color: var(--text-on-dark);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}

.detail-panel__header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.detail-panel__close {
  background: none;
  border: none;
  color: var(--text-on-dark);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.detail-panel__close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.detail-panel__body {
  padding: 20px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section__title {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-primary);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.8125rem;
}

.detail-row__label {
  color: var(--text-tertiary);
}

.detail-row__value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

/* ── Deployment timeline ─────────────────────────────────────────────────── */

.deploy-list {
  list-style: none;
}

.deploy-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
}

.deploy-item .btn-icon {
  margin-top: 2px;
}

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

.deploy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.deploy-dot--done    { background: var(--color-green); }
.deploy-dot--error   { background: var(--color-red); }
.deploy-dot--running { background: var(--color-yellow); animation: pulse-dot 1.5s ease-in-out infinite; }
.deploy-dot--queued  { background: var(--color-gray-300); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--color-yellow); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px transparent; }
}

.deploy-info__title {
  color: var(--text-primary);
  font-weight: 500;
}

.deploy-info__time {
  color: var(--text-tertiary);
  font-size: 0.6875rem;
  margin-top: 1px;
}

.deploy-error {
  margin-top: 4px;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  line-height: 1.4;
  color: var(--color-red);
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid var(--color-red);
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

/* ── Loading & empty states ──────────────────────────────────────────────── */

.loading {
  text-align: center;
  padding: 80px 32px;
  color: var(--text-tertiary);
}

.loading__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--color-purple-rain);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.empty-state {
  text-align: center;
  padding: 60px 32px;
  color: var(--text-tertiary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  color: var(--color-gray-300);
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .main { padding: 20px 16px 48px; }
  .app-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: column; }
  .detail-panel { width: 100%; }
}

/* ── Preview overview ─────────────────────────────────────────────────────── */

.preview-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-fast);
}

.preview-card:hover {
  border-color: var(--color-iris);
  box-shadow: 0 0 0 1px var(--color-iris-subtle, rgba(124, 58, 237, 0.15));
}

.preview-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.preview-card__app {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--color-paris);
}

.preview-card__pr {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  margin-bottom: 4px;
}

.preview-card__pr a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-iris);
  text-decoration: none;
  font-weight: 500;
}

.preview-card__pr a:hover {
  text-decoration: underline;
}

.preview-card__pr-title {
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.preview-card__url {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.preview-card__url a {
  color: var(--text-secondary);
  text-decoration: none;
}

.preview-card__url a:hover {
  color: var(--color-iris);
  text-decoration: underline;
}

.preview-card__meta {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

/* ── Monitoring bar ──────────────────────────────────────────────────────── */

.monitor-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.monitor-metric {
  flex: 1;
  background: var(--bg-badge);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: background var(--transition-base), border-color var(--transition-base);
}

.monitor-metric__label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: 700;
  margin-bottom: 2px;
}

.monitor-metric__value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-paris);
  font-variant-numeric: tabular-nums;
}

/* ── Container status ────────────────────────────────────────────────────── */

.container-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
}

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

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

.container-dot--running { background: var(--color-green); }
.container-dot--exited  { background: var(--color-red); }
.container-dot--other   { background: var(--color-gray-300); }

/* ── Card entrance animation ─────────────────────────────────────────────── */

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-card {
  animation: card-in 0.35s ease both;
}

.app-card:nth-child(1)  { animation-delay: 0.02s; }
.app-card:nth-child(2)  { animation-delay: 0.06s; }
.app-card:nth-child(3)  { animation-delay: 0.10s; }
.app-card:nth-child(4)  { animation-delay: 0.14s; }
.app-card:nth-child(5)  { animation-delay: 0.18s; }
.app-card:nth-child(6)  { animation-delay: 0.22s; }
.app-card:nth-child(7)  { animation-delay: 0.26s; }
.app-card:nth-child(8)  { animation-delay: 0.30s; }
.app-card:nth-child(9)  { animation-delay: 0.34s; }
.app-card:nth-child(10) { animation-delay: 0.38s; }

/* ── Health dots (#2) ────────────────────────────────────────────────────── */

.health-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

.health-dot--ok {
  background: var(--color-green);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.health-dot--fail {
  background: var(--color-red);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.health-dot--bg {
  background: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.health-dot--unknown {
  background: var(--color-gray-300);
}

/* ── Favorites (#3) ──────────────────────────────────────────────────────── */

.fav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-gray-300);
  cursor: pointer;
  transition: color var(--transition-fast), transform 0.1s;
}

.fav-btn:hover {
  color: var(--color-yellow);
  transform: scale(1.15);
}

.fav-btn--active {
  color: var(--color-yellow);
}

.app-card--fav {
  border-color: rgba(245, 158, 11, 0.3);
}

.app-card--fav::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--color-yellow), transparent);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* ── Preview URL rows on cards ───────────────────────────────────────────── */

.info-row--preview {
  padding-left: 2px;
}

.info-row--preview svg {
  color: var(--color-purple-rain);
}

/* ── Toast notifications (#5) ────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.8125rem;
  font-family: var(--font-family);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.toast--success {
  border-left: 3px solid var(--color-green);
}

.toast--error {
  border-left: 3px solid var(--color-red);
}

.toast--info {
  border-left: 3px solid var(--color-blue);
}

/* ── Redeploy & ghost-dark button (#4) ───────────────────────────────────── */

.btn--ghost-dark {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.btn--ghost-dark:hover {
  background: var(--bg-surface-hover);
  border-color: var(--color-purple-rain);
  color: var(--text-primary);
}

/* ── Deployment log viewer (#1) ──────────────────────────────────────────── */

.log-viewer {
  background: var(--palette-navy);
  color: #d4d4d4;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.6875rem;
  line-height: 1.6;
  padding: 14px;
  border-radius: var(--radius-sm);
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--color-purple-rain);
  border-color: var(--color-purple-rain);
}

/* ── Environment variables (#7) ──────────────────────────────────────────── */

.env-var-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
}

.env-var-row:last-child {
  border-bottom: none;
}

.env-var-key {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--color-purple-rain);
  font-weight: 600;
}

.env-var-value {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

/* ── About / FAQ page ─────────────────────────────────────────────── */
.about-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.about-heading {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.about-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.about-section {
  margin-bottom: 2.5rem;
}

.about-section h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}

.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.about-feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.about-feature h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-purple-rain);
}

.about-feature ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-feature li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.about-feature li::before {
  content: '→ ';
  color: var(--color-purple-rain);
  font-weight: 600;
}

/* FAQ accordion */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: '▸ ';
  color: var(--color-purple-rain);
  font-size: 1.1rem;
}

.faq-item[open] summary::before {
  content: '▾ ';
}

.faq-item p {
  padding: 0 1.25rem 1rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.faq-item code {
  background: var(--bg-surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

.about-table {
  width: 100%;
  border-collapse: collapse;
}

.about-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.about-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
  width: 120px;
  color: var(--color-purple-rain);
}

.about-footer {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  margin-top: 2rem;
}

.about-footer a {
  color: var(--color-purple-rain);
}

/* ── Modal ───────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-base);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal--wide {
  max-width: 800px;
}

.modal--wide .log-viewer {
  max-height: 60vh;
  margin: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

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

.modal__body {
  padding: 16px 24px;
}

.modal__description {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 20px;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ── Branch deploy badge ──────────────────────────────────────────────────── */

.badge--branch-deploy {
  background: var(--color-blue-light);
  color: var(--color-blue);
  font-weight: 600;
}

.badge--sso {
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

[data-theme="dark"] .badge--sso {
  background: rgba(109, 40, 217, 0.2);
  color: #c4b5fd;
}

.badge--label {
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
  font-size: 0.6875rem;
}

[data-theme="dark"] .badge--label {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
}

/* ── Build queue (#2) ────────────────────────────────────────────────────── */

.build-queue-section {
  margin-bottom: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.build-queue__header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-paris);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}

.build-queue__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-job {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  font-size: 0.8125rem;
}

.queue-job__state {
  font-weight: 600;
  text-transform: capitalize;
  font-size: 0.75rem;
  min-width: 68px;
}

.queue-job__state--active {
  color: var(--color-yellow);
}

.queue-job__state--waiting {
  color: var(--text-tertiary);
}

.queue-job__state--completed {
  color: var(--color-green);
}

.queue-job__state--failed {
  color: var(--color-red);
}

.queue-job__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.queue-job__time {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  white-space: nowrap;
}
