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

:root {
  --bg-primary: #1a1b26;
  --bg-secondary: #24283b;
  --bg-tertiary: #414868;
  --text-primary: #c0caf5;
  --text-secondary: #a9b1d6;
  --text-muted: #565f89;
  --accent: #7aa2f7;
  --accent-hover: #89b4fa;
  --success: #9ece6a;
  --warning: #e0af68;
  --error: #f7768e;
  --border: #414868;
  --sidebar-width: 280px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* Container Layout */
.container {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

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

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.search-box {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.search-box input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

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

/* Repo List */
.repo-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.repo-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.repo-item:hover {
  background: var(--bg-tertiary);
}

.repo-item.active {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent);
}

.repo-name {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.repo-name .private-badge {
  font-size: 10px;
  background: var(--warning);
  color: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 3px;
}

.repo-description {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.repo-actions .btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

.loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Tab Bar */
.tab-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  min-height: 40px;
}

.tabs {
  display: flex;
  overflow-x: auto;
  flex: 1;
}

.tab {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-right: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s;
}

.tab:hover {
  background: var(--bg-tertiary);
}

.tab.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
}

.tab-close {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.15s, background 0.15s;
}

.tab-close:hover {
  opacity: 1;
  background: var(--error);
  color: white;
}

/* Terminal Container */
.terminal-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.terminal-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  padding: 8px;
}

.terminal-wrapper.active {
  display: block;
}

.terminal-wrapper .xterm {
  height: 100%;
}

/* Welcome Screen */
.welcome-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
}

.welcome-content {
  text-align: center;
  max-width: 400px;
}

.welcome-content h2 {
  margin-bottom: 16px;
  color: var(--accent);
}

.welcome-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.quick-actions {
  text-align: left;
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 8px;
}

.quick-actions h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.quick-actions ul {
  list-style: none;
}

.quick-actions li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  font-size: 13px;
  color: var(--text-secondary);
}

.quick-actions li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

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

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

.btn-primary:hover {
  background: var(--accent-hover);
}

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

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: var(--success);
  color: var(--bg-primary);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

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

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 12px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

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

.modal-header h3 {
  font-size: 16px;
}

.modal-close {
  font-size: 24px;
  line-height: 1;
}

/* Forms */
.form-group {
  padding: 0 20px;
  margin: 16px 0;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-actions {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.error-message {
  color: var(--error);
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
  padding: 0 20px;
}

/* Deploy Output */
.deploy-output {
  background: var(--bg-primary);
  padding: 16px;
  margin: 16px 20px;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  width: 100%;
  max-width: 360px;
  padding: 20px;
}

.login-box {
  background: var(--bg-secondary);
  padding: 40px;
  border-radius: 12px;
  text-align: center;
}

.login-box h1 {
  color: var(--accent);
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-box .form-group {
  padding: 0;
  margin-bottom: 16px;
}

.login-box .error-message {
  padding: 0;
}

/* Status Indicators */
.status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-active {
  background: var(--success);
}

.status-loading {
  background: var(--warning);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
