:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --fg: #1a1a1a;
  --card: #ffffff;
  --border: #d9d9df;
  --accent: #2563eb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --fg: #e8e8ea;
    --card: #1f2023;
    --border: #34353a;
  }
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.user-menu { position: relative; }
#user-menu-button {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
#user-menu-button .caret { font-size: 0.7em; opacity: 0.7; }
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  min-width: 170px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}
.dropdown[hidden] { display: none; }
.dropdown button {
  background: transparent;
  color: var(--fg);
  border: none;
  border-radius: 0;
  text-align: left;
  padding: 0.65rem 1rem;
}
.dropdown button:hover { background: var(--bg); opacity: 1; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.modal-header h2 { margin: 0; font-size: 1.1rem; }
.modal-close {
  background: transparent;
  color: var(--fg);
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
}
.modal-close:hover { opacity: 0.7; }
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.login-box {
  max-width: 320px;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
form { display: flex; flex-direction: column; gap: 0.75rem; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
input, textarea, button {
  font: inherit;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}
button {
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  padding: 0.6rem;
}
button:hover { opacity: 0.9; }
.delete-vm { background: #dc2626; padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.error { color: #dc2626; min-height: 1.2em; }
#job-log {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}
ul { list-style: none; padding: 0; margin: 0; }
li { padding: 0.25rem 0; border-bottom: 1px solid var(--border); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
