/* ============================================================
   AI GIT DEBUGGING AGENT — DARK GREEN & BLACK DESIGN SYSTEM
   Palette: Deep Obsidian Black & Emerald Neon Green (Production)
   ============================================================ */

:root {
  /* Canvas & Surfaces — Professional Charcoal Obsidian & Slate */
  --c-bg: #090d10;
  --c-bg-alt: #0d1117;
  --c-surface: #11161d;
  --c-surface-card: #161b22;
  --c-surface-elevated: #1c232d;
  --c-surface-subtle: #0b0f14;
  --c-surface-hover: #212833;

  /* Borders & Dividers — Crisp Neutral Slate */
  --c-border: #21262d;
  --c-border-hover: #30363d;
  --c-border-subtle: #181f28;
  --c-border-focus: #10b981;

  /* Typography — Crisp High-Contrast Neutrals */
  --c-text: #f0f6fc;
  --c-text-secondary: #c9d1d9;
  --c-text-muted: #8b949e;
  --c-text-inverse: #090d10;

  /* Accents — Elegant Emerald Green (Surgical & Crisp) */
  --c-accent: #10b981;
  --c-accent-hover: #059669;
  --c-accent-light: rgba(16, 185, 129, 0.12);
  --c-accent-border: rgba(16, 185, 129, 0.32);
  --c-accent-glow: 0 0 16px rgba(16, 185, 129, 0.22);

  --c-purple: #8b5cf6;
  --c-purple-light: rgba(139, 92, 246, 0.15);
  --c-purple-border: rgba(139, 92, 246, 0.35);

  --c-success: #10b981;
  --c-success-light: rgba(16, 185, 129, 0.15);
  --c-success-border: rgba(16, 185, 129, 0.4);
  --c-success-text: #34d399;

  --c-warning: #f59e0b;
  --c-warning-light: rgba(245, 158, 11, 0.15);
  --c-warning-border: rgba(245, 158, 11, 0.4);
  --c-warning-text: #fbbf24;

  --c-danger: #ef4444;
  --c-danger-light: rgba(239, 68, 68, 0.15);
  --c-danger-border: rgba(239, 68, 68, 0.4);
  --c-danger-text: #f87171;

  /* Shadows — atmospheric dark emerald shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.7), 0 2px 4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.8), 0 4px 8px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 35px rgba(0, 0, 0, 0.85);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.95);

  /* Radii — refined */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;
  --r-full: 9999px;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "Fira Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background-color: var(--c-bg);
  color: var(--c-text);
  line-height: 1.5;
  font-size: 13px;
  font-weight: 500;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header - Locked Sticky Topbar */
.header {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 18px;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--c-text);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #1f2937, #111827);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
  font-size: 13px;
  box-shadow: none;
  flex-shrink: 0;
}

/* Active repo pill in header - Never broken or wrapped */
.active-repo-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  font-size: 11.5px;
  color: var(--c-text);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 210px;
  transition: all 0.15s;
}

.active-repo-badge:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-accent-border);
  color: var(--c-accent);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.18);
}

.active-repo-dot {
  width: 6px;
  height: 6px;
  background: var(--c-success);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--c-success);
  flex-shrink: 0;
}

#header-active-repo-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  max-width: 140px;
  display: inline-block;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
  margin: 0 8px;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.header-nav-item {
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c-text-secondary);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.header-nav-item:hover {
  background: var(--c-surface-hover);
  color: var(--c-text);
  border-color: var(--c-border);
}

.header-nav-item.active {
  background: var(--c-surface-elevated);
  color: var(--c-text);
  border-color: var(--c-border-hover);
  font-weight: 600;
}

/* Primary AI Debugging highlighted nav button */
.header-nav-item.nav-primary-item {
  color: var(--c-text-secondary);
  font-weight: 500;
  border-color: transparent;
}

.header-nav-item.nav-primary-item:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-border);
  color: var(--c-text);
}

.header-nav-item.nav-primary-item.active {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 18px;
  color: var(--c-text-secondary);
  transition: background 0.15s;
}

.header-mobile-toggle:hover {
  background: var(--c-surface-hover);
}

/* Mobile Navigation Backdrop & Drawer Overlay */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: #0d1210;
  border-left: 1px solid var(--c-border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.85);
  z-index: 1250;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  background: rgba(22, 27, 34, 0.5);
}

.mobile-drawer-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-card);
  border-radius: var(--r-md);
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
}

.mobile-drawer-close:hover {
  background: var(--c-surface-hover);
  color: var(--c-text);
  border-color: var(--c-border-hover);
}

.mobile-drawer-body {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.mobile-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-drawer-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--c-text-muted);
  padding: 0 6px;
}

.mobile-repo-badge {
  max-width: 100%;
  width: 100%;
  padding: 9px 12px;
  justify-content: flex-start;
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.mobile-nav-item:hover {
  background: var(--c-surface-hover);
  color: var(--c-text);
  border-color: var(--c-border);
}

.mobile-nav-item.active {
  background: var(--c-surface-elevated);
  color: var(--c-text);
  border-color: var(--c-border-hover);
  font-weight: 600;
}

.mobile-nav-item.mobile-nav-highlight {
  color: #10b981;
}

.mobile-nav-item.mobile-nav-highlight.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

.mobile-nav-item .m-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  display: inline-block;
}

.mobile-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--c-border);
  background: rgba(22, 27, 34, 0.4);
}

/* Status Indicator */
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

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

.status-dot.error {
  background: var(--c-danger);
}

.status-dot.warning {
  background: var(--c-warning);
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* Main Layout */
.main-layout {
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 24px 60px;
  width: 100%;
}

/* Page management */
.page {
  display: none;
  animation: fadeIn 0.18s ease;
  width: 100%;
}

.page.active {
  display: block;
}

/* Controlled Medium Page Layouts — eliminates oversized 1440px voids & stretches */
#page-issues,
#page-prs,
#page-ci,
#page-conflicts,
#page-settings,
#page-admin,
#page-user-panel {
  max-width: 1140px;
  margin: 0 auto;
}

#page-history {
  max-width: 1040px;
  margin: 0 auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cards & Containers */
.card {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--c-border-hover);
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
}

.card-subtitle {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

/* Quick Action Hero Row */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.action-card {
  background: linear-gradient(145deg, var(--c-surface-card), var(--c-surface));
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: var(--c-accent);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2), var(--shadow-lg);
  background: var(--c-surface-elevated);
}

.action-card.featured {
  border-color: var(--c-border-hover);
  background: linear-gradient(145deg, var(--c-surface-card), var(--c-surface));
  box-shadow: var(--shadow-sm);
}

.action-card.featured:hover {
  border-color: var(--c-accent-border);
  box-shadow: var(--shadow-md);
}

.action-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-xs);
}

.action-card.featured .action-card-icon {
  background: #238636;
  color: #fff;
  border: none;
}

.action-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 6px;
}

.action-card-desc {
  font-size: 13px;
  color: var(--c-text-secondary);
  line-height: 1.45;
  margin-bottom: 16px;
}

.action-card-footer {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-accent);
  gap: 6px;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
}

.section-subtitle {
  font-size: 13px;
  color: var(--c-text-muted);
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  grid-auto-rows: 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: 1fr;
  gap: 18px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  grid-auto-rows: 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

/* Stat Cards */
.stat-card {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.stat-card:hover {
  border-color: var(--c-border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.2;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: var(--r-sm);
}

.btn-lg {
  padding: 12px 22px;
  font-size: 14px;
  border-radius: var(--r-lg);
}

.btn-primary {
  background: #238636;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.015em;
  border: 1px solid #2ea043;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover:not(:disabled) {
  background: #2ea043;
  color: #ffffff;
  border-color: #3fb950;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-text);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--c-surface-hover);
  border-color: var(--c-border-hover);
  color: var(--c-text);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--c-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-text);
}

.btn-github {
  background: #21262d;
  color: #f0f6fc;
  border: 1px solid var(--c-border);
}

.btn-github:hover:not(:disabled) {
  background: #30363d;
  border-color: var(--c-border-hover);
}

.btn-danger {
  background: var(--c-danger-light);
  border-color: var(--c-danger-border);
  color: var(--c-danger);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
}

.btn-icon {
  padding: 8px;
  border-radius: var(--r-md);
}

/* Profile Picture */
.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--c-border);
}

.user-menu-btn {
  padding: 4px 8px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--c-border);
  flex-shrink: 0;
}

.full-width {
  width: 100%;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 9px 13px;
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--c-border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.form-textarea {
  resize: vertical;
  line-height: 1.5;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-accent {
  background: var(--c-accent-light);
  color: var(--c-accent);
  border: 1px solid var(--c-accent-border);
}

.badge-success {
  background: var(--c-success-light);
  color: var(--c-success-text);
  border: 1px solid var(--c-success-border);
}

.badge-warning {
  background: var(--c-warning-light);
  color: var(--c-warning-text);
  border: 1px solid var(--c-warning-border);
}

.badge-danger {
  background: var(--c-danger-light);
  color: var(--c-danger-text);
  border: 1px solid var(--c-danger-border);
}

.badge-secondary {
  background: var(--c-bg-alt);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  text-align: center;
  background: rgba(13, 17, 23, 0.35);
  border-radius: var(--r-md);
  margin: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 4px;
}

.empty-desc {
  font-size: 12px;
  color: var(--c-text-muted);
  max-width: 420px;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Section Header & Responsive Toolbar */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.section-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.form-select-repo {
  min-width: 170px;
  max-width: 260px;
  width: auto;
  text-overflow: ellipsis;
  background-color: var(--c-surface);
  border-color: var(--c-border);
  padding: 6px 10px;
  font-size: 12px;
}

.form-select-filter {
  min-width: 95px;
  max-width: 140px;
  width: auto;
  background-color: var(--c-surface);
  border-color: var(--c-border);
  padding: 6px 10px;
  font-size: 12px;
}

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

.form-input-sm {
  padding: 6px 10px;
  font-size: 12px;
}

/* History Sessions Cards */
.history-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--c-border-subtle);
  gap: 14px;
  transition: background 0.15s ease;
}

.history-item-card:hover {
  background: var(--c-surface-hover);
}

.history-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.history-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.history-card-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.history-card-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.history-repo-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--c-accent);
}

.history-session-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-text-muted);
}

.history-mode-pill {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 1px 5px;
  border-radius: var(--r-full);
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.history-query-text {
  font-weight: 600;
  font-size: 13px;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta-row {
  font-size: 11px;
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.history-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   DIRECTORY BROWSER MODAL (Interactive Folder Explorer)
   ============================================================ */

.folder-browser-dialog {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* Path breadcrumb bar */
.folder-path-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-text-secondary);
  overflow-x: auto;
  white-space: nowrap;
  min-height: 34px;
}

.folder-path-bar code {
  color: var(--c-accent);
  font-weight: 600;
  font-size: 11px;
  word-break: break-all;
  white-space: normal;
}

.folder-shortcut-pill {
  padding: 4px 12px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.folder-shortcut-pill:hover {
  background: var(--c-accent-light);
  border-color: var(--c-accent-border);
  color: var(--c-accent);
  transform: translateY(-1px);
}

.folder-shortcut-pill.active-shortcut {
  background: var(--c-accent-light);
  border-color: var(--c-accent);
  color: var(--c-accent);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Scrollable folder list */
.folder-list-container {
  max-height: 240px;
  min-height: 120px;
  overflow-y: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface-card);
  scroll-behavior: smooth;
  flex: 1 1 auto;
}

.folder-list-container::-webkit-scrollbar {
  width: 5px;
}

.folder-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.folder-list-container::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 4px;
}

.folder-list-container::-webkit-scrollbar-thumb:hover {
  background: var(--c-text-muted);
}

.folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  gap: 10px;
  color: var(--c-text);
}

.folder-row:last-child {
  margin-bottom: 0;
}

.folder-row:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-accent-border);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
  transform: translateX(2px);
}

.folder-row:nth-child(even) {
  background: var(--c-surface);
}

.folder-row:nth-child(even):hover {
  background: var(--c-surface-hover);
  border-color: var(--c-accent-border);
}

.folder-row-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.folder-icon {
  font-size: 15px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.folder-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Up button row */
.folder-row-up {
  background: var(--c-bg-alt) !important;
  font-weight: 600;
  color: var(--c-text-secondary);
  border-bottom: 1px solid var(--c-border) !important;
}

.folder-row-up:hover {
  background: var(--c-surface-hover) !important;
}

/* Current target repo bar */
.current-target-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--c-surface-elevated);
  border: 1px solid var(--c-accent-border);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.15);
  border-radius: var(--r-md);
  gap: 10px;
}

.current-target-title {
  font-size: 12px;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.01em;
}

.current-target-path {
  font-size: 11px;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
}


/* ============================================================
   DEBUG SESSION VIEW (Agent Pipeline)
   ============================================================ */

.debug-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.debug-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  gap: 16px;
  flex-wrap: wrap;
}

.debug-panels-row {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1024px) {
  .debug-panels-row {
    grid-template-columns: 1fr;
  }
}

/* Agent Phases Stepper - Compact, Professional & Clean */
#agent-phases {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

#agent-phases::-webkit-scrollbar {
  width: 4px;
}

#agent-phases::-webkit-scrollbar-track {
  background: transparent;
}

#agent-phases::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 4px;
}

.agent-phase {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border-subtle);
  background: var(--c-surface-card);
  transition: all 0.15s ease;
  position: relative;
  min-height: 38px;
}

.agent-phase:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-border);
}

.agent-phase.active {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
}

.agent-phase.done,
.agent-phase.completed {
  background: var(--c-surface-card);
  border-color: var(--c-border);
}

.agent-phase.failed {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
}

.agent-phase.pending {
  opacity: 0.6;
}

.agent-phase-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--c-border);
  color: var(--c-text-muted);
}

.agent-phase-icon.pending {
  background: var(--c-bg-alt);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}

.agent-phase-icon.active {
  background: var(--c-accent);
  color: #fff;
  animation: pulse 1.4s infinite;
}

.agent-phase-icon.done,
.agent-phase-icon.completed {
  background: rgba(35, 134, 54, 0.2);
  color: #3fb950;
  border: 1px solid rgba(35, 134, 54, 0.4);
}

.agent-phase-icon.failed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.agent-phase-body {
  flex: 1;
  min-width: 0;
}

.agent-phase-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-phase-desc {
  font-size: 10.5px;
  color: var(--c-text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 230px;
}

/* Tabs */
.tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-subtle);
  padding: 4px 6px 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  gap: 4px;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-item {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
  cursor: pointer;
  border-radius: var(--r-md) var(--r-md) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  transition: all 0.12s;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-item:hover {
  color: var(--c-text);
  background: var(--c-surface-hover);
}

.tab-item.active {
  color: var(--c-accent);
  background: var(--c-surface-card);
  border-color: var(--c-border);
  margin-bottom: -1px;
}

.tab-panel {
  display: none;
  background: var(--c-surface-card);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.tab-panel.active {
  display: block;
}

/* ============================================================
   DARK OBSIDIAN & EMERALD GITHUB DIFF VIEWER
   ============================================================ */
.code-block {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  background: #060907;
  color: #f0fdf4;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  overflow-x: auto;
}

.github-diff-viewer {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  background: #080d0a;
  border-radius: var(--r-md);
  color: var(--c-text);
  overflow-x: auto;
  border: 1px solid var(--c-border);
}

.diff-viewer {
  display: flex;
  flex-direction: column;
}

.diff-line {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  white-space: pre-wrap;
}

.diff-file-row {
  display: flex;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 20px;
  border-bottom: 1px solid rgba(24, 40, 31, 0.6);
}

.diff-line-add {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-left: 3px solid #10b981;
}

.diff-line-del {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-left: 3px solid #ef4444;
}

.diff-line-chunk {
  background-color: #0d1712 !important;
  color: #749381 !important;
  font-weight: 600;
  border-left: 3px solid #10b981;
  padding: 3px 8px !important;
  font-size: 11.5px;
}

.diff-line-context {
  background-color: #080d0a;
  color: #c2e0cf !important;
  border-left: 3px solid transparent;
}

.diff-line-number {
  width: 44px;
  padding-right: 8px;
  text-align: right;
  color: #526d5c;
  user-select: none;
  font-size: 11px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.3);
  border-right: 1px solid var(--c-border-subtle);
}

.diff-line-content {
  padding: 1px 10px;
  white-space: pre-wrap;
  word-break: break-all;
  flex: 1;
}

/* Branch switcher items */
.branch-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--c-border-subtle);
  cursor: pointer;
  transition: background 0.12s;
  font-size: 13px;
}

.branch-list-item:hover {
  background: var(--c-surface-hover);
}

.branch-list-item.active-branch {
  background: var(--c-accent-light);
  font-weight: 700;
  color: var(--c-accent);
}

/* Workspace quickpick cards */
.workspace-quickpick-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
}

.workspace-quickpick-card:hover {
  border-color: var(--c-accent-border);
  background: var(--c-surface-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 24px;
  width: 100%;
  max-width: 580px;
  max-height: min(90vh, 740px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.9), 0 0 1px rgba(16, 185, 129, 0.3);
  position: relative;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all 0.12s;
  z-index: 10;
}

.modal-close:hover {
  background: var(--c-surface-hover);
  color: var(--c-text);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 4px;
  flex-shrink: 0;
}

.modal-desc {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 14px;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border-subtle);
  flex-shrink: 0;
}

/* Repository Connect Cards */
.repo-connect-card {
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.repo-connect-card:hover {
  border-color: var(--c-accent-border);
  box-shadow: var(--shadow-md);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  background: var(--c-surface-elevated);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.18s ease;
  max-width: 520px;
  word-break: break-word;
  user-select: text;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.6;
  font-size: 16px;
  line-height: 1;
  transition: opacity var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}

.toast-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}

@keyframes slideUp {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast-success {
  border-color: var(--c-success-border);
  color: var(--c-success-text);
  border-left: 4px solid var(--c-success);
}

.toast-error {
  border-color: var(--c-danger-border);
  color: var(--c-danger-text);
  background: var(--c-surface-card);
  border-left: 4px solid var(--c-danger);
}

.toast-info {
  border-color: var(--c-accent-border);
  color: var(--c-accent);
  border-left: 4px solid var(--c-accent);
}

/* Spinners */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

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

.auth-card {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 1px rgba(16, 185, 129, 0.3);
}

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

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

.auth-divider-text {
  font-size: 12px;
  color: var(--c-text-muted);
}

.auth-error {
  padding: 10px 14px;
  background: var(--c-danger-light);
  border: 1px solid var(--c-danger-border);
  border-radius: var(--r-md);
  color: var(--c-danger-text);
  font-size: 12px;
  display: none;
}

.auth-google-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
}

.auth-google-divider::before,
.auth-google-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

.auth-google-divider span {
  font-size: 12px;
  color: var(--c-text-muted);
  white-space: nowrap;
}

.auth-google-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-google-section iframe {
  width: 100% !important;
  max-width: 340px;
}

/* Diff Syntax Highlighting */
.diff-viewer {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  max-height: 480px;
  overflow-y: auto;
  border-radius: var(--r-md);
  padding: 14px;
  background: #060907;
  color: #e2e8f0;
  border: 1px solid var(--c-border);
}

.diff-line {
  display: block;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-all;
}

.diff-line.diff-header {
  color: var(--c-text-muted);
  font-weight: 700;
}

.diff-line.diff-del {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-left: 2px solid #ef4444;
}

.diff-line.diff-add {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-left: 2px solid #10b981;
}

.diff-line.diff-info {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

/* 3-Way Merge Conflicts Viewer */
.conflict-card {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  margin-bottom: 12px;
  overflow: hidden;
}

.conflict-card-header {
  padding: 10px 14px;
  background: var(--c-surface-elevated);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--c-text);
}

.conflict-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
}

.conflict-side {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-sm);
  padding: 8px;
}

.conflict-side-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.conflict-side.ours .conflict-side-title {
  color: var(--c-accent);
}

.conflict-side.theirs .conflict-side-title {
  color: var(--c-purple);
}

.conflict-side.resolved .conflict-side-title {
  color: var(--c-success);
}

.conflict-code {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  background: #060907;
  color: #34d399;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  max-height: 140px;
  overflow-y: auto;
  border: 1px solid var(--c-border-subtle);
}

.global-drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 7, 0.92);
  backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 3px dashed var(--c-accent);
  margin: 16px;
  border-radius: var(--r-xl);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: scale(0.98);
}

.global-drop-overlay.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.global-drop-overlay .drop-icon {
  font-size: 56px;
  animation: bounce 1s infinite alternate;
}

.global-drop-overlay .drop-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-text);
}

.global-drop-overlay .drop-sub {
  font-size: 14px;
  color: var(--c-text-secondary);
}

@keyframes bounce {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-8px);
  }
}

/* ============================================================
   AI DEBUGGING TIMELINE & WORKSPACE (DARK GREEN & BLACK)
   ============================================================ */

.agent-phases-timeline {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Root Cause Facts vs Inference */
.rc-dual-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .rc-dual-panel {
    grid-template-columns: 1fr;
  }
}

.rc-section-card {
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
}

.rc-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rc-observed-facts-title {
  color: #34d399;
}

.rc-ai-inference-title {
  color: #60a5fa;
}

/* Patch Summary Bar */
.patch-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  margin-bottom: 12px;
}

.patch-metrics-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.patch-stat-add {
  color: #34d399;
  font-weight: 600;
  font-size: 12px;
}

.patch-stat-del {
  color: #f87171;
  font-weight: 600;
  font-size: 12px;
}

.patch-stat-files {
  color: var(--c-text);
  font-weight: 600;
  font-size: 12px;
}

.git-filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--c-surface-hover);
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}

.git-filter-tab {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-secondary);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.git-filter-tab.active {
  background: var(--c-surface-card);
  color: var(--c-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.git-changes-table-container {
  max-height: 480px;
  overflow-y: auto;
}

.git-change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-border-subtle);
  font-size: 12px;
  transition: background 0.1s ease;
}

.git-change-row:hover {
  background: var(--c-surface-hover);
}

.git-change-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.git-status-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.git-status-badge.M {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.git-status-badge.A {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.git-status-badge.D {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.git-status-badge.R {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.git-status-badge.U {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.git-file-name {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.git-change-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.git-diff-stats {
  font-family: var(--font-mono);
  font-size: 11px;
}

.diff-add {
  color: var(--c-success);
  font-weight: 600;
}

.diff-del {
  color: var(--c-danger);
  font-weight: 600;
}

/* Commit Plan Cards */
.commit-plan-card {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--c-surface-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.commit-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.commit-plan-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  word-break: break-word;
}

.commit-plan-reason {
  font-size: 12px;
  color: var(--c-text-secondary);
}

.commit-plan-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--c-text-muted);
}

.commit-plan-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.commit-file-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  color: var(--c-text-secondary);
}

/* 4-Way Conflict Resolver Styles */
.conflicts-4way-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 16px;
}

.conflict-pane {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.conflict-pane-header {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.conflict-pane.base .conflict-pane-header {
  background: var(--c-surface-elevated);
  color: var(--c-text-muted);
}

.conflict-pane.ours .conflict-pane-header {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.conflict-pane.theirs .conflict-pane-header {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.conflict-pane.resolved .conflict-pane-header {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.conflict-pane-body {
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  background: var(--c-surface);
  height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ============================================================
   GIT DESKTOP & CLEAN LIGHT DIFF VIEWER STYLES
   ============================================================ */

.github-diff-viewer {
  background: #080d0a !important;
  color: #f0fdf4 !important;
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
}

.diff-viewer {
  background: #080d0a;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  overflow: hidden;
}

.diff-file-row {
  display: flex;
  align-items: stretch;
  min-height: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--c-text);
  border-bottom: 1px solid rgba(24, 40, 31, 0.6);
}

.diff-file-row:hover {
  filter: brightness(1.15);
}

.diff-line-number {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  padding: 1px 8px;
  text-align: right;
  user-select: none;
  font-size: 11px;
  font-family: inherit;
  color: #526d5c;
  background: #060907;
  border-right: 1px solid var(--c-border);
  flex-shrink: 0;
  box-sizing: border-box;
}

.diff-line-content {
  padding: 1px 12px;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--c-text);
  font-family: inherit;
}

/* Additions (Emerald Green) */
.diff-line-add {
  background-color: rgba(16, 185, 129, 0.15) !important;
}

.diff-line-add .diff-line-number {
  background-color: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
  border-right: 1px solid rgba(16, 185, 129, 0.4) !important;
}

.diff-line-add .diff-line-content {
  color: #6ee7b7 !important;
  font-weight: 500;
}

/* Deletions (Crimson Red) */
.diff-line-del {
  background-color: rgba(239, 68, 68, 0.15) !important;
}

.diff-line-del .diff-line-number {
  background-color: rgba(239, 68, 68, 0.25) !important;
  color: #f87171 !important;
  border-right: 1px solid rgba(239, 68, 68, 0.4) !important;
}

.diff-line-del .diff-line-content {
  color: #fca5a5 !important;
  font-weight: 500;
}

/* Chunk Headers */
.diff-line-chunk {
  background-color: #0d1712 !important;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}

.diff-line-chunk .diff-line-number {
  background-color: #101c15 !important;
  color: #749381 !important;
  border-right: 1px solid var(--c-border) !important;
}

.diff-line-chunk .diff-line-content {
  color: #a7f3d0 !important;
  font-weight: 600;
  font-size: 11.5px;
}

/* Context lines */
.diff-line-context {
  background-color: #080d0a;
}

.diff-line-context .diff-line-content {
  color: #c2e0cf;
}

/* Changed File Rows in Git Desktop Left Panel */
.git-change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--c-border-subtle);
  transition: background 0.15s ease;
}

.git-change-row:hover {
  background: var(--c-surface-hover);
}

.git-change-row.selected {
  background: rgba(16, 185, 129, 0.14);
  border-left: 3px solid var(--c-accent);
}

.git-change-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.git-change-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.git-file-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.git-status-badge.M {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.git-status-badge.A {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.git-status-badge.D {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.git-status-badge.\? {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

/* Shortcut Pills in Folder Browser */
.folder-shortcut-pill {
  border: 1px solid var(--c-border);
  border-radius: 20px;
  background: var(--c-surface);
  color: var(--c-text);
  transition: all 0.15s ease;
}

.folder-shortcut-pill:hover {
  border-color: var(--c-accent);
  background: var(--c-surface-hover);
  color: var(--c-accent);
}

.folder-shortcut-pill.active-shortcut {
  background: var(--c-accent-light);
  border-color: var(--c-accent);
  color: var(--c-accent);
}

/* Branch Switcher Modal Items */
.branch-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--c-border-subtle);
  transition: background 0.15s ease;
}

.branch-list-item:hover {
  background: var(--c-surface-hover);
}

.branch-list-item.active-branch {
  background: var(--c-accent-light);
  border-left: 3px solid var(--c-accent);
  color: var(--c-accent);
}

/* ============================================================
   SKELETON LOADING STATES
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #0d1411 25%, #15221c 50%, #0d1411 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r-md);
  min-height: 14px;
}

.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
}


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

  100% {
    background-position: 200% 0;
  }
}

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 1050;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.scroll-top-btn:hover {
  background: var(--c-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet landscape / small desktop */
@media (max-width: 1024px) {
  .main-layout {
    padding: 24px 20px 48px;
  }

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

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* Tablet portrait */
@media (max-width: 768px) {
  .main-layout {
    padding: 20px 16px 40px;
  }

  .header {
    padding: 0 16px;
    height: 56px;
  }

  .header-nav {
    display: none;
  }

  .header-nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(13, 20, 17, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 1099;
    gap: 2px;
  }

  .header-nav.mobile-open .header-nav-item {
    padding: 10px 16px;
    border-radius: var(--r-md);
    width: 100%;
    justify-content: flex-start;
  }

  .header-mobile-toggle {
    display: flex !important;
  }

  .header-actions {
    gap: 6px;
  }

  .active-repo-badge {
    max-width: 140px;
  }

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

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .action-card {
    min-width: 100%;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .section-header>div:last-child {
    width: 100%;
  }

  .section-header>div:last-child .btn {
    width: 100%;
  }

  .modal {
    max-width: 100%;
    margin: 0 8px;
    max-height: 85vh;
    overflow-y: auto;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 20px;
  }
}

/* Mobile landscape */
@media (max-width: 640px) {
  .main-layout {
    padding: 16px 12px 32px;
  }

  .header {
    padding: 0 12px;
  }

  .header-logo span {
    display: none;
  }

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

  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    width: 100%;
  }

  .debug-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .auth-card {
    padding: 24px;
  }

  .folder-list-container {
    max-height: 300px;
  }

  .git-change-row {
    padding: 6px 10px;
  }

  .git-file-name {
    font-size: 11px;
  }

  .diff-line-number {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    font-size: 10px;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .main-layout {
    padding: 12px 8px 24px;
  }

  .card {
    padding: 16px;
    border-radius: var(--r-md);
  }

  .card-header {
    margin-bottom: 12px;
  }

  .btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .btn-lg {
    padding: 10px 18px;
    font-size: 13px;
  }

  .modal {
    border-radius: var(--r-lg);
    padding: 20px;
  }

  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-item {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .badge {
    font-size: 10px;
    padding: 1px 6px;
  }

  .empty-icon {
    font-size: 36px;
  }

  .empty-title {
    font-size: 13px;
  }

  .empty-desc {
    font-size: 11px;
    max-width: 260px;
  }
}

/* ============================================================
   ADMIN PANEL — Professional Dashboard Styles
   ============================================================ */

.admin-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(17, 22, 29, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  margin-bottom: 16px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.admin-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.admin-banner-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #10b981;
  margin-bottom: 3px;
}

.admin-banner-text h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--c-text);
}

.admin-banner-text p {
  font-size: 12px;
  color: var(--c-text-muted);
  max-width: 520px;
}

.admin-banner-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.12);
}

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-stat-card {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.admin-stat-card:hover {
  border-color: var(--c-border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.admin-stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}

.admin-stat-card.accent::after {
  background: var(--c-accent);
}

.admin-stat-card.success::after {
  background: var(--c-success);
}

.admin-stat-card.warning::after {
  background: var(--c-warning);
}

.admin-stat-card.purple::after {
  background: var(--c-purple);
}

.admin-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  margin-bottom: 8px;
}

.admin-stat-card.accent .admin-stat-icon {
  background: var(--c-accent-light);
}

.admin-stat-card.success .admin-stat-icon {
  background: var(--c-success-light);
}

.admin-stat-card.warning .admin-stat-icon {
  background: var(--c-warning-light);
}

.admin-stat-card.purple .admin-stat-icon {
  background: var(--c-purple-light);
}

.admin-stat-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.2;
}

.admin-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.admin-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 16px;
}

.admin-panel-card {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-subtle);
}

.admin-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-panel-count {
  background: var(--c-accent-light);
  color: var(--c-accent);
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
}

.admin-panel-body {
  max-height: 520px;
  overflow-y: auto;
}

.admin-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--c-border-subtle);
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.admin-user-item:hover {
  background: var(--c-surface-hover);
}

.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  object-fit: cover;
  flex-shrink: 0;
}

.admin-user-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--c-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-accent);
  flex-shrink: 0;
}

.admin-user-info {
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-email {
  font-size: 11px;
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-role-badge {
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-role-badge.admin {
  background: var(--c-warning-light);
  color: var(--c-warning-text);
  border: 1px solid var(--c-warning-border);
}

.admin-role-badge.developer {
  background: var(--c-accent-light);
  color: var(--c-accent);
  border: 1px solid var(--c-accent-border);
}

.admin-role-badge.viewer {
  background: var(--c-bg-alt);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}

.admin-user-date {
  font-size: 11px;
  color: var(--c-text-muted);
  white-space: nowrap;
}

.admin-activity-item {
  padding: 10px 20px;
  border-bottom: 1px solid var(--c-border-subtle);
  transition: background 0.15s ease;
  cursor: pointer;
}

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

.admin-activity-item:hover {
  background: var(--c-surface-hover);
}

.admin-activity-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.admin-activity-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
}

.admin-activity-time {
  font-size: 11px;
  color: var(--c-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-activity-user {
  font-size: 11px;
  color: var(--c-accent);
  font-weight: 500;
  margin-top: 2px;
}

.admin-activity-detail {
  font-size: 11px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.admin-activity-detail-pills {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-detail-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--c-text-secondary);
}

/* Admin User Detail Panel */
.admin-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-detail-panel {
  background: var(--c-surface-card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.admin-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-subtle);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-detail-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--c-border);
}

.admin-detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  object-fit: cover;
  border: 3px solid var(--c-surface-card);
  box-shadow: var(--shadow-md);
}

.admin-detail-avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: var(--c-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--c-accent);
  border: 3px solid var(--c-surface-card);
  box-shadow: var(--shadow-md);
}

.admin-detail-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
}

.admin-detail-email {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.admin-detail-meta {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 4px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-detail-sections {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-detail-section {
  background: var(--c-surface-subtle);
  border-radius: var(--r-md);
  padding: 14px;
  border: 1px solid var(--c-border-subtle);
}

.admin-detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--c-border-subtle);
  font-size: 12px;
  line-height: 1.4;
}

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

.admin-stat-row-label {
  color: var(--c-text-secondary);
}

.admin-stat-row-value {
  font-weight: 700;
  color: var(--c-text);
}

.admin-empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--c-text-muted);
}

.admin-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.admin-empty-text {
  font-size: 13px;
}

/* Admin Panel Responsive */
@media (max-width: 1024px) {
  .admin-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-main-grid {
    grid-template-columns: 1fr;
  }

  .admin-detail-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .admin-banner {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
  }

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

  .admin-stat-number {
    font-size: 22px;
  }

  .admin-detail-panel {
    max-height: 90vh;
  }

  .admin-detail-profile {
    flex-direction: column;
    text-align: center;
  }

  .admin-detail-meta {
    justify-content: center;
  }

  .admin-detail-sections {
    padding: 16px;
  }

  .admin-user-item {
    padding: 10px 16px;
  }
}

/* ============================================================
   SETTINGS — Role Badge & Security Card
   ============================================================ */

.settings-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.settings-role-badge.admin {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.settings-role-badge.developer {
  background: var(--c-bg-alt);
  color: var(--c-text-secondary);
  border: 1px solid var(--c-border);
}

.card-security {
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, var(--c-surface-card) 100%);
}

.card-security .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 10px;
  padding: 0;
}

.security-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--c-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  min-height: 52px;
  transition: all 0.15s ease;
}

.security-item:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-accent-border);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.12);
}

.security-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 0;
}

.security-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.security-heading {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-text);
}

.security-desc {
  font-size: 11px;
  color: var(--c-text-muted);
  line-height: 1.35;
}

.security-footer {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--c-surface);
  border-radius: var(--r-md);
  font-size: 11.5px;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* ============================================================
   USER / DEVELOPER PANEL — Distinct from Admin
   ============================================================ */

.user-welcome-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(22, 27, 34, 0.95) 50%, rgba(17, 22, 29, 0.98) 100%);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--r-xl);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.user-welcome-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--c-accent-light);
  border: 1px solid var(--c-accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: var(--c-accent);
}

.user-welcome-text h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 2px;
  letter-spacing: -0.2px;
}

.user-welcome-text p {
  font-size: 13px;
  color: var(--c-text-muted);
}

.user-activity-card {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.user-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-subtle);
}

.user-activity-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
}

.user-activity-body {
  max-height: 400px;
  overflow-y: auto;
}

.user-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--c-border-subtle);
}

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

.user-activity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: var(--c-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

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

.user-activity-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
}

.user-activity-meta {
  font-size: 11px;
  color: var(--c-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-activity-time {
  font-size: 11px;
  color: var(--c-text-muted);
}

/* ============================================================
   RESPONSIVE DESIGN SYSTEM & MOBILE EXPERIENCE
   Breakpoints: 1200px, 1024px, 900px, 640px, 480px
   ============================================================ */

/* Base toggle button (desktop: hidden) */
.header-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  font-size: 18px;
  cursor: pointer;
  color: var(--c-text);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.header-mobile-toggle:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-border-hover);
}

.header-mobile-toggle:active {
  transform: scale(0.96);
}

/* ------------------------------------------------------------
   LAPTOPS & TABLETS LANDSCAPE (max-width: 1200px)
   ------------------------------------------------------------ */
@media (max-width: 1200px) {
  .header {
    padding: 0 16px;
  }

  .main-layout {
    padding: 20px 16px;
  }

  .action-grid {
    gap: 14px;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ------------------------------------------------------------
   TABLETS & MEDIUM SCREENS (max-width: 1024px)
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
  .header-nav {
    gap: 1px;
    margin: 0 8px;
  }

  .header-nav-item {
    padding: 6px 10px;
    font-size: 12px;
  }

  .active-repo-badge {
    max-width: 180px;
  }

  #header-active-repo-name {
    max-width: 120px;
  }

  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-card.featured {
    grid-column: span 2;
  }

  .desktop-layout {
    flex-direction: column;
    height: auto;
  }
}

/* ============================================================
   RESPONSIVE DESIGN SYSTEM (Desktop, Laptop, Tablet, Mobile)
   Unified, Non-conflicting, Premium Obsidian Design
   ============================================================ */

/* ------------------------------------------------------------
   1. LAPTOPS & MACBOOK (max-width: 1200px)
   ------------------------------------------------------------ */
@media (max-width: 1200px) {
  .header {
    height: 54px;
    padding: 0 16px;
  }

  .header-nav-item {
    padding: 5px 9px;
    font-size: 12px;
  }

  .active-repo-badge {
    max-width: 170px;
  }

  #header-active-repo-name {
    max-width: 100px;
  }

  .main-layout {
    max-width: 1200px;
    padding: 18px 20px 50px;
  }
}

/* ------------------------------------------------------------
   2. TABLETS & IPAD (max-width: 960px)
   ------------------------------------------------------------ */
@media (max-width: 960px) {
  .header {
    height: 54px;
    padding: 0 14px;
  }

  .header-mobile-toggle {
    display: flex !important;
  }

  .header-nav {
    display: none !important;
  }

  .debug-panels-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .main-layout {
    padding: 16px 16px 40px;
  }

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

  .action-card.featured {
    grid-column: span 1;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ------------------------------------------------------------
   3. MOBILE PHONES (max-width: 768px)
   "Medium & Center, Balanced, Beautiful on iPhone, Android & Tablets"
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  /* Top Bar — Sleek, Clean, Zero Crowding */
  .header {
    height: 52px;
    padding: 0 12px;
    position: sticky;
    top: 0;
    z-index: 1100;
    background: rgba(9, 13, 16, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 0;
  }

  .header-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
  }

  .header-logo-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
  }

  .header-logo span {
    display: inline-block !important;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--c-text);
    white-space: nowrap;
    letter-spacing: -0.2px;
  }

  /* In mobile top bar, hide cluttered elements (already in drawer!) */
  .active-repo-badge,
  #github-connect-btn,
  #user-nav-btn {
    display: none !important;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  #header-status-pill {
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-full);
  }

  #header-status-pill #server-status-text {
    display: none !important;
  }

  .status-dot {
    margin: 0;
  }

  .header-mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 18px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    color: var(--c-text);
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .header-mobile-toggle:hover {
    background: var(--c-surface-hover);
    border-color: var(--c-border-hover);
  }

  /* Main Canvas Layout */
  .main-layout {
    padding: 16px 12px 64px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }

  /* Controlled Medium Centered Width for All Pages */
  #page-dashboard,
  #page-repositories,
  #page-debug,
  #page-issues,
  #page-prs,
  #page-ci,
  #page-history,
  #page-conflicts,
  #page-settings,
  #page-admin,
  #page-user-panel {
    width: 100% !important;
    max-width: 540px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  /* Centered Balanced Section Headers */
  .section-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 6px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
  }

  .section-header > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
  }

  .section-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--c-text) !important;
    text-align: center !important;
  }

  .section-subtitle {
    font-size: 12px !important;
    color: var(--c-text-muted) !important;
    text-align: center !important;
    max-width: 320px !important;
    margin: 0 auto !important;
    line-height: 1.5 !important;
  }

  /* Responsive Toolbars — Stacked & Balanced */
  .section-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    margin-bottom: 14px !important;
  }

  .section-toolbar .form-select-repo,
  .section-toolbar .form-select-filter,
  .section-toolbar select,
  .section-toolbar .search-input-wrapper,
  .section-toolbar .search-input,
  .section-toolbar .btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
  }

  .section-toolbar .btn {
    min-height: 38px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Cards & Surfaces */
  .card {
    padding: 14px 12px !important;
    border-radius: var(--r-md) !important;
    margin-bottom: 12px !important;
    box-sizing: border-box !important;
  }

  /* Stat Grids — Compact 2x2 Grid (NOT 4 stacked giant blocks!) */
  .ci-stats-grid,
  .admin-stats-grid,
  .grid-4 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
  }

  .stat-card,
  .admin-stat-card {
    padding: 12px 8px !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--r-md) !important;
  }

  .stat-value {
    font-size: 19px !important;
    font-weight: 700 !important;
    margin-bottom: 2px !important;
  }

  .stat-label {
    font-size: 10px !important;
    letter-spacing: 0.4px !important;
    text-transform: uppercase !important;
    color: var(--c-text-muted) !important;
  }

  /* Empty States — Centered Medium Proportions */
  .empty-state {
    padding: 28px 16px !important;
    text-align: center !important;
    max-width: 420px !important;
    margin: 0 auto !important;
  }

  .empty-icon-wrap {
    width: 44px !important;
    height: 44px !important;
    margin: 0 auto 10px !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.22) !important;
    border-radius: var(--r-md) !important;
  }

  .empty-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    text-align: center !important;
    margin-bottom: 6px !important;
  }

  .empty-desc {
    font-size: 12px !important;
    line-height: 1.55 !important;
    color: var(--c-text-muted) !important;
    text-align: center !important;
    max-width: 290px !important;
    margin: 0 auto 14px !important;
  }

  .empty-state div[style*="display:flex"],
  .empty-state .empty-actions {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 260px !important;
    margin: 0 auto !important;
    gap: 8px !important;
  }

  .empty-state .btn {
    width: 100% !important;
    min-height: 36px !important;
    justify-content: center !important;
    font-size: 12px !important;
  }

  /* CI Pipeline Build Cards */
  .ci-build-card {
    padding: 14px 12px !important;
    border-radius: var(--r-md) !important;
    margin-bottom: 10px !important;
  }

  .ci-build-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .ci-build-left {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .ci-title-group {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }

  .ci-build-title {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 13.5px !important;
    width: 100% !important;
  }

  .ci-repo-tag {
    display: inline-block !important;
    max-width: 170px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 10.5px !important;
    padding: 2px 7px !important;
    border-radius: var(--r-xs) !important;
    background: var(--c-surface-elevated) !important;
    border: 1px solid var(--c-border) !important;
  }

  .ci-build-commit-line {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11px !important;
    color: var(--c-text-muted) !important;
  }

  .ci-build-actions {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--c-border-subtle) !important;
  }

  .ci-run-time {
    font-size: 11px !important;
  }

  .ci-build-actions .btn {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }

  /* Debug Task Form & Quick Presets */
  #debug-form-view .grid-2 {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
  }

  #debug-form-view .card {
    padding: 16px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #debug-repo {
    min-width: 0 !important;
    flex: 1 !important;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .folder-row {
    padding: 10px 12px !important;
    gap: 8px !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .folder-row-left {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  .folder-name {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 12px !important;
  }

  .folder-row .badge {
    flex-shrink: 0 !important;
    font-size: 10px !important;
  }

  /* History Session Cards */
  .history-item-card {
    padding: 12px 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .history-card-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .history-card-body {
    font-size: 12.5px !important;
  }

  .history-card-actions {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--c-border-subtle) !important;
  }

  /* Settings Page */
  #page-settings .card {
    padding: 16px 14px !important;
    margin-bottom: 12px !important;
  }

  #page-settings .card-title {
    font-size: 15px !important;
  }

  #page-settings .text-muted,
  #page-settings p {
    word-break: break-word !important;
    white-space: normal !important;
    line-height: 1.5 !important;
    font-size: 12px !important;
  }

  #settings-user-email {
    word-break: break-all !important;
  }

  /* Admin Center */
  .admin-banner {
    padding: 16px 14px !important;
    text-align: center !important;
  }

  .admin-banner h2 {
    font-size: 16px !important;
  }

  .admin-banner p {
    font-size: 12px !important;
  }

  .admin-table-container {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Modals — Bottom Sheet on Mobile */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: var(--r-xl) var(--r-xl) 0 0 !important;
    margin: 0 !important;
    max-height: 90vh !important;
    padding: 18px 14px 32px !important;
    box-sizing: border-box !important;
  }

  .modal-actions {
    flex-direction: column-reverse !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .modal-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 40px !important;
  }
}

/* ------------------------------------------------------------
   4. EXTRA SMALL PHONES (max-width: 420px) — iPhone SE, Galaxy Mini
   ------------------------------------------------------------ */
@media (max-width: 420px) {
  .main-layout {
    padding: 12px 8px 64px !important;
  }

  .header {
    padding: 0 8px !important;
  }

  .card {
    padding: 12px 10px !important;
  }

  .stat-card,
  .admin-stat-card {
    padding: 10px 6px !important;
  }

  .stat-value {
    font-size: 17px !important;
  }

  .section-title {
    font-size: 17px !important;
  }
}

/* ============================================================
   LANDSCAPE PHONE (short height)
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .header {
    height: 46px;
  }

  .main-layout {
    padding: 8px 12px 24px;
  }

  .git-left-panel {
    max-height: 30vh;
  }

  .modal {
    max-height: 85vh !important;
    overflow-y: auto;
  }

  .auth-card {
    min-height: auto;
    padding: 20px 24px;
  }
}

/* ============================================================
   CI RUNS VIEW & BUILD INTELLIGENCE STYLES
   ============================================================ */
.ci-runs-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ci-build-card {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.18s ease;
}

.ci-build-card:hover {
  border-color: var(--c-accent-border);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

.ci-build-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.ci-build-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ci-build-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--c-text);
}

.ci-build-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--c-text-muted);
}

.ci-steps-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--c-border-subtle);
  padding-top: 10px;
}

.ci-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-sm);
  font-size: 12px;
}

.ci-step-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ci-step-logs {
  background: #060907;
  color: #34d399;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-top: 8px;
}

/* macOS / WebKit custom scrollbar styling */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--c-bg);
}

::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 9999px;
  border: 1px solid transparent;
}

::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

/* ============================================================
   CI / CD RUNS & BUILD PIPELINES (GITHUB ACTIONS STYLE)
   ============================================================ */

.ci-build-card {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ci-build-card:hover {
  border-color: var(--c-border-hover);
  box-shadow: var(--shadow-sm);
}

.ci-build-card.is-failed {
  border-left: 3px solid var(--c-danger);
}

.ci-build-card.is-running {
  border-left: 3px solid var(--c-warning);
}

.ci-build-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ci-build-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.ci-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ci-build-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--c-text);
}

.ci-repo-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  background: var(--c-surface-elevated);
  border: 1px solid var(--c-border);
  color: var(--c-text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.ci-build-commit-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--c-text-muted);
  flex-wrap: wrap;
}

.ci-commit-sha {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--c-surface-subtle);
  border: 1px solid var(--c-border-subtle);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  color: var(--c-text-secondary);
}

.ci-meta-text {
  font-size: 11px;
}

.ci-build-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ci-run-time {
  font-size: 12px;
  color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
}

.ci-steps-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-surface-subtle);
  padding: 6px;
}

.ci-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: var(--r-xs);
  font-size: 12px;
  color: var(--c-text);
  background: transparent;
  transition: background 0.1s;
}

.ci-step-row:hover {
  background: var(--c-surface-hover);
}

.ci-step-row.step-failed {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.ci-step-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.step-icon {
  font-weight: 700;
  width: 14px;
  text-align: center;
}

.step-icon.text-success {
  color: var(--c-success-text);
}

.step-icon.text-danger {
  color: var(--c-danger-text);
}

.ci-step-logs {
  background: #0d1117;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: #c9d1d9;
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Critic Agent Review & Verification Card
   ============================================================ */

.critic-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.critic-score-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-top: 4px;
}

.critic-score-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.critic-summary-box {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
  padding: 14px 16px;
  border-radius: var(--r-sm);
}

.critic-finding-item {
  background: var(--c-surface-hover);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ============================================================
   GITHUB ACTIONS WORKFLOW RUNS & PIPELINE INTERFACE
   ============================================================ */

.gh-actions-card {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.gh-actions-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  background: rgba(13, 17, 23, 0.6);
  flex-wrap: wrap;
  gap: 12px;
}

.gh-actions-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gh-actions-main-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-actions-subtitle {
  font-size: 12px;
  color: var(--c-text-muted);
}

.gh-search-filter-box {
  display: flex;
  align-items: center;
  background: var(--c-surface-input);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  gap: 6px;
  width: 240px;
  max-width: 100%;
}

.gh-search-filter-box input {
  background: transparent;
  border: none;
  color: var(--c-text);
  font-size: 12px;
  width: 100%;
  outline: none;
}

.gh-search-filter-box input::placeholder {
  color: var(--c-text-muted);
}

.gh-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(22, 27, 34, 0.7);
  border-bottom: 1px solid var(--c-border);
  font-size: 12px;
  color: var(--c-text-secondary);
  flex-wrap: wrap;
  gap: 10px;
}

.gh-runs-count {
  font-weight: 600;
  color: var(--c-text);
}

.gh-filter-dropdowns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gh-filter-select {
  background: transparent;
  border: 1px solid transparent;
  color: var(--c-text-muted);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: all 0.15s;
}

.gh-filter-select:hover,
.gh-filter-select:focus {
  background: var(--c-surface-hover);
  border-color: var(--c-border);
  color: var(--c-text);
  outline: none;
}

.gh-filter-select option {
  background: #161b22;
  color: var(--c-text);
}

/* Workflow Row */
.gh-run-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  transition: background 0.12s ease;
  position: relative;
  gap: 14px;
}

.gh-run-row:last-child {
  border-bottom: none;
}

.gh-run-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.gh-run-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.gh-status-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.gh-status-circle.is-success {
  background: #238636;
  color: #ffffff;
  box-shadow: 0 0 6px rgba(35, 134, 54, 0.4);
}

.gh-status-circle.is-failed {
  background: #da3633;
  color: #ffffff;
  box-shadow: 0 0 6px rgba(218, 54, 51, 0.4);
}

.gh-status-circle.is-running {
  background: transparent;
  border: 2px solid #d29922;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

.gh-run-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.gh-run-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.35;
  cursor: pointer;
  word-break: break-word;
  transition: color 0.12s;
}

.gh-run-title:hover {
  color: var(--c-accent);
}

.gh-run-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--c-text-muted);
  flex-wrap: wrap;
}

.gh-branch-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--c-border);
  color: var(--c-text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.gh-commit-sha {
  font-family: var(--font-mono);
  color: var(--c-text-secondary);
}

.gh-actor-name {
  color: var(--c-text);
  font-weight: 500;
}

.gh-run-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.gh-run-timing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11.5px;
  color: var(--c-text-muted);
  white-space: nowrap;
}

.gh-time-ago {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gh-duration {
  display: flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  color: var(--c-text-secondary);
}

.gh-kebab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--c-text-muted);
  border-radius: var(--r-xs);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s;
}

.gh-kebab-btn:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-border);
  color: var(--c-text);
}

/* Expanded Workflow Graph (Matching Screenshot 3) */
.gh-expanded-panel {
  background: #090d13;
  border-top: 1px solid var(--c-border);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gh-graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--c-text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

.gh-graph-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gh-graph-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: auto;
  padding: 10px 4px;
}

.gh-graph-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
}

.gh-graph-node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--c-text);
  white-space: nowrap;
  transition: all 0.15s;
}

.gh-graph-node.node-passed {
  border-color: rgba(35, 134, 54, 0.4);
}

.gh-graph-node.node-failed {
  border-color: rgba(218, 54, 51, 0.6);
  background: rgba(218, 54, 51, 0.1);
}

.gh-graph-node.node-skipped {
  opacity: 0.6;
}

.gh-node-status {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
}

.gh-node-status.is-pass {
  background: #238636;
  color: #ffffff;
}

.gh-node-status.is-fail {
  background: #da3633;
  color: #ffffff;
}

.gh-node-status.is-skip {
  background: rgba(255, 255, 255, 0.15);
  color: var(--c-text-muted);
}

.gh-node-dur {
  font-size: 11px;
  color: var(--c-text-muted);
  margin-left: 4px;
}

.gh-graph-connector {
  width: 24px;
  height: 2px;
  background: var(--c-border);
  position: relative;
}

.gh-graph-connector::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -3px;
  width: 0;
  height: 0;
  border-left: 5px solid var(--c-border);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

/* Failure AI Triage Banner */
.gh-failure-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(218, 54, 51, 0.1);
  border: 1px solid rgba(218, 54, 51, 0.3);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.gh-failure-desc {
  font-size: 12.5px;
  color: #f85149;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dedicated No-CI Pipeline State (Screenshot 1 fix) */
.no-ci-card {
  background: var(--c-surface-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.no-ci-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
  color: var(--c-accent);
}

.no-ci-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--c-border);
  color: var(--c-text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

.no-ci-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 8px;
}

.no-ci-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--c-text-muted);
  max-width: 580px;
  margin-bottom: 22px;
}

.no-ci-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}

.no-ci-preview-box {
  width: 100%;
  max-width: 640px;
  background: #090d13;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: #c9d1d9;
  position: relative;
}

.no-ci-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}


