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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
}

/* Auth Screen */
.auth-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-container h1 {
  font-size: 2rem;
  margin-bottom: 30px;
  text-align: center;
  color: #58a6ff;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  width: 100%;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: #161b22;
  border: 1px solid #30363d;
  color: #8b949e;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #1f6feb;
  color: white;
  border-color: #1f6feb;
}

.auth-form {
  display: none;
  width: 100%;
}

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

.auth-form h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #c9d1d9;
}

.info-text {
  color: #8b949e;
  font-size: 14px;
  margin-bottom: 10px;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #c9d1d9;
  font-size: 14px;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: #58a6ff;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #238636;
  color: white;
}

.btn-primary:hover {
  background: #2ea043;
}

.btn-secondary {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
}

.btn-secondary:hover {
  background: #30363d;
}

.btn-danger {
  background: #da3633;
  color: white;
}

.btn-danger:hover {
  background: #f85149;
}

.btn-success {
  background: #238636;
  color: white;
}

.btn-success:hover {
  background: #2ea043;
}

.btn-warning {
  background: #9e6a03;
  color: white;
}

.btn-warning:hover {
  background: #bb8009;
}

.error-msg {
  color: #f85149;
  font-size: 14px;
  min-height: 20px;
}

/* Dashboard */
.navbar {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar h1 {
  font-size: 1.5rem;
  color: #58a6ff;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

#username-display {
  color: #8b949e;
  font-size: 14px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

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

.header-section h2 {
  font-size: 1.8rem;
  color: #c9d1d9;
}

.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.server-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.2s;
}

.server-card:hover {
  border-color: #58a6ff;
}

.server-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
}

.server-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #c9d1d9;
  margin: 0;
}

.server-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #c9d1d9;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-running {
  background: #238636;
  color: white;
}

.status-stopped {
  background: #6e7681;
  color: white;
}

.server-info {
  margin-bottom: 20px;
}

.server-info p {
  color: #8b949e;
  font-size: 14px;
  margin-bottom: 8px;
}

.server-info strong {
  color: #c9d1d9;
  margin-right: 5px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
  font-size: 14px;
}

.info-label {
  color: #8b949e;
}

.info-value {
  color: #c9d1d9;
  font-family: 'Courier New', monospace;
}

.server-actions {
  display: flex;
  gap: 10px;
}

.server-actions .btn {
  flex: 1;
  font-size: 13px;
  padding: 10px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #30363d;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.3rem;
  color: #c9d1d9;
}

.close-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #c9d1d9;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-body label {
  color: #8b949e;
  font-size: 14px;
  font-weight: 600;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #30363d;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #8b949e;
  font-size: 16px;
  grid-column: 1 / -1;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #c9d1d9;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .servers-grid {
    grid-template-columns: 1fr;
  }
  
  .header-section {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
  
  .navbar {
    flex-direction: column;
    gap: 15px;
  }
  
  .nav-right {
    width: 100%;
    justify-content: space-between;
  }
}

/* Agent banner */
.agent-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 8px;
  background: #2a2a3e;
  border: 1px solid #ff4444;
  margin-bottom: 20px;
  font-size: 14px;
  color: #ccc;
}
.agent-banner.connected {
  border-color: #44ff88;
  color: #44ff88;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
.token-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #111;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 8px;
  word-break: break-all;
}
.token-box code {
  flex: 1;
  font-size: 12px;
  color: #7fff7f;
  font-family: monospace;
}

/* Setup steps */
.setup-steps { display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  min-width: 28px; height: 28px;
  background: #5865f2; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 13px; color: #fff;
}
