/* ─────────────────────────────────────────────────────────────
   REDEPLOY SAAS - ENTERPRISE DEVOPS DESIGN SYSTEM (styles.css)
   Designed for senior engineers and modern infrastructure panels
   References: Supabase, Linear, Vercel, Stripe, Raycast
   ───────────────────────────────────────────────────────────── */

:root {
  /* Core Palette: Matte Slate / Graphite */
  --bg-primary: #090a0f;      /* Deep primary canvas */
  --bg-secondary: #121318;    /* Elevated surface cards */
  --bg-tertiary: #18191f;     /* High elevation tooltips / active panels */
  
  --border-color: rgba(255, 255, 255, 0.055); /* Sharp 1px borders */
  --border-hover: rgba(255, 255, 255, 0.12);   /* Interactive hover borders */
  --border-active: rgba(99, 102, 241, 0.35);   /* Indigo/Blue focus indicator */
  
  --text-primary: #f3f4f6;    /* Crisp Soft White */
  --text-secondary: #9cb3c9;  /* Balanced Slate Gray secondary */
  --text-muted: #5e6b7c;      /* Professional Low-contrast Gray */
  
  /* Desaturated Muted Engineering Accents */
  --accent-purple: #9061f9;
  --accent-blue: #3b82f6;
  --accent-indigo: #4f46e5;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  
  /* Typography */
  --font-sans: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', 'Fira Code', monospace;
}

/* Base Resets & Global Smoothness */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  height: 100vh;
  position: relative;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Disable Childish Neon Blobs for Corporate DevOps Aesthetics */
.blob {
  display: none !important;
}

/* Premium Surface Panels */
.glass-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.5);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

/* ─────────────────────────────────────────────────────────────
   COMPACT & DENSE BUTTON SYSTEM
   ───────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  outline: none;
  user-select: none;
}

/* Premium Vercel / Supabase Primary Style */
.btn-primary {
  background: #f3f4f6;
  color: #090a0f;
  border-color: #f3f4f6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
  background: #e5e7eb;
}

/* Muted Dark Secondary Style */
.btn-secondary {
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.08);
}

/* Muted Emerald Action Style */
.btn-success {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.05);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.1);
}

/* Muted Rose Action Style */
.btn-danger {
  background: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #fb7185;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Pulsing effect for deployment */
.pulsing {
  position: relative;
}
.pulsing::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 1.5px solid var(--accent-emerald);
  opacity: 0;
  animation: pulse-ring 2s infinite ease-out;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.08); opacity: 0; }
}

/* ─────────────────────────────────────────────────────────────
   AUTHENTICATION SCREEN (Linear Style Minimal)
   ───────────────────────────────────────────────────────────── */
#auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  background-color: var(--bg-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#auth-screen.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.brand-logo {
  font-size: 2rem;
  margin-bottom: 12px;
  text-align: center;
}

.auth-box h1 {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  text-align: left;
  margin-bottom: 20px;
}

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

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px 10px 38px;
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.15s ease;
  outline: none;
}

.input-wrapper input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
  background: rgba(0, 0, 0, 0.5);
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
}

#login-btn {
  width: 100%;
  justify-content: center;
  padding: 11px;
  font-size: 0.9rem;
}

.error-msg {
  color: #fb7185;
  font-size: 0.8rem;
  margin-top: 12px;
  font-weight: 500;
  text-align: center;
  min-height: 18px;
}

/* ─────────────────────────────────────────────────────────────
   MAIN DASHBOARD SCREEN LAYOUT
   ───────────────────────────────────────────────────────────── */
#dashboard-screen {
  display: none;
  height: 100vh;
  z-index: 10;
  position: relative;
  background-color: var(--bg-primary);
}

#dashboard-screen.active {
  display: grid;
  grid-template-columns: 260px 1fr;
}

/* ─────────────────────────────────────────────────────────────
   SIDEBAR (Railway / Supabase style)
   ───────────────────────────────────────────────────────────── */
.sidebar {
  height: 100%;
  border-right: 1px solid var(--border-color);
  border-radius: 0;
  background: #0b0c10;
  display: flex;
  flex-direction: column;
  padding: 20px;
  z-index: 10;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 1.15rem;
}

.logo-area h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.vps-badge {
  font-size: 0.65rem;
  background: rgba(16, 185, 129, 0.05);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.15);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.projects-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  width: 100%;
}

.projects-list-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-add-project {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
}

.btn-add-project:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: none;
  box-shadow: none;
}

.projects-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

/* Elegant Thin Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ─────────────────────────────────────────────────────────────
   PROJECT ITEM CARD (Tactile & Minimal)
   ───────────────────────────────────────────────────────────── */
.project-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-card:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
}

.project-card.active {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.12);
}

.project-card h4 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.01em;
}

.project-card h4::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background-color: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.project-card.active h4::after {
  background-color: var(--accent-emerald);
  box-shadow: none !important; /* Muted corporate status indicator */
}

.project-card .card-path {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card .card-branch {
  font-size: 0.7rem;
  color: var(--accent-blue);
  font-weight: 500;
  margin-top: 1px;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.sidebar-footer #logout-btn {
  width: 100%;
  font-size: 0.8rem;
  padding: 8px;
  justify-content: center;
}

/* ─────────────────────────────────────────────────────────────
   WORKSPACE CONTAINER
   ───────────────────────────────────────────────────────────── */
.content-workspace {
  height: 100%;
  padding: 24px;
  overflow-y: auto;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Blank Selection State */
.no-selection {
  flex: 1;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 300px;
}

.no-selection.active {
  display: flex;
}

.no-selection-content {
  max-width: 400px;
  padding: 20px;
}

.no-selection-content .icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.7;
}

.no-selection-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.no-selection-content p {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.88rem;
}

/* Workspace Grid active */
.workspace-grid {
  display: none;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.workspace-grid.active {
  display: flex;
}

/* Workspace Header */
.workspace-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workspace-header h1 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.path-display {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* Danger Hover Button for Delete */
.btn-danger-hover:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ─────────────────────────────────────────────────────────────
   WEBHOOK Spec details Panel
   ───────────────────────────────────────────────────────────── */
.webhook-panel {
  display: none;
  flex-direction: column;
  padding: 16px;
  gap: 10px;
  border-color: rgba(255, 255, 255, 0.08);
}

.webhook-panel.active {
  display: flex;
}

.webhook-panel h3 {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.webhook-panel p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.webhook-details-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.webhook-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
}

.webhook-row .label {
  width: 80px;
  color: var(--text-muted);
  font-weight: 600;
}

.webhook-row code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--accent-emerald);
  word-break: break-all;
  flex: 1;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
}

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

/* Workspace Layout Columns */
.workspace-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

/* ─────────────────────────────────────────────────────────────
   GIT EXPLORER PANEL
   ───────────────────────────────────────────────────────────── */
.git-panel {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.panel-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.panel-section-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.branch-badge {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.git-status-section h4, .git-commits-section h4 {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  font-weight: 700;
}

.git-status-output {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
  overflow-x: auto;
  color: #cbd5e1;
  max-height: 120px;
}

/* Commits timeline cards */
.commit-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.commit-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--accent-indigo);
  border-radius: 6px;
  padding: 10px 12px;
  transition: all 0.15s ease;
}

.commit-card:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.08);
}

.commit-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.commit-author {
  font-weight: 600;
  color: var(--text-secondary);
}

.commit-hash {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.03);
  padding: 1px 4px;
  border-radius: 3px;
}

.commit-msg {
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

/* ─────────────────────────────────────────────────────────────
   TERMINAL PANEL (SSH console styled like Warp / Hyper)
   ───────────────────────────────────────────────────────────── */
.terminal-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #050608;
  border-color: rgba(255, 255, 255, 0.06);
}

.terminal-header {
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.terminal-dots {
  display: flex;
  gap: 5px;
}

.terminal-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.terminal-dots .dot.red { background-color: var(--accent-rose); opacity: 0.85; }
.terminal-dots .dot.yellow { background-color: var(--accent-amber); opacity: 0.85; }
.terminal-dots .dot.green { background-color: var(--accent-emerald); opacity: 0.85; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn-terminal-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
}

.btn-terminal-action:hover {
  color: var(--text-primary);
}

.terminal-screen {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Console line variants */
.system-line {
  color: var(--text-muted);
  font-style: italic;
}

.command-line {
  color: var(--accent-blue);
  font-weight: 600;
}

.stdout-line {
  color: #cbd5e1;
  white-space: pre-wrap;
}

.stderr-line {
  color: #fda4af;
  white-space: pre-wrap;
}

.success-line {
  color: var(--accent-emerald);
  font-weight: 500;
}

/* Input Prompt Area */
.prompt-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.prompt-prefix {
  color: var(--accent-purple);
  font-weight: 600;
  white-space: nowrap;
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

/* Terminal Quick Shortcuts bar */
.terminal-quick-shortcuts {
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.shortcut-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 2px;
  letter-spacing: 0.02em;
}

.terminal-quick-shortcuts button {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.terminal-quick-shortcuts button:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Project skeletons during initial load */
.project-skeleton {
  height: 52px;
  background: linear-gradient(90deg, rgba(255,255,255,0.01) 25%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0.01) 75%);
  background-size: 200% 100%;
  animation: loading-skeleton 1.5s infinite;
  border-radius: 6px;
}

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

/* ─────────────────────────────────────────────────────────────
   Danger Hover Button for Delete
   ───────────────────────────────────────────────────────────── */
.btn-danger-hover:hover {
  background: rgba(244, 63, 94, 0.12) !important;
  color: #fda4af !important;
  border-color: rgba(244, 63, 94, 0.25) !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ─────────────────────────────────────────────────────────────
   MODAL DIALOG (Enterprise layout Supabase style)
   ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

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

.modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

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

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}

.btn-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-body .form-group {
  margin-bottom: 0;
}

.modal-body label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.modal-body input, .modal-body select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.15s ease;
}

.modal-body input:focus, .modal-body select:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
  background: rgba(0, 0, 0, 0.5);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.modal-footer .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* ─────────────────────────────────────────────────────────────
   PANEL TABS (Git Explorer / Deploy Logs)
   ───────────────────────────────────────────────────────────── */
.panel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 8px 8px 0 0;
}

.panel-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: -1px;
}

.panel-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.panel-tab.active {
  color: #fff;
  border-bottom-color: var(--accent-indigo);
  text-shadow: none;
}

.tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* ─────────────────────────────────────────────────────────────
   SYSTEM CONTROLS SECTION
   ───────────────────────────────────────────────────────────── */
.system-controls-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.system-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.btn-sys {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sys:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  box-shadow: none;
  transform: none;
}

.btn-sys:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────
   DEPLOYMENT LOGS LIST
   ───────────────────────────────────────────────────────────── */
.logs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 4px 0;
  flex: 1;
}

.log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.log-item:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  transform: none;
}

.log-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.log-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  word-break: break-all;
  transition: color 0.15s;
}

.log-item:hover .log-name {
  color: var(--text-primary);
}

/* ─────────────────────────────────────────────────────────────
   SESSION INFO (Sidebar Footer)
   ───────────────────────────────────────────────────────────── */
.session-info {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 0;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

/* ─────────────────────────────────────────────────────────────
   GIT PANEL — enforce flex column so tabs fill height
   ───────────────────────────────────────────────────────────── */
.git-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────
   DEPLOYMENT STATUS BADGES (Dense and Sleek)
   ───────────────────────────────────────────────────────────── */
.status-success {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.18);
  color: var(--accent-emerald);
  box-shadow: none;
}

.status-failed {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  box-shadow: none;
}

.status-pending {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.18);
  color: #fde047;
  box-shadow: none;
}

/* Pulsing animation for active deployments button */
.btn-success.deploying {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #ffcc66 !important;
  animation: deploy-btn-pulse 1.8s infinite alternate ease-in-out;
  cursor: not-allowed;
  box-shadow: none !important;
}

@keyframes deploy-btn-pulse {
  0% { opacity: 0.75; }
  100% { opacity: 1; }
}

/* Project Sidebar Health Badges */
.health-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  display: inline-block;
}

.health-healthy {
  background: rgba(16, 185, 129, 0.05);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.health-down {
  background: rgba(239, 68, 68, 0.05);
  color: #fda4af;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.health-checking {
  background: rgba(245, 158, 11, 0.05);
  color: #fef08a;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.health-not-configured {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Last Deploy Header Banner */
.last-deploy-text {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.01em;
  display: inline-block;
}

.last-deploy-success {
  background: rgba(16, 185, 129, 0.05);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.last-deploy-failed {
  background: rgba(239, 68, 68, 0.05);
  color: #fda4af;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.last-deploy-pending {
  background: rgba(245, 158, 11, 0.05);
  color: #fef08a;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

/* ─────────────────────────────────────────────────────────────
   LOG FILTER BAR (Highly Clean layout)
   ───────────────────────────────────────────────────────────── */
.log-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.log-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.log-search-icon {
  position: absolute;
  left: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

.log-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 6px 10px 6px 30px;
  outline: none;
  transition: all 0.15s ease;
}

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

.log-search-input:focus {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.08);
}

.log-status-filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.log-filter-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 10px;
  transition: all 0.15s ease;
}

.log-filter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.log-filter-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────
   DASHBOARD STATS BAR (Railway Matte style)
   ───────────────────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 0 4px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  cursor: default;
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease;
}

.stat-card::before {
  display: none;
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.stat-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.8;
}

.stat-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Color tints - stat cards */
.stat-card.stat-success {
  border-color: rgba(16, 185, 129, 0.12);
}
.stat-card.stat-success .stat-value {
  color: #58d68d;
}
.stat-card.stat-success:hover {
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.04);
}

.stat-card.stat-failed {
  border-color: rgba(239, 68, 68, 0.12);
}
.stat-card.stat-failed .stat-value {
  color: #fca5a5;
}
.stat-card.stat-failed:hover {
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.04);
}

/* Active deploy pulsing highlight */
.stat-card.stat-active-pulse {
  border-color: rgba(245, 158, 11, 0.25);
  animation: stat-pulse 2.2s ease-in-out infinite;
}
.stat-card.stat-active-pulse .stat-value {
  color: #fbbf24;
}

@keyframes stat-pulse {
  0%, 100% { box-shadow: none; border-color: rgba(245, 158, 11, 0.25); }
  50% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.05); border-color: rgba(245, 158, 11, 0.45); }
}

/* ─────────────────────────────────────────────────────────────
   REAL-TIME DEPLOY STEPPER PROGRESS PROGRESS STYLES
   ───────────────────────────────────────────────────────────── */
.deploy-stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  gap: 6px;
  overflow-x: auto;
  transition: all 0.2s ease;
  display: none; /* hidden by default */
}

.deploy-stepper.active {
  display: flex;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  min-width: 70px;
}

/* Connector line */
.stepper-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
  z-index: 1;
  transition: all 0.3s ease;
}

.stepper-step.completed:not(:last-child)::after {
  background: var(--accent-emerald);
  opacity: 0.4;
}

.stepper-step.active-step:not(:last-child)::after {
  background: var(--accent-indigo);
  opacity: 0.4;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  z-index: 2;
  transition: all 0.3s ease;
}

.stepper-step.pending .step-circle {
  color: var(--text-muted);
}

.stepper-step.running .step-circle {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--accent-indigo);
  color: #fff;
  animation: step-pulse 1.8s infinite ease-in-out;
}

.stepper-step.completed .step-circle {
  background: rgba(16, 185, 129, 0.06);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.stepper-step.failed .step-circle {
  background: rgba(244, 63, 94, 0.06);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

.step-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  transition: all 0.3s ease;
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stepper-step.running .step-label {
  color: #fff;
}

.stepper-step.completed .step-label {
  color: var(--accent-emerald);
}

.stepper-step.failed .step-label {
  color: var(--accent-rose);
}

@keyframes step-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}


/* ─────────────────────────────────────────────────────────────
   VERCEL / NETLIFY LEVEL POLISH PATCH
   This section is intentionally written as a non-breaking enhancement layer.
   It improves hierarchy, density, motion, terminal realism and SaaS polish.
   ───────────────────────────────────────────────────────────── */

/* Premium canvas rhythm */
:root {
  --surface-0: #07080c;
  --surface-1: #0b0d12;
  --surface-2: #10131a;
  --surface-3: #151923;
  --surface-4: #1b202b;
  --surface-hover: rgba(255,255,255,0.045);
  --surface-pressed: rgba(255,255,255,0.065);
  --line-soft: rgba(255,255,255,0.045);
  --line-mid: rgba(255,255,255,0.075);
  --line-strong: rgba(255,255,255,0.115);
  --text-strong: #f8fafc;
  --text-normal: #d7dde7;
  --text-soft: #98a2b3;
  --text-faint: #667085;
  --brand: #f5f5f5;
  --brand-invert: #050608;
  --blue-soft: #60a5fa;
  --green-soft: #34d399;
  --yellow-soft: #fbbf24;
  --red-soft: #fb7185;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --shadow-panel: 0 1px 0 rgba(255,255,255,0.03) inset, 0 18px 50px rgba(0,0,0,0.26);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 8px 24px rgba(0,0,0,0.22);
  --shadow-button: 0 1px 0 rgba(255,255,255,0.08) inset, 0 1px 2px rgba(0,0,0,0.4);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base refinements */
html {
  background: var(--surface-0);
  color-scheme: dark;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 0%, rgba(96, 165, 250, 0.035), transparent 32rem),
    radial-gradient(circle at 80% 12%, rgba(52, 211, 153, 0.025), transparent 28rem),
    linear-gradient(180deg, rgba(255,255,255,0.012), transparent 18rem);
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.35), transparent 55%);
  opacity: 0.35;
  z-index: 0;
}

/* Main app shell */
#dashboard-screen.active {
  background:
    linear-gradient(180deg, var(--surface-0), var(--surface-1));
}

.dashboard-layout {
  isolation: isolate;
}

.content-workspace > * {
  position: relative;
}

/* Better sidebar product feel */
.sidebar {
  background:
    linear-gradient(180deg, rgba(11,13,18,0.98), rgba(7,8,12,0.98));
  border-right-color: rgba(255,255,255,0.07);
}

.sidebar-header {
  min-height: 36px;
}

.logo-area {
  min-width: 0;
}

.logo-area h2 {
  line-height: 1;
}

.logo-area::after {
  content: "private deploy console";
  display: block;
  position: absolute;
  transform: translate(28px, 17px);
  font-size: 0.58rem;
  color: var(--text-faint);
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-transform: uppercase;
}

.vps-badge {
  box-shadow: 0 0 0 1px rgba(16,185,129,0.05) inset;
}

/* Sidebar project cards - product-grade */
.project-card {
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
  opacity: 0;
  transition: opacity 160ms var(--ease-in-out);
  pointer-events: none;
}

.project-card:hover::before,
.project-card.active::before {
  opacity: 1;
}

.project-card.active {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 8px 18px rgba(0,0,0,0.18);
}

.project-card.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 999px;
  background: var(--green-soft);
  opacity: 0.9;
}

.project-card h4 {
  line-height: 1.25;
  max-width: 100%;
}

.project-card .card-path {
  opacity: 0.9;
}

.project-card .card-branch {
  color: var(--blue-soft);
}

/* Workspace composition */
.content-workspace {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.012), transparent 20rem);
}

.workspace-grid {
  min-height: 0;
}

.workspace-header {
  min-height: 72px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01)),
    var(--surface-2);
  box-shadow: var(--shadow-card);
}

.workspace-header .header-details {
  min-width: 0;
}

.workspace-header h1 {
  line-height: 1.15;
  max-width: 720px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.path-display {
  max-width: 760px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Header action buttons */
.header-actions .btn {
  height: 32px;
}

.header-actions .btn-success {
  color: #ecfdf5;
  background: linear-gradient(180deg, rgba(16,185,129,0.2), rgba(16,185,129,0.12));
  border-color: rgba(16,185,129,0.34);
}

.header-actions .btn-success:hover {
  background: linear-gradient(180deg, rgba(16,185,129,0.26), rgba(16,185,129,0.16));
}

/* Stat cards like Vercel deployment overview */
.stats-bar {
  align-items: stretch;
}

.stat-card {
  min-height: 64px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent),
    var(--surface-2);
  box-shadow: var(--shadow-card);
}

.stat-card .stat-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.055);
  font-size: 1rem;
}

.stat-card.stat-success .stat-icon {
  background: rgba(16,185,129,0.07);
  border-color: rgba(16,185,129,0.18);
}

.stat-card.stat-failed .stat-icon {
  background: rgba(239,68,68,0.07);
  border-color: rgba(239,68,68,0.18);
}

.stat-value {
  font-feature-settings: "tnum" 1, "ss01" 1;
}

.stat-label {
  white-space: nowrap;
}

/* Two column panels */
.workspace-row > .glass-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 180px),
    var(--surface-2);
  box-shadow: var(--shadow-panel);
}

/* Git panel polish */
.git-panel {
  position: relative;
}

.git-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  opacity: 0.45;
}

.panel-tabs {
  padding-inline: 10px;
}

.panel-tab {
  position: relative;
}

.panel-tab.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--brand);
  border-radius: 999px 999px 0 0;
  opacity: 0.9;
}

.panel-tab.active {
  border-bottom-color: transparent;
}

/* Branch and status */
.branch-badge {
  font-feature-settings: "tnum" 1;
}

.git-status-output {
  min-height: 42px;
}

.git-status-output:empty::before {
  content: "No local changes";
  color: var(--text-faint);
}

/* Commit cards */
.commit-card {
  position: relative;
}

.commit-card::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--blue-soft);
  border-radius: 999px;
  opacity: 0.85;
}

.commit-card:hover::before {
  opacity: 1;
}

.commit-msg {
  letter-spacing: -0.005em;
}

/* Terminal premium treatment */
.terminal-panel {
  background:
    radial-gradient(circle at top left, rgba(96,165,250,0.035), transparent 24rem),
    #030406;
}

.terminal-header {
  min-height: 36px;
}

.terminal-title {
  text-transform: uppercase;
}

.terminal-screen {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.01), transparent 120px),
    #030406;
}

.terminal-screen .system-line:first-child {
  margin-top: 2px;
}

.terminal-screen div {
  min-height: 1.08em;
}

/* Terminal output grouping */
.stdout-line,
.stderr-line,
.success-line,
.command-line,
.system-line {
  padding-inline: 0;
}

.command-line::before {
  content: "$ ";
  color: var(--text-faint);
  opacity: 0.8;
}

.command-line {
  color: #93c5fd;
}

.success-line {
  color: #7dd3a8;
}

.stderr-line {
  color: #fda4af;
}

/* Quick action buttons */
.terminal-quick-shortcuts {
  min-height: 44px;
}

.terminal-quick-shortcuts button {
  height: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.terminal-quick-shortcuts button:active {
  transform: translateY(1px);
}

/* Webhook panel */
.webhook-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), transparent),
    var(--surface-2);
}

.webhook-details-box {
  position: relative;
}

.webhook-details-box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
  pointer-events: none;
}

.webhook-row code {
  line-height: 1.5;
}

/* Deploy stepper refined pipeline */
.deploy-stepper {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015), transparent),
    rgba(0,0,0,0.22);
}

.stepper-step {
  user-select: none;
}

.stepper-step:not(:last-child)::after {
  top: 14px;
}

.step-circle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.stepper-step.running .step-circle {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.06);
}

.stepper-step.completed .step-circle {
  box-shadow: 0 0 0 3px rgba(16,185,129,0.04);
}

.stepper-step.failed .step-circle {
  box-shadow: 0 0 0 3px rgba(244,63,94,0.04);
}

/* Log filter and list */
.log-filter-bar {
  background: rgba(0,0,0,0.08);
  border-radius: var(--radius-md);
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.035);
}

.log-item {
  min-height: 40px;
}

.log-status {
  font-feature-settings: "tnum" 1;
}

.log-search-input {
  height: 32px;
}

/* Modal polish */
.modal-overlay.active {
  animation: overlay-in 160ms var(--ease-out);
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 24px 80px rgba(0,0,0,0.68);
}

.modal-header,
.modal-footer {
  background: rgba(255,255,255,0.012);
}

.modal-body select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* Better focus ring for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgba(96,165,250,0.58);
  outline-offset: 2px;
}

/* Form consistency */
input::selection,
textarea::selection,
pre::selection,
code::selection,
.terminal-screen div::selection {
  background: rgba(96,165,250,0.28);
  color: #fff;
}

.input-wrapper input::placeholder,
.modal-body input::placeholder,
.log-search-input::placeholder {
  color: rgba(148,163,184,0.55);
}

/* Empty states */
.no-selection.glass-panel {
  background:
    radial-gradient(circle at center, rgba(96,165,250,0.035), transparent 28rem),
    var(--surface-2);
}

.no-selection-content {
  border: 1px dashed rgba(255,255,255,0.07);
  border-radius: var(--radius-xl);
  background: rgba(0,0,0,0.12);
}

/* Status dot utilities */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
  background: var(--text-faint);
}

.status-dot.success {
  background: var(--green-soft);
}

.status-dot.warning {
  background: var(--yellow-soft);
}

.status-dot.error {
  background: var(--red-soft);
}

.status-dot.info {
  background: var(--blue-soft);
}

/* Dense table/list utilities for future components */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.data-table th {
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  color: var(--text-normal);
}

/* Better mobile behavior */
@media (max-width: 1180px) {
  #dashboard-screen.active {
    grid-template-columns: 230px 1fr;
  }

  .content-workspace {
    padding: 18px;
  }

  .workspace-row {
    grid-template-columns: 1fr;
  }

  .terminal-panel {
    min-height: 520px;
  }
}

@media (max-width: 760px) {
  #dashboard-screen.active {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    position: relative;
    height: auto;
    min-height: unset;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .projects-list {
    max-height: 220px;
  }

  .stats-bar {
    grid-template-columns: 1fr;
  }

  .workspace-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .header-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .deploy-stepper {
    align-items: flex-start;
  }

  .stepper-step {
    min-width: 78px;
  }
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print safe fallback */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .sidebar,
  .terminal-quick-shortcuts,
  .header-actions,
  .webhook-panel {
    display: none !important;
  }

  .glass-panel {
    background: #fff !important;
    color: #000 !important;
    border-color: #ddd !important;
    box-shadow: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   PREMIUM UTILITY LAYER
   These utilities help future screens stay consistent without new design drift.
   ───────────────────────────────────────────────────────────── */

.u-muted { color: var(--text-muted) !important; }
.u-soft { color: var(--text-soft) !important; }
.u-normal { color: var(--text-normal) !important; }
.u-strong { color: var(--text-strong) !important; }

.u-success { color: var(--green-soft) !important; }
.u-warning { color: var(--yellow-soft) !important; }
.u-danger { color: var(--red-soft) !important; }
.u-info { color: var(--blue-soft) !important; }

.u-mono { font-family: var(--font-mono) !important; }
.u-sans { font-family: var(--font-sans) !important; }

.u-fw-400 { font-weight: 400 !important; }
.u-fw-500 { font-weight: 500 !important; }
.u-fw-600 { font-weight: 600 !important; }
.u-fw-700 { font-weight: 700 !important; }

.u-radius-xs { border-radius: var(--radius-xs) !important; }
.u-radius-sm { border-radius: var(--radius-sm) !important; }
.u-radius-md { border-radius: var(--radius-md) !important; }
.u-radius-lg { border-radius: var(--radius-lg) !important; }
.u-radius-xl { border-radius: var(--radius-xl) !important; }

.u-border { border: 1px solid var(--line-soft) !important; }
.u-border-mid { border: 1px solid var(--line-mid) !important; }
.u-border-strong { border: 1px solid var(--line-strong) !important; }

.u-surface-1 { background: var(--surface-1) !important; }
.u-surface-2 { background: var(--surface-2) !important; }
.u-surface-3 { background: var(--surface-3) !important; }
.u-surface-4 { background: var(--surface-4) !important; }

.u-shadow-card { box-shadow: var(--shadow-card) !important; }
.u-shadow-panel { box-shadow: var(--shadow-panel) !important; }

.u-flex { display: flex !important; }
.u-inline-flex { display: inline-flex !important; }
.u-grid { display: grid !important; }
.u-hidden { display: none !important; }

.u-items-center { align-items: center !important; }
.u-items-start { align-items: flex-start !important; }
.u-items-end { align-items: flex-end !important; }
.u-justify-center { justify-content: center !important; }
.u-justify-between { justify-content: space-between !important; }
.u-justify-end { justify-content: flex-end !important; }

.u-gap-1 { gap: 4px !important; }
.u-gap-2 { gap: 8px !important; }
.u-gap-3 { gap: 12px !important; }
.u-gap-4 { gap: 16px !important; }
.u-gap-5 { gap: 20px !important; }
.u-gap-6 { gap: 24px !important; }

.u-p-1 { padding: 4px !important; }
.u-p-2 { padding: 8px !important; }
.u-p-3 { padding: 12px !important; }
.u-p-4 { padding: 16px !important; }
.u-p-5 { padding: 20px !important; }
.u-p-6 { padding: 24px !important; }

.u-px-1 { padding-left: 4px !important; padding-right: 4px !important; }
.u-px-2 { padding-left: 8px !important; padding-right: 8px !important; }
.u-px-3 { padding-left: 12px !important; padding-right: 12px !important; }
.u-px-4 { padding-left: 16px !important; padding-right: 16px !important; }
.u-px-5 { padding-left: 20px !important; padding-right: 20px !important; }
.u-px-6 { padding-left: 24px !important; padding-right: 24px !important; }

.u-py-1 { padding-top: 4px !important; padding-bottom: 4px !important; }
.u-py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.u-py-3 { padding-top: 12px !important; padding-bottom: 12px !important; }
.u-py-4 { padding-top: 16px !important; padding-bottom: 16px !important; }
.u-py-5 { padding-top: 20px !important; padding-bottom: 20px !important; }
.u-py-6 { padding-top: 24px !important; padding-bottom: 24px !important; }

.u-m-0 { margin: 0 !important; }
.u-mt-1 { margin-top: 4px !important; }
.u-mt-2 { margin-top: 8px !important; }
.u-mt-3 { margin-top: 12px !important; }
.u-mt-4 { margin-top: 16px !important; }
.u-mt-5 { margin-top: 20px !important; }
.u-mt-6 { margin-top: 24px !important; }

.u-mb-1 { margin-bottom: 4px !important; }
.u-mb-2 { margin-bottom: 8px !important; }
.u-mb-3 { margin-bottom: 12px !important; }
.u-mb-4 { margin-bottom: 16px !important; }
.u-mb-5 { margin-bottom: 20px !important; }
.u-mb-6 { margin-bottom: 24px !important; }

.u-text-xs { font-size: 0.68rem !important; }
.u-text-sm { font-size: 0.78rem !important; }
.u-text-md { font-size: 0.88rem !important; }
.u-text-lg { font-size: 1rem !important; }
.u-text-xl { font-size: 1.18rem !important; }
.u-text-2xl { font-size: 1.35rem !important; }

.u-leading-tight { line-height: 1.15 !important; }
.u-leading-snug { line-height: 1.3 !important; }
.u-leading-normal { line-height: 1.5 !important; }

.u-truncate {
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

.u-tabular {
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1 !important;
}

.u-clickable {
  cursor: pointer !important;
  transition: background-color 150ms var(--ease-in-out), border-color 150ms var(--ease-in-out), color 150ms var(--ease-in-out) !important;
}

.u-clickable:hover {
  background: var(--surface-hover) !important;
  border-color: var(--line-mid) !important;
}

.u-divider-x > * + * {
  border-left: 1px solid var(--line-soft) !important;
}

.u-divider-y > * + * {
  border-top: 1px solid var(--line-soft) !important;
}

/* ─────────────────────────────────────────────────────────────
   FUTURE COMPONENTS
   These do not break the existing UI, but allow quick expansion.
   ───────────────────────────────────────────────────────────── */

.deploy-event {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.015);
}

.deploy-event:hover {
  border-color: var(--line-mid);
  background: rgba(255,255,255,0.028);
}

.deploy-event-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-soft);
  color: var(--text-soft);
}

.deploy-event-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-normal);
  line-height: 1.25;
}

.deploy-event-meta {
  font-size: 0.68rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.deploy-event-time {
  font-size: 0.68rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--line-soft);
}

.metric-strip-item {
  background: var(--surface-2);
  padding: 10px 12px;
}

.metric-strip-label {
  color: var(--text-faint);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-strip-value {
  margin-top: 4px;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
}

/* Command palette style component */
.command-palette {
  width: min(680px, calc(100vw - 32px));
  background: var(--surface-2);
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 90px rgba(0,0,0,0.72);
  overflow: hidden;
}

.command-palette-input {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(0,0,0,0.18);
  color: var(--text-strong);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
}

.command-palette-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

.command-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  color: var(--text-normal);
  font-size: 0.85rem;
  cursor: pointer;
}

.command-palette-item:hover,
.command-palette-item.active {
  background: var(--surface-hover);
}

.command-palette-kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-faint);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 2px 5px;
}

/* Toast notifications */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  width: 340px;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-lg);
  background: rgba(17,20,27,0.96);
  box-shadow: var(--shadow-panel);
  padding: 12px;
  pointer-events: auto;
}

.toast-title {
  color: var(--text-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.toast-body {
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.45;
  margin-top: 4px;
}

.toast.success {
  border-color: rgba(16,185,129,0.22);
}

.toast.error {
  border-color: rgba(239,68,68,0.22);
}

.toast.warning {
  border-color: rgba(245,158,11,0.22);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.breadcrumbs a {
  color: var(--text-soft);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--text-strong);
}

.breadcrumb-separator {
  color: var(--text-faint);
  opacity: 0.7;
}

/* KBD */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.45) inset;
}

/* Code blocks */
pre,
code {
  font-variant-ligatures: none;
}

pre.code-block {
  background: #050608;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  overflow: auto;
  color: var(--text-normal);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.55;
}

/* refined links */
a {
  color: var(--blue-soft);
}

a:hover {
  color: #93c5fd;
}

/* Selection and tap */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Final layout polish */
.glass-panel,
.stat-card,
.project-card,
.log-item,
.modal-card,
.webhook-details-box,
.git-status-output,
.terminal-panel,
.no-selection-content {
  background-clip: padding-box;
}

