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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 0;
}

.container {
  width: 100%;
  padding: 2rem;
}

.container-narrow {
  max-width: 480px;
}

.container-wide {
  max-width: 1100px;
}

#login-screen {
  align-self: center;
  margin-top: -2rem; /* visual centering with body padding */
}

h1 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: #f5a623;
}

h2 {
  font-size: 1.2rem;
  color: #f5a623;
  margin: 0;
}

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

.header-row h1 {
  margin-bottom: 0;
}

.btn-logout {
  background: none;
  border: 1px solid #5a6478;
  color: #8892a4;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-logout:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* --- Two-panel layout --- */
.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.service-panel {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 1.5rem;
}

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

/* --- Login --- */

.login-card {
  background: #16213e;
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid #0f3460;
}

.login-field {
  margin-bottom: 1rem;
}

.login-field label {
  display: block;
  font-size: 0.85rem;
  color: #8892a4;
  margin-bottom: 0.3rem;
}

.login-field input {
  width: 100%;
  padding: 0.6rem;
  background: #1a1a2e;
  color: #e0e0e0;
  border: 1px solid #0f3460;
  border-radius: 6px;
  font-size: 1rem;
}

.login-card .btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* --- Status card --- */

.status-card {
  background: #1a1a2e;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid #0f3460;
}

.status-card:empty,
.status-card:has(> .status-row[style*="display: none"]:only-child) {
  display: none;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
}

.status-row + .status-row {
  border-top: 1px solid #0f3460;
}

.label {
  color: #8892a4;
  font-size: 0.9rem;
}

.badge {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-stopped {
  background: #3d1f1f;
  color: #e74c3c;
}

.badge-running {
  background: #1f3d2a;
  color: #2ecc71;
}

.badge-starting,
.badge-provisioning,
.badge-stopping,
.badge-already_running,
.badge-already_stopped {
  background: #3d3a1f;
  color: #f5a623;
  animation: pulse 1.5s infinite;
}

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

.address {
  font-family: "SF Mono", "Fira Code", monospace;
  color: #2ecc71;
  font-weight: 600;
  user-select: all;
}

.mono {
  font-family: "SF Mono", "Fira Code", monospace;
  color: #8892a4;
  font-size: 0.85rem;
  user-select: all;
}

.info-box {
  background: #1f3d2a;
  border: 1px solid #2ecc71;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  text-align: center;
  color: #a8d8b8;
}

.info-box strong {
  color: #2ecc71;
  user-select: all;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5a6478;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* --- Pickers --- */

.save-picker,
.resource-picker,
.version-picker {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.save-picker label,
.resource-picker label,
.version-picker label {
  display: none;
}

.save-picker select,
.resource-picker select,
.version-picker select,
.version-picker input {
  flex: 1;
  padding: 0.5rem;
  background: #1a1a2e;
  color: #e0e0e0;
  border: 1px solid #0f3460;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* --- Mods --- */

.mods-list {
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.mod-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
}

.mod-item:hover {
  background: #1a2744;
}

.mod-item input[type="checkbox"] {
  accent-color: #2ecc71;
  cursor: pointer;
}

.mod-name {
  flex: 1;
  font-size: 0.85rem;
  color: #e0e0e0;
}

.mod-size {
  font-size: 0.75rem;
  color: #5a6478;
}

.mod-delete {
  background: none;
  border: none;
  color: #5a6478;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.mod-delete:hover {
  color: #e74c3c;
  background: #3d1f1f;
}

.mods-empty {
  text-align: center;
  color: #5a6478;
  font-size: 0.85rem;
  padding: 0.5rem;
}

/* --- Uploads --- */

.upload-area {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.upload-area input[type="file"] {
  flex: 1;
  font-size: 0.8rem;
  color: #8892a4;
}

.upload-area input[type="file"]::file-selector-button {
  padding: 0.4rem 0.8rem;
  background: #1a1a2e;
  color: #e0e0e0;
  border: 1px solid #0f3460;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
}

/* --- Buttons --- */

.actions {
  display: flex;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.btn {
  flex: 1;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-start {
  background: #2ecc71;
  color: #1a1a2e;
}

.btn-start:hover:not(:disabled) {
  background: #27ae60;
}

.btn-stop {
  background: #e74c3c;
  color: #fff;
}

.btn-stop:hover:not(:disabled) {
  background: #c0392b;
}

.btn-small {
  flex: 0;
  padding: 0.45rem 0.7rem;
  font-size: 0.75rem;
  background: #1a1a2e;
  color: #8892a4;
  border: 1px solid #0f3460;
}

.btn-small:hover:not(:disabled) {
  background: #1a2744;
  color: #e0e0e0;
}

/* --- TS admin token reveal --- */

.ts-token-help {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.ts-token-help em {
  color: #8892a4;
  font-style: italic;
}

.token-display {
  font-family: "SF Mono", "Fira Code", monospace;
  background: #1a1a2e;
  border: 1px solid #2ecc71;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  margin: 0.5rem 0;
  word-break: break-all;
  font-size: 0.8rem;
  color: #2ecc71;
  user-select: all;
}

/* --- Messages --- */

.message {
  text-align: center;
  min-height: 1.2rem;
  font-size: 0.85rem;
  color: #8892a4;
  margin-top: 0.5rem;
}

.message.error {
  color: #e74c3c;
}

.message.success {
  color: #2ecc71;
}

.info {
  text-align: center;
  font-size: 0.8rem;
  color: #5a6478;
  margin-top: 1rem;
}

.info p + p {
  margin-top: 0.25rem;
}

.subtle {
  font-size: 0.78rem;
  color: #5a6478;
}
