@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;700&display=swap');

/* ═══════════════════════════════════════════
   ROOT VARIABLES
═══════════════════════════════════════════ */
:root {
  --bg-primary:      #0a0a0f;
  --bg-secondary:    #12121a;
  --bg-tertiary:     #1a1a2e;
  --bg-elevated:     #16213e;
  --border:          #1e293b;
  --border-accent:   #334155;
  --text-primary:    #e2e8f0;
  --text-secondary:  #94a3b8;
  --text-muted:      #64748b;
  --accent-cyan:     #22d3ee;
  --accent-purple:   #a78bfa;
  --accent-green:    #34d399;
  --accent-yellow:   #fbbf24;
  --accent-red:      #f87171;
  --accent-orange:   #fb923c;
  --glow-cyan:       0 0 20px rgba(34,211,238,0.15);
  --glow-purple:     0 0 20px rgba(167,139,250,0.15);
  --glow-green:      0 0 20px rgba(52,211,153,0.15);
  --font-mono:       'JetBrains Mono', 'Fira Code', monospace;
  --font-sans:       'Inter', system-ui, sans-serif;
  --sidebar-width:   240px;
  --nav-height:      56px;
  --terminal-height: 300px;
  --radius:          8px;
  --radius-sm:       4px;
  --radius-lg:       12px;
  --transition:      150ms ease;
  --transition-slow: 300ms ease;
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; height: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
}

a { color: var(--accent-cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: #67e8f9; }

button { cursor: pointer; font-family: var(--font-sans); }

input, textarea, select {
  font-family: var(--font-sans);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(34,211,238,0.2);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
.app-layout {
  display: grid;
  grid-template-rows: var(--nav-height) 1fr;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-areas:
    "nav nav"
    "sidebar main";
  height: 100vh;
  overflow: hidden;
}

/* ═══════════════════════════════════════════
   TOP NAV
═══════════════════════════════════════════ */
.top-nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  position: relative;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-cyan);
  letter-spacing: -0.02em;
  text-shadow: 0 0 20px rgba(34,211,238,0.5);
  flex-shrink: 0;
}

.nav-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

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

.nav-project {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.nav-project-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.branch-selector {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-purple);
  cursor: pointer;
  transition: border-color var(--transition);
}

.branch-selector:hover { border-color: var(--accent-purple); }
.branch-selector .branch-icon { font-size: 0.9em; opacity: 0.7; }

.notification-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}

.notification-btn:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-red);
  color: white;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  display: none;
}

.notification-badge.visible { display: flex; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition);
  position: relative;
}

.user-menu:hover { border-color: var(--border-accent); }

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--bg-primary);
}

.user-name { font-size: 0.85rem; font-weight: 500; }
.user-role-badge {
  font-size: 0.65rem;
  background: rgba(34,211,238,0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(34,211,238,0.2);
  border-radius: 999px;
  padding: 0 0.4rem;
  font-family: var(--font-mono);
}

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-section {
  padding: 0.5rem 0;
}

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem 0.25rem;
}

.sidebar-nav { list-style: none; }

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.sidebar-nav li a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
  border-left-color: var(--border-accent);
}

.sidebar-nav li a.active {
  color: var(--accent-cyan);
  background: rgba(34,211,238,0.05);
  border-left-color: var(--accent-cyan);
}

.sidebar-nav li a .nav-icon { width: 16px; text-align: center; font-size: 0.9em; opacity: 0.8; }
.sidebar-nav li a.active .nav-icon { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════════ */
.main-area {
  grid-area: main;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  padding-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════
   PAGE HEADERS
═══════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* ═══════════════════════════════════════════
   CARDS
═══════════════════════════════════════════ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-accent);
}

.card-glow:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.card-featured {
  border-color: rgba(34,211,238,0.3);
  background: linear-gradient(135deg, rgba(34,211,238,0.03), var(--bg-secondary));
  box-shadow: var(--glow-cyan);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════
   STAT GRID
═══════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: all var(--transition);
}

.stat-card:hover { border-color: var(--border-accent); }

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
}

.stat-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }

.stat-cyan { color: var(--accent-cyan); }
.stat-purple { color: var(--accent-purple); }
.stat-green { color: var(--accent-green); }
.stat-yellow { color: var(--accent-yellow); }

/* ═══════════════════════════════════════════
   VERSION CARDS
═══════════════════════════════════════════ */
.version-list { display: flex; flex-direction: column; gap: 0.5rem; }

.version-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  transition: all var(--transition);
  animation: slideUp 0.3s ease backwards;
}

.version-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-1px);
}

.version-hash {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.15);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
}

.version-hash:hover { background: rgba(34,211,238,0.15); }

.version-body { min-width: 0; }

.version-message {
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.version-author {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.author-avatar-sm {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--bg-primary);
  flex-shrink: 0;
}

.version-stats {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.stat-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.stat-badge.files { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.stat-badge.ins { background: rgba(52,211,153,0.12); color: var(--accent-green); }
.stat-badge.del { background: rgba(248,113,113,0.12); color: var(--accent-red); }

.version-actions { display: flex; gap: 0.4rem; align-items: center; }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

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

.btn-primary {
  background: var(--accent-cyan);
  color: var(--bg-primary);
  border-color: var(--accent-cyan);
}

.btn-primary:hover {
  background: #67e8f9;
  border-color: #67e8f9;
  box-shadow: 0 0 20px rgba(34,211,238,0.3);
}

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

.btn-secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-purple {
  background: rgba(167,139,250,0.15);
  color: var(--accent-purple);
  border-color: rgba(167,139,250,0.3);
}

.btn-purple:hover {
  background: rgba(167,139,250,0.25);
  box-shadow: var(--glow-purple);
}

.btn-danger {
  background: rgba(248,113,113,0.1);
  color: var(--accent-red);
  border-color: rgba(248,113,113,0.3);
}

.btn-danger:hover {
  background: rgba(248,113,113,0.2);
  border-color: var(--accent-red);
}

.btn-success {
  background: rgba(52,211,153,0.1);
  color: var(--accent-green);
  border-color: rgba(52,211,153,0.3);
}

.btn-success:hover {
  background: rgba(52,211,153,0.2);
  border-color: var(--accent-green);
}

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.btn-lg { padding: 0.65rem 1.5rem; font-size: 0.95rem; }
.btn-icon { padding: 0.45rem; }
.btn-icon.btn-sm { padding: 0.3rem; }

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

.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-color: var(--bg-primary) transparent transparent transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ═══════════════════════════════════════════
   STATUS BADGES
═══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-running {
  background: rgba(52,211,153,0.12);
  color: var(--accent-green);
  border: 1px solid rgba(52,211,153,0.25);
}

.badge-stopped {
  background: rgba(100,116,139,0.12);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-error {
  background: rgba(248,113,113,0.12);
  color: var(--accent-red);
  border: 1px solid rgba(248,113,113,0.25);
}

.badge-starting {
  background: rgba(251,191,36,0.12);
  color: var(--accent-yellow);
  border: 1px solid rgba(251,191,36,0.25);
}

.badge-branch {
  background: rgba(167,139,250,0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(167,139,250,0.2);
  font-family: var(--font-mono);
}

.badge-admin {
  background: rgba(34,211,238,0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(34,211,238,0.2);
}

/* Pulse dot */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-running {
  background: var(--accent-green);
  animation: pulse-green 2s ease infinite;
}

.dot-stopped { background: var(--text-muted); }
.dot-error { background: var(--accent-red); animation: pulse-red 1.5s ease infinite; }
.dot-starting { background: var(--accent-yellow); animation: pulse-yellow 1s ease infinite; }

/* ═══════════════════════════════════════════
   TERMINAL PANEL
═══════════════════════════════════════════ */
.terminal-panel {
  background: #0d1117;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: var(--terminal-height);
  min-height: 40px;
  max-height: 70vh;
  position: relative;
  transition: height var(--transition-slow);
  flex-shrink: 0;
}

.terminal-panel.minimized { height: 40px !important; }

.terminal-panel.maximized {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100% !important;
  max-height: 100%;
  z-index: 50;
}

.terminal-resize-handle {
  height: 6px;
  cursor: ns-resize;
  background: transparent;
  border-top: 1px solid var(--border);
  transition: background var(--transition);
  flex-shrink: 0;
}

.terminal-resize-handle:hover { background: rgba(34,211,238,0.2); }

.terminal-tab-bar {
  display: flex;
  align-items: center;
  background: #0d1117;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  height: 34px;
  padding: 0 0.5rem;
  gap: 0.25rem;
  flex-shrink: 0;
  overflow-x: auto;
}

.terminal-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.6rem;
  height: 26px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.terminal-tab:hover { background: rgba(255,255,255,0.05); color: var(--text-secondary); }

.terminal-tab.active {
  background: rgba(34,211,238,0.08);
  border-color: rgba(34,211,238,0.2);
  color: var(--accent-cyan);
}

.terminal-tab .tab-close {
  opacity: 0;
  font-size: 0.65em;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 2px;
}

.terminal-tab:hover .tab-close,
.terminal-tab.active .tab-close { opacity: 1; }

.terminal-tab .tab-close:hover { background: rgba(248,113,113,0.2); color: var(--accent-red); }

.terminal-tab-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.terminal-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.terminal-tab-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-secondary); }

.terminal-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  flex-shrink: 0;
}

.terminal-status-dot.disconnected { background: var(--accent-red); }

.terminal-shortcut-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-right: 0.5rem;
}

.terminal-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#terminal { width: 100%; height: 100%; }

.terminal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,17,23,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
  display: none;
}

.terminal-overlay.visible { display: flex; }
.terminal-overlay-text { color: var(--text-secondary); font-family: var(--font-mono); font-size: 0.85rem; }

/* ═══════════════════════════════════════════
   MODALS
═══════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition-slow);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title { font-size: 1.05rem; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

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

.modal-body { margin-bottom: 1.25rem; }

.modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: var(--radius);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }

.form-error { font-size: 0.75rem; color: var(--accent-red); margin-top: 0.3rem; }

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 1rem);
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  max-width: 340px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  pointer-events: all;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideInRight 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.dismissing { opacity: 0; transform: translateX(120%); }

.toast-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 0.85rem; font-weight: 600; }
.toast-msg { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.15rem; }

.toast-info { border-left: 3px solid var(--accent-cyan); }
.toast-success { border-left: 3px solid var(--accent-green); }
.toast-warning { border-left: 3px solid var(--accent-yellow); }
.toast-error { border-left: 3px solid var(--accent-red); }

/* ═══════════════════════════════════════════
   DIFF VIEWER
═══════════════════════════════════════════ */
.diff-container { font-family: var(--font-mono); font-size: 0.78rem; }

.diff-file {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.diff-file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.diff-file-header:hover { background: var(--bg-elevated); }
.diff-file-name { color: var(--accent-cyan); font-size: 0.8rem; }
.diff-file-stats { display: flex; gap: 0.5rem; }

.diff-body { overflow-x: auto; }
.diff-body.collapsed { display: none; }

.diff-line { display: flex; min-width: 0; }

.diff-line-num {
  width: 48px;
  text-align: right;
  padding: 0 0.5rem;
  color: var(--text-muted);
  user-select: none;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
}

.diff-line-content {
  flex: 1;
  padding: 0 0.75rem;
  white-space: pre;
  overflow-x: visible;
}

.diff-add { background: rgba(52,211,153,0.08); }
.diff-add .diff-line-num { background: rgba(52,211,153,0.05); color: var(--accent-green); }
.diff-add .diff-line-content { color: #86efac; }
.diff-add .diff-line-content::before { content: '+'; color: var(--accent-green); margin-right: 4px; }

.diff-del { background: rgba(248,113,113,0.08); }
.diff-del .diff-line-num { background: rgba(248,113,113,0.05); color: var(--accent-red); }
.diff-del .diff-line-content { color: #fca5a5; }
.diff-del .diff-line-content::before { content: '-'; color: var(--accent-red); margin-right: 4px; }

.diff-hunk { background: rgba(34,211,238,0.05); }
.diff-hunk .diff-line-content { color: var(--text-muted); }

/* ═══════════════════════════════════════════
   FILE BROWSER
═══════════════════════════════════════════ */
.file-browser { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; height: 100%; }

.file-tree {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 0.5rem 0;
}

.file-tree-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  transition: all var(--transition);
  border-left: 2px solid transparent;
}

.file-tree-item:hover { background: rgba(255,255,255,0.03); color: var(--text-primary); }
.file-tree-item.active { color: var(--accent-cyan); background: rgba(34,211,238,0.05); border-left-color: var(--accent-cyan); }

.file-tree-item .file-icon { width: 14px; text-align: center; opacity: 0.6; flex-shrink: 0; }
.file-tree-item.dir { color: var(--accent-purple); }
.file-tree-item.dir:hover { color: #c4b5fd; }

.file-viewer {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.file-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.file-path {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

.file-content {
  flex: 1;
  overflow: auto;
  padding: 0.75rem;
}

pre code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   ACTIVITY LOG
═══════════════════════════════════════════ */
.activity-timeline { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(30,41,59,0.5);
  animation: fadeIn 0.3s ease;
}

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

.activity-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.activity-line {
  flex: 1;
  width: 1px;
  background: var(--border);
  margin: 4px 0;
}

.activity-content {}
.activity-meta { font-size: 0.78rem; color: var(--text-secondary); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.2rem; }
.activity-user { font-weight: 600; color: var(--text-primary); }
.activity-action { font-size: 0.82rem; color: var(--text-primary); }
.activity-time { font-size: 0.73rem; color: var(--text-muted); font-family: var(--font-mono); margin-left: auto; }
.activity-details { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); margin-top: 0.15rem; }

/* ═══════════════════════════════════════════
   CONTAINER CARDS
═══════════════════════════════════════════ */
.container-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.container-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
  animation: slideUp 0.3s ease backwards;
}

.container-card:hover { border-color: var(--border-accent); }
.container-card.running { border-color: rgba(52,211,153,0.2); }
.container-card.running:hover { border-color: var(--accent-green); box-shadow: var(--glow-green); }

.container-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.container-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.container-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

.container-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.container-stat {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
}

.container-stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }
.container-stat-value { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; margin-top: 0.1rem; }

.container-actions { display: flex; gap: 0.4rem; margin-top: 0.75rem; flex-wrap: wrap; }

/* ═══════════════════════════════════════════
   UPLOAD ZONE
═══════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-slow);
  background: var(--bg-secondary);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(34,211,238,0.03);
  box-shadow: var(--glow-cyan);
}

.upload-icon { font-size: 3rem; margin-bottom: 1rem; color: var(--text-muted); }
.upload-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.upload-sub { font-size: 0.85rem; color: var(--text-secondary); }
.upload-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ═══════════════════════════════════════════
   QUICK COMMIT FAB
═══════════════════════════════════════════ */
.quick-commit-fab {
  position: fixed;
  bottom: calc(var(--terminal-height) + 1rem);
  right: 1.5rem;
  z-index: 200;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-lg);
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(34,211,238,0.3);
  transition: all var(--transition);
}

.quick-commit-fab:hover {
  background: #67e8f9;
  box-shadow: 0 6px 28px rgba(34,211,238,0.4);
  transform: translateY(-1px);
}

.fab-hint {
  font-size: 0.68rem;
  opacity: 0.7;
  font-family: var(--font-mono);
  font-weight: 400;
}

/* ═══════════════════════════════════════════
   NOTIFICATION DROPDOWN
═══════════════════════════════════════════ */
.notification-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  z-index: 500;
  overflow: hidden;
  display: none;
}

.notification-dropdown.open { display: block; animation: slideDown 0.2s ease; }

.notif-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.notif-list { max-height: 300px; overflow-y: auto; }

.notif-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(30,41,59,0.5);
  font-size: 0.8rem;
  transition: background var(--transition);
}

.notif-item:hover { background: rgba(255,255,255,0.02); }
.notif-item:last-child { border-bottom: none; }
.notif-item-title { font-weight: 500; color: var(--text-primary); }
.notif-item-time { color: var(--text-muted); font-size: 0.72rem; font-family: var(--font-mono); }

/* ═══════════════════════════════════════════
   USER MENU DROPDOWN
═══════════════════════════════════════════ */
.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 500;
  overflow: hidden;
  display: none;
}

.user-dropdown.open { display: block; animation: slideDown 0.15s ease; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.dropdown-item.danger:hover { color: var(--accent-red); background: rgba(248,113,113,0.05); }

/* ═══════════════════════════════════════════
   SEARCH INPUT
═══════════════════════════════════════════ */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.6rem;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.85rem;
}

.search-input {
  padding-left: 2rem;
  height: 34px;
  font-size: 0.85rem;
  width: 220px;
}

/* ═══════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════ */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ═══════════════════════════════════════════
   TABLES
═══════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

thead tr { border-bottom: 1px solid var(--border); }

th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(30,41,59,0.4);
  vertical-align: middle;
}

tr:hover td { background: rgba(255,255,255,0.01); }
tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════
   SKELETON LOADING
═══════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════
   SETTINGS PAGE
═══════════════════════════════════════════ */
.settings-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.settings-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.danger-zone { border-color: rgba(248,113,113,0.2); }
.danger-zone .settings-section-title { color: var(--accent-red); }

/* ═══════════════════════════════════════════
   BREADCRUMBS
═══════════════════════════════════════════ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.breadcrumbs a { color: var(--accent-cyan); }
.breadcrumbs .sep { color: var(--border-accent); }

/* ═══════════════════════════════════════════
   EMPTY STATES
═══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; }
.empty-sub { font-size: 0.85rem; }

/* ═══════════════════════════════════════════
   TABS
═══════════════════════════════════════════ */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  gap: 0;
}

.tab-btn {
  padding: 0.6rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}

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

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

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

/* ═══════════════════════════════════════════
   LOGS VIEWER
═══════════════════════════════════════════ */
.logs-viewer {
  background: #0d1117;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  height: 300px;
  overflow-y: auto;
  padding: 0.75rem;
  color: #8b949e;
  line-height: 1.7;
}

.log-line { white-space: pre-wrap; word-break: break-all; }
.log-timestamp { color: var(--text-muted); margin-right: 0.5rem; }
.log-error { color: var(--accent-red); }
.log-warn { color: var(--accent-yellow); }

/* ═══════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1rem 0;
}

.page-btn {
  padding: 0.3rem 0.7rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.page-btn.active { background: var(--accent-cyan); color: var(--bg-primary); border-color: var(--accent-cyan); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(52,211,153,0); }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(248,113,113,0); }
}

@keyframes pulse-yellow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(251,191,36,0); }
}

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

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* Staggered card entrance */
.version-card:nth-child(1)  { animation-delay: 0ms; }
.version-card:nth-child(2)  { animation-delay: 40ms; }
.version-card:nth-child(3)  { animation-delay: 80ms; }
.version-card:nth-child(4)  { animation-delay: 120ms; }
.version-card:nth-child(5)  { animation-delay: 160ms; }
.version-card:nth-child(6)  { animation-delay: 200ms; }
.version-card:nth-child(7)  { animation-delay: 240ms; }
.version-card:nth-child(8)  { animation-delay: 280ms; }
.version-card:nth-child(9)  { animation-delay: 320ms; }
.version-card:nth-child(10) { animation-delay: 360ms; }

/* ═══════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34,211,238,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.login-bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,0.04) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-scanline {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,0.15), transparent);
  animation: scanline 4s linear infinite;
  pointer-events: none;
}

.login-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5), var(--glow-cyan);
  animation: slideUp 0.4s ease;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 30px rgba(34,211,238,0.3);
}

.login-title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
  overflow: hidden;
  white-space: nowrap;
}

.login-title.typing {
  border-right: 2px solid var(--accent-cyan);
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  0%, 100% { border-color: var(--accent-cyan); }
  50% { border-color: transparent; }
}

.login-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-family: var(--font-mono);
}

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.login-input-wrap {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.login-input {
  width: 100%;
  padding: 0.65rem 0.75rem 0.65rem 2.25rem;
  font-size: 0.9rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  transition: all var(--transition);
}

.login-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.1), 0 0 20px rgba(34,211,238,0.05);
  outline: none;
}

.login-btn {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--accent-cyan), #0891b2);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(34,211,238,0.2);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.login-btn:hover {
  box-shadow: 0 6px 28px rgba(34,211,238,0.35);
  transform: translateY(-1px);
}

.login-btn:active { transform: scale(0.98); }

.login-error {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  color: var(--accent-red);
  font-family: var(--font-mono);
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-width: 200px; }
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "nav"
      "main";
  }

  .sidebar {
    position: fixed;
    left: -240px;
    top: var(--nav-height);
    bottom: 0;
    width: 240px;
    z-index: 300;
    transition: left var(--transition-slow);
  }

  .sidebar.open { left: 0; }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 299;
    display: none;
  }

  .sidebar-overlay.open { display: block; }

  .hamburger { display: flex; }

  .file-browser { grid-template-columns: 1fr; }

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

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

  .main-content { padding: 1rem; }
}

/* ═══════════════════════════════════════════
   UTILS
═══════════════════════════════════════════ */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-purple { color: var(--accent-purple); }
.text-yellow { color: var(--accent-yellow); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ═══════════════════════════════════════════
   AI ANALYSIS
═══════════════════════════════════════════ */
.ai-summary-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-primary);
}
.ai-bullet {
  padding: 0.25rem 0 0.25rem 0.25rem;
  border-left: 2px solid var(--accent-purple);
  margin: 0.35rem 0;
  padding-left: 0.75rem;
}
.ai-line {
  color: var(--text-secondary);
  margin: 0.25rem 0;
}
.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.version-ai-snippet {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 600px;
}

/* ═══════════════════════════════════════════
   DOCS — DOCUMENT LIBRARY & DIAGRAMS
═══════════════════════════════════════════ */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.doc-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.15s;
}
.doc-card:hover { border-color: var(--border-accent); }
.doc-type-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  width: fit-content;
}
.doc-type-pdf  { background: rgba(255,80,80,0.15);  color: #ff6b6b; border: 1px solid rgba(255,80,80,0.3); }
.doc-type-docx { background: rgba(0,100,255,0.12);  color: #64b5f6; border: 1px solid rgba(0,100,255,0.25); }
.doc-title { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); flex: 1; }
.doc-desc  { font-size: 0.78rem; color: var(--text-muted); }
.doc-meta  { display: flex; gap: 0.35rem; align-items: center; }
.doc-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.25rem; }

/* Diagram card */
.diagram-card .diagram-preview {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 0.4rem;
  transition: border-color 0.15s;
}
.diagram-card .diagram-preview:hover { border-color: var(--accent-purple); }
.diagram-preview-icon { font-size: 2rem; }
.diagram-preview-counts { display: flex; gap: 0.4rem; }

/* Upload zone drag-over */
.upload-zone.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.04);
}
