/* ==========================================================================
   DeployHub Modern Dark Design System & Aesthetics
   ========================================================================== */

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #10141f;
  --bg-surface: rgba(22, 28, 45, 0.65);
  --bg-surface-hover: rgba(30, 38, 60, 0.85);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --glass-bg: rgba(16, 20, 31, 0.75);
  --glass-border: 1px solid rgba(255, 255, 255, 0.07);
  --glass-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Background ambient glows */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: var(--glass-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  z-index: 100;
}

.brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: var(--glass-border);
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.nav-menu {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-align: left;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  transition: var(--transition);
}

.nav-item:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.nav-item:hover svg {
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  font-weight: 600;
}

.nav-item.active svg {
  color: var(--accent-primary);
}

.nav-item .badge {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.nav-item.active .badge {
  background-color: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
}

.sidebar-footer {
  padding: 18px 20px;
  border-top: var(--glass-border);
}

.system-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

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

.status-info {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.status-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.status-version {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  margin-top: 3px;
  letter-spacing: 0.03em;
  opacity: 0.85;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  flex-grow: 1;
  padding: 24px 32px;
  overflow-y: auto;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 400px;
  max-width: 100%;
  background-color: var(--bg-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-full);
  padding: 0 12px 0 38px;
  cursor: pointer;
  transition: var(--transition);
}

.header-search:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background-color: rgba(30, 41, 59, 0.7);
}

.header-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.header-search input {
  width: 100%;
  flex: 1;
  padding: 9px 8px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.header-search .cmd-shortcut {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-family: monospace;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-muted);
  user-select: none;
  margin-left: 8px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: var(--glass-border);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Glass Panels */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 24px;
}

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

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tab Management */
.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}

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

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

/* ==========================================================================
   Metrics Grid
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  display: flex;
  flex-direction: column;
}

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

.metric-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.icon-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.metric-icon svg {
  width: 20px;
  height: 20px;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 4px;
}

.metric-footer {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.activity-card {
  padding: 20px;
}

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

.panel-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ==========================================================================
   Data Table
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  padding: 12px 16px;
  color: var(--text-dim);
  font-weight: 600;
  border-bottom: var(--glass-border);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-failed { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-running { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); border: 1px solid rgba(99, 102, 241, 0.3); animation: pulse-glow 1.5s infinite; }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); }

/* Stages Progression Pill */
.stage-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stage-pill {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stage-pill.active {
  background: var(--accent-primary);
  color: #fff;
  font-weight: 600;
}

.stage-pill.passed {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
}

.stage-pill.failed {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
}

/* ==========================================================================
   Repositories Grid & Details
   ========================================================================== */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.repo-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.repo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.repo-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.repo-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.repo-card-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.repo-card-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.repo-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-top: var(--glass-border);
  padding-top: 14px;
  margin-top: 14px;
}

/* Repo Detail View */
.repo-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.repo-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clone-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px 4px 12px;
  border-radius: var(--radius-md);
  border: var(--glass-border);
}

.clone-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
}

.clone-box input {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  width: 320px;
  outline: none;
}

.clone-proto-btn {
  padding: 2px 8px !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  border-radius: 4px !important;
}

.clone-proto-btn.active {
  background: var(--accent-primary) !important;
  color: #fff !important;
}

/* Sub-tabs */
.sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: var(--glass-border);
  padding-bottom: 8px;
}

.sub-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.sub-tab:hover {
  color: var(--text-main);
}

.sub-tab.active {
  background: var(--bg-surface);
  color: var(--accent-primary);
  font-weight: 600;
}

.sub-tab-content {
  display: none;
}

.sub-tab-content.active {
  display: block;
}

/* File Explorer */
.file-explorer {
  padding: 0;
  overflow: hidden;
}

.explorer-header {
  padding: 12px 20px;
  border-bottom: var(--glass-border);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  font-size: 0.875rem;
  transition: var(--transition);
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.file-item svg {
  width: 16px;
  height: 16px;
  color: var(--accent-primary);
}

.file-viewer {
  margin-top: 16px;
  padding: 0;
  overflow: hidden;
}

.viewer-header {
  padding: 12px 20px;
  border-bottom: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.file-viewer pre {
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* ==========================================================================
   Runner Cards Grid
   ========================================================================== */
.runners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.runner-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

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

.runner-id {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.runner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.runner-tag {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.runner-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: var(--glass-border);
  padding-top: 12px;
}

/* ==========================================================================
   Live Terminal Modal
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: 90%;
  max-width: 540px;
  z-index: 1001;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-lg {
  max-width: 900px;
}

.modal-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: var(--glass-border);
  padding-right: 40px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}

.modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fff;
  border-color: rgba(244, 63, 94, 0.4);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.terminal-modal {
  padding: 0;
  overflow: hidden;
  background-color: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 90%;
  max-width: 1100px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-modal.fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  inset: 0 !important;
  position: fixed !important;
  z-index: 10001 !important;
}

.terminal-header {
  background: #161b22;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

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

.dot-red { background: #ff5f56; cursor: pointer; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; cursor: pointer; }

.terminal-modal .modal-close-btn {
  top: 9px;
  right: 14px;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.terminal-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 38px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  cursor: pointer;
}

.terminal-body {
  height: 520px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e6edf3;
  background-color: #0b0f19;
}

.terminal-modal.fullscreen .terminal-body {
  height: calc(100vh - 54px) !important;
  max-height: calc(100vh - 54px) !important;
}

.terminal-line {
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-line.stderr {
  color: #f87171;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

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

.form-group input:not([type="checkbox"]):not([type="radio"]), 
.form-group textarea,
.form-group select,
select.form-control,
.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

/* Custom Checkbox Group Items */
.scope-checkbox-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}

.scope-checkbox-item:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
}

.scope-checkbox-item input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  margin: 2px 0 0 0 !important;
  flex-shrink: 0;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.scope-checkbox-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scope-checkbox-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
}

.scope-checkbox-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-group select,
select.form-control {
  padding-right: 36px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23818cf8' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

.form-group select option,
select.form-control option {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 10px;
  font-size: 0.875rem;
}

.form-group select optgroup,
select.form-control optgroup {
  background-color: #090d16;
  color: #818cf8;
  font-weight: 700;
  padding: 8px 10px;
}

.form-group input:focus, 
.form-group textarea:focus,
.form-group select:focus,
select.form-control:focus,
.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background-color: rgba(15, 23, 42, 0.95);
}

.code-editor {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Empty Repository Onboarding Guide
   ========================================================================== */
.empty-repo-guide {
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

.guide-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.guide-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.guide-banner-text h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.guide-banner-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.guide-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guide-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  transition: var(--transition);
  width: 100%;
}

.guide-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

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

.guide-card-header h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-code-box {
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  overflow-x: auto;
}

.guide-code-box pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #38bdf8;
}

.btn-copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.72rem;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-copy-code:hover {
  background: var(--accent-primary);
  color: #fff;
}

/* ==========================================================================
   Markdown & README Renderer
   ========================================================================== */
.repo-readme-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
}

.readme-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.readme-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.readme-body {
  padding: 24px 30px;
}

/* Markdown Typography & Blocks */
.markdown-body {
  color: #cbd5e1;
  font-size: 0.94rem;
  line-height: 1.7;
  word-break: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: #fff;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 12px;
  line-height: 1.35;
}

.markdown-body h1 {
  font-size: 1.65rem;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 10px;
}

.markdown-body h2 {
  font-size: 1.35rem;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.markdown-body h3 { font-size: 1.15rem; }
.markdown-body h4 { font-size: 1.02rem; }
.markdown-body h5 { font-size: 0.92rem; }
.markdown-body h6 { font-size: 0.85rem; color: var(--text-muted); }

.markdown-body p {
  margin-top: 0;
  margin-bottom: 16px;
}

.markdown-body a {
  color: #38bdf8;
  text-decoration: none;
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  transition: var(--transition);
}

.markdown-body a:hover {
  color: #7dd3fc;
  border-bottom-color: #38bdf8;
}

.markdown-body strong {
  color: #fff;
  font-weight: 700;
}

.markdown-body em {
  color: #cbd5e1;
  font-style: italic;
}

.markdown-body del {
  color: var(--text-dim);
}

.markdown-body hr {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  margin: 24px 0;
}

/* Inline Code */
.markdown-body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: rgba(255, 255, 255, 0.08);
  color: #f43f5e;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Fenced Code Block */
.md-code-block {
  position: relative;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.md-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.md-code-lang {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.md-code-block pre {
  margin: 0;
  padding: 14px 18px;
  overflow-x: auto;
  font-family: 'Fira Code', var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  color: #e2e8f0;
}

/* Syntax Highlighting Colors */
.hl-comment { color: #64748b; font-style: italic; }
.hl-string { color: #34d399; }
.hl-keyword { color: #c084fc; font-weight: 600; }
.hl-cmd { color: #38bdf8; font-weight: 600; }
.hl-flag { color: #fbbf24; }
.hl-number { color: #f472b6; }
.hl-var { color: #93c5fd; }
.hl-punct { color: #94a3b8; }

/* Blockquotes */
.markdown-body blockquote {
  margin: 16px 0;
  padding: 10px 18px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.02);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 8px 8px 0;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Alert Callouts (Note, Tip, Warning, etc.) */
.md-alert {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 8px;
  border-left: 4px solid;
  background: rgba(0, 0, 0, 0.3);
}

.md-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.md-alert-note {
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}
.md-alert-note .md-alert-header { color: #38bdf8; }

.md-alert-tip {
  border-left-color: #34d399;
  background: rgba(52, 211, 153, 0.08);
}
.md-alert-tip .md-alert-header { color: #34d399; }

.md-alert-important {
  border-left-color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
}
.md-alert-important .md-alert-header { color: #a855f7; }

.md-alert-warning {
  border-left-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}
.md-alert-warning .md-alert-header { color: #fbbf24; }

.md-alert-caution {
  border-left-color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
}
.md-alert-caution .md-alert-header { color: #f43f5e; }

/* Lists & Tasks */
.markdown-body ul,
.markdown-body ol {
  padding-left: 24px;
  margin-top: 0;
  margin-bottom: 16px;
}

.markdown-body li {
  margin-bottom: 4px;
}

.markdown-body li.task-list-item {
  list-style: none;
  margin-left: -20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.markdown-body li.task-list-item input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 15px;
  height: 15px;
}

/* Tables */
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.markdown-body th {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.markdown-body td {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.86rem;
}

.markdown-body tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.markdown-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* VS Code Markdown Preview View */
.vscode-preview-canvas {
  background: #090d16;
  color: #cbd5e1;
  font-family: var(--font-sans);
}

/* ==========================================================================
   Login Screen & Authentication
   ========================================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090d16;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.12), transparent 40%);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.login-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  margin-bottom: 20px;
}

.login-alert.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

.login-alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon > svg:first-child {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
  z-index: 2;
}

.input-with-icon input {
  padding-left: 40px !important;
  padding-right: 42px !important;
  width: 100%;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 42px !important;
  width: 100%;
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 4px;
  line-height: 0;
  transition: var(--transition);
}

.btn-toggle-pwd:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.btn-toggle-pwd svg {
  position: static !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: 16px !important;
  height: 16px !important;
  color: inherit !important;
  pointer-events: none;
}

.btn-login {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 10px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.login-footer code {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* User Profile Menu (Top Header) */
.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 6px 4px 10px;
  border-radius: var(--radius-full);
  margin-left: 8px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #a855f7);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.user-role {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.btn-icon-logout {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-logout:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.btn-icon-logout svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   Members & Access Management Styles
   ========================================================================== */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.member-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: var(--glass-border);
  transition: var(--transition);
  position: relative;
}

.member-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.member-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.member-card-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #a855f7);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.member-card-info {
  flex-grow: 1;
  overflow: hidden;
}

.member-card-info h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-card-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-card-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

.role-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.role-badge.admin {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
}

.role-badge.developer, .role-badge.maintainer {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

.role-badge.viewer {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-select option {
  background: #0f172a;
  color: #fff;
}

/* ==========================================================================
   Pipeline Stop & Restart Controls + Log Error Highlights
   ========================================================================== */
.btn-terminal-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}

.btn-danger-ghost {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.btn-danger-ghost:hover {
  background: rgba(244, 63, 94, 0.3);
  border-color: #f43f5e;
  color: #fff;
}

.btn-restart-ghost {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.btn-restart-ghost:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: #818cf8;
  color: #fff;
}

.terminal-line.error-highlight {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.12);
  border-left: 3px solid #f43f5e;
  padding-left: 6px;
  margin: 2px 0;
  font-weight: 600;
}

.terminal-line.success-highlight {
  color: #86efac;
  background: rgba(34, 197, 94, 0.1);
  border-left: 3px solid #22c55e;
  padding-left: 6px;
  margin: 2px 0;
  font-weight: 600;
}

.terminal-line.system-highlight {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.08);
  border-left: 3px solid #06b6d4;
  padding-left: 6px;
  margin: 4px 0;
  font-weight: 600;
}

/* ==========================================================================
   Merge Requests Styles & Diff Viewer
   ========================================================================== */
.mr-state-filters {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.mr-state-filters .filter-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.mr-state-filters .filter-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.mr-state-filters .filter-btn.active {
  color: #fff;
  background: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.badge-mr-open {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  font-weight: 700;
}

.badge-mr-merged {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
  font-weight: 700;
}

.badge-mr-closed {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  font-weight: 700;
}

.mr-iid-badge {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.mr-title-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.mr-modal-header {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.mr-modal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mr-modal-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
}

.mr-flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.branch-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.flow-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.mr-action-widget {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mr-widget-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mr-widget-info svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.mr-widget-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mr-desc-card {
  padding: 18px 22px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 24px;
}

.mr-discussion-section {
  margin-top: 20px;
}

.mr-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.mr-comment-item {
  display: flex;
  gap: 12px;
}

.mr-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
}

.mr-comment-bubble {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.mr-comment-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mr-comment-body {
  font-size: 0.88rem;
  color: #f1f5f9;
  white-space: pre-wrap;
  word-break: break-word;
}

.mr-new-comment-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px;
}

.mr-new-comment-box textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.9rem;
  resize: vertical;
}

/* Diff Viewer Styles */
.diff-summary-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.diff-files-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diff-file-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.diff-file-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: #f1f5f9;
}

.diff-file-body {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-x: auto;
  padding: 8px 0;
}

.diff-line {
  display: flex;
  padding: 1px 16px;
  white-space: pre;
}

.diff-line-added {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.diff-line-deleted {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
}

.diff-line-chunk {
  background: rgba(99, 102, 241, 0.1);
  color: #93c5fd;
  font-weight: 600;
}

.modal-xl {
  width: 92%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
}

/* ==========================================================================
   User Account Profile Page Styles
   ========================================================================== */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.profile-card {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-indigo) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

/* ==========================================================================
   VS Code Studio Editor Modal
   ========================================================================== */
.vscode-modal {
  width: 90%;
  max-width: 1100px;
  height: 82vh;
  background: #14161f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  padding: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.vscode-modal.fullscreen,
.web-editor-modal.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 10000;
  margin: 0 !important;
}

/* VS Code Titlebar */
.vscode-titlebar {
  background: #0d0e15;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  user-select: none;
}

.vscode-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.vscode-dots .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 0.15s;
}

.vscode-dots .dot:hover {
  opacity: 0.8;
}

.vscode-dots .dot-red { background: #ff5f56; }
.vscode-dots .dot-yellow { background: #ffbd2e; }
.vscode-dots .dot-green { background: #27c93f; }

.vscode-title-path {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.vscode-logo-icon {
  width: 16px;
  height: 16px;
  color: #3b82f6;
}

.crumb-separator {
  color: var(--text-dim);
  opacity: 0.5;
}

.crumb-active {
  color: #e2e8f0;
  font-weight: 500;
}

.vscode-window-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vscode-action-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.76rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.vscode-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.vscode-action-btn svg {
  width: 13px;
  height: 13px;
}

.vscode-btn-close {
  font-size: 0.9rem;
  padding: 3px 8px;
  color: var(--text-dim);
}

.vscode-btn-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* VS Code Tab Bar */
.vscode-tabbar {
  background: #11131c;
  display: flex;
  align-items: flex-end;
  padding: 0 8px;
  height: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
}

.vscode-tab {
  background: #181a26;
  border-top: 2px solid #6366f1;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #fff;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  cursor: pointer;
}

.vscode-file-icon {
  font-size: 0.9rem;
}

.vscode-tab-close {
  margin-left: 6px;
  color: var(--text-dim);
  font-size: 0.72rem;
  padding: 2px;
  border-radius: 3px;
}

.vscode-tab-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* VS Code Editor Body */
.vscode-editor-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: #0f1118;
  position: relative;
}

.vscode-gutter {
  width: 52px;
  padding: 14px 10px 14px 6px;
  background: #0b0d13;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: #555b70;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: right;
  user-select: none;
  overflow-y: hidden;
  box-sizing: border-box;
}

.vscode-gutter-line {
  display: block;
}

.vscode-code-canvas {
  flex: 1;
  overflow: auto;
  padding: 14px 18px;
  box-sizing: border-box;
}

.vscode-code-canvas pre {
  margin: 0;
  padding: 0;
  background: transparent;
}

.vscode-code-canvas code.vscode-code {
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #d1d5db;
  white-space: pre;
  tab-size: 2;
  display: block;
}

/* VS Code Status Bar */
.vscode-statusbar {
  background: #4338ca;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.9);
  user-select: none;
}

.vscode-status-left,
.vscode-status-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vscode-statusbar .status-item {
  display: inline-flex;
  align-items: center;
}

.status-badge-lang {
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ==========================================================================
   User-Friendly Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100vw - 48px);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(22, 25, 37, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-size: 0.88rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.25s ease;
}

.toast.toast-hide {
  animation: toastSlideOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(60px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(60px) scale(0.95);
  }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 18px;
  height: 18px;
}

.toast-success {
  border-left: 4px solid #10b981;
}
.toast-success .toast-icon { color: #10b981; }

.toast-error {
  border-left: 4px solid #f43f5e;
}
.toast-error .toast-icon { color: #f43f5e; }

.toast-warning {
  border-left: 4px solid #f59e0b;
}
.toast-warning .toast-icon { color: #f59e0b; }

.toast-info {
  border-left: 4px solid #6366f1;
}
.toast-info .toast-icon { color: #818cf8; }

.toast-content {
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  width: 100%;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ==========================================================================
   Interactive Confirm Modal Dialog
   ========================================================================== */
.confirm-modal-card {
  max-width: 440px;
  text-align: center;
  padding: 32px 28px 28px !important;
  border-radius: 16px !important;
  background: rgba(20, 24, 36, 0.96) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

.confirm-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.confirm-icon-wrapper.info {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.confirm-icon {
  width: 26px;
  height: 26px;
}

.confirm-icon.icon-danger {
  color: #f43f5e;
}

.confirm-icon.icon-info {
  color: #818cf8;
}

.confirm-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-modal-actions .btn {
  flex: 1;
  padding: 10px 18px;
  font-size: 0.9rem;
  justify-content: center;
}

/* ==========================================================================
   Groups & Folder Namespaces
   ========================================================================== */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.group-card {
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.group-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.group-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  opacity: 0.8;
}

.group-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.group-folder-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.group-card-info {
  flex: 1;
  min-width: 0;
}

.group-card-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.group-card-path {
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-family: monospace;
}

.group-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.group-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: var(--glass-border);
  padding-top: 14px;
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.group-badge-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  font-weight: 600;
  font-size: 0.78rem;
}

.group-folder-banner {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-folder-banner h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-repo-accordion {
  margin-bottom: 24px;
}

.group-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.group-accordion-header:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(99, 102, 241, 0.3);
}

.group-accordion-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

/* ==========================================================================
   Windows Explorer Directory Table System
   ========================================================================== */
.dir-explorer-panel {
  background: var(--bg-surface);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  margin-bottom: 24px;
}

.dir-explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 12px;
}

.dir-breadcrumbs-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.dir-nav-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
  flex-shrink: 0;
}

.dir-nav-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}

.dir-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dir-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 0.86rem;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.25);
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dir-breadcrumbs::-webkit-scrollbar {
  display: none;
}

.dir-crumb-item {
  color: var(--accent-cyan);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.dir-crumb-item:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #fff;
}

.dir-crumb-item.active {
  color: #fff;
  font-weight: 600;
  cursor: default;
}

.dir-crumb-sep {
  color: var(--text-dim);
  font-size: 0.75rem;
  user-select: none;
}

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

.dir-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dir-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 680px;
}

.dir-table th {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 18px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dir-table td {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.86rem;
  vertical-align: middle;
}

.dir-row {
  transition: background 0.15s ease;
}

.dir-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.dir-row-folder {
  cursor: pointer;
}

.dir-row-parent {
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.dir-row-parent:hover {
  background: rgba(99, 102, 241, 0.12);
}

.dir-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dir-item-name {
  font-weight: 600;
  color: #fff;
  transition: color 0.15s ease;
}

.dir-row-folder:hover .dir-item-name {
  color: var(--accent-cyan);
}

.action-menu-popup {
  display: none;
  min-width: 180px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 6px;
  z-index: 99999;
}

.action-menu-popup.show {
  display: block;
  animation: fadeIn 0.12s ease;
}

.action-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-main);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.action-menu-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}

.action-menu-item.danger {
  color: #fb7185;
}

.action-menu-item.danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
}

.action-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

/* ==========================================================================
   Responsive & Mobile Design System
   ========================================================================== */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 10px;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent-primary);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

body.sidebar-locked {
  overflow: hidden !important;
}

/* --- Tablet & Medium Screens (< 992px) --- */
@media (max-width: 992px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.6);
  }

  .sidebar.mobile-active {
    transform: translateX(0);
  }

  .main-content {
    padding: 18px 20px;
    max-width: 100%;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

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

/* --- Mobile Screens (< 768px) --- */
@media (max-width: 768px) {
  .main-content {
    padding: 14px 12px;
  }

  /* Top Header Adaptive */
  .top-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .mobile-menu-btn {
    display: inline-flex;
    margin-right: 0;
  }

  .header-search {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
  }

  .header-actions {
    margin-left: auto;
  }

  .user-info-text {
    display: none;
  }

  .user-profile-menu {
    padding: 4px 8px;
    gap: 6px;
  }

  /* Section Header on Mobile - Full Stacking */
  .section-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    margin-bottom: 18px !important;
  }

  .section-header-info {
    width: 100%;
  }

  .section-header h2 {
    font-size: 1.3rem;
  }

  .section-header-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .section-header-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 9px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  /* Group Header Banner on Mobile */
  .group-header-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }

  .group-header-info {
    width: 100%;
  }

  .group-header-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .group-header-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* Repo Filter Bar on Mobile */
  .repo-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .repo-filter-bar > div {
    width: 100% !important;
  }

  #repo-group-pills {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  #repo-group-pills .sub-tab {
    text-align: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.78rem;
    width: 100%;
    border-radius: 6px;
  }

  #repo-search-input {
    width: 100% !important;
  }

  /* Metrics Grid */
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Repo Grid */
  .repo-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Repo Card */
  .repo-card {
    padding: 16px 14px;
  }

  /* Subtabs Bar Horizontal Scrollable */
  .sub-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

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

  .sub-tab {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  /* Repo Detail Header */
  .repo-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .repo-detail-header > div:last-child {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .clone-box {
    width: 100%;
    max-width: 100%;
  }

  .clone-box input {
    width: 100%;
    min-width: 0;
  }

  /* File Tree Explorer Table Scroll */
  .file-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .file-table-header,
  .file-item-row {
    min-width: 520px;
  }

  /* Group Headers */
  .group-repo-accordion {
    padding: 16px 14px !important;
  }

  /* Modals */
  .modal-card {
    width: 95vw !important;
    max-width: 96% !important;
    margin: 8px auto !important;
    padding: 18px 14px !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
  }

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

  .modal-actions button {
    width: 100%;
  }
}

/* ==========================================================================
   Command Palette (Ctrl + K / Cmd + K)
   ========================================================================== */
.command-palette-card {
  width: 620px;
  max-width: 90vw;
  background: rgba(15, 23, 42, 0.94) !important;
  backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.15) !important;
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cmd-palette-search-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.cmd-palette-search-wrapper svg {
  width: 20px;
  height: 20px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.cmd-palette-input {
  width: 100%;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #fff;
  font-size: 1.05rem;
  font-family: inherit;
  padding: 0 !important;
}

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

.cmd-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 8px 12px 4px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  color: var(--text-muted);
}

.cmd-item:hover,
.cmd-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cmd-item-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.cmd-item-title {
  font-size: 0.9rem;
  font-weight: 500;
}

.cmd-item-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-left: 6px;
}

.cmd-shortcut {
  font-size: 0.72rem;
  font-family: monospace;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--text-muted);
}

.cmd-palette-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.cmd-footer-keys {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cmd-footer-keys kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.72rem;
  color: #cbd5e1;
}

/* ==========================================================================
   Clone Dropdown Popover
   ========================================================================== */
.clone-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 430px;
  max-width: 92vw;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(99, 102, 241, 0.12);
  padding: 16px;
  z-index: 1000;
  animation: fadeInDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.clone-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.clone-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px;
  border-radius: 6px;
}

.clone-tabs .sub-tab {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 4px;
}

.clone-url-field {
  display: flex;
  gap: 6px;
}

.clone-url-field input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 7px 10px;
  outline: none;
}

/* ==========================================================================
   Visual Commit & MR Diff Viewer
   ========================================================================== */
.diff-file-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

.diff-file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: monospace;
  font-size: 0.85rem;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}

.diff-row-added {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7;
}

.diff-row-added td:first-child,
.diff-row-added td:nth-child(2) {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #34d399;
}

.diff-row-deleted {
  background: rgba(244, 63, 94, 0.15) !important;
  color: #fda4af;
}

.diff-row-deleted td:first-child,
.diff-row-deleted td:nth-child(2) {
  background: rgba(244, 63, 94, 0.22) !important;
  color: #fb7185;
}

.diff-row-hunk {
  background: rgba(99, 102, 241, 0.1) !important;
  color: #a5b4fc;
  font-style: italic;
}

.diff-line-num {
  width: 45px;
  text-align: right;
  padding: 2px 8px;
  color: var(--text-dim);
  user-select: none;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.diff-line-code {
  padding: 2px 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

  /* Toast Notifications */
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: calc(100vw - 20px);
  }

  .toast {
    width: 100%;
    font-size: 0.84rem;
    padding: 12px 14px;
  }

  /* Tables Scroll */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -10px;
    padding: 0 10px;
  }

  .data-table {
    min-width: 560px;
  }
}

/* --- Ultra Small Phone Screens (< 480px) --- */
@media (max-width: 480px) {
  .brand-text h2 {
    font-size: 1rem;
  }

  .metric-value {
    font-size: 1.6rem;
  }

  .login-card {
    padding: 24px 16px;
    margin: 10px;
  }
}
