:root {
  color-scheme: light dark;
  --fg: #1a1a1a;
  --bg: #f7f7f8;
  --card: #ffffff;
  --border: #d9d9df;
  --accent: #2563eb;
  --danger: #dc2626;
  --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
}

.login {
  max-width: 22rem;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.login h1 {
  font-size: 1.25rem;
  margin-top: 0;
}

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

.login label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
}

input, button {
  font: inherit;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
}

button {
  cursor: pointer;
  background: var(--accent);
  color: white;
  border: none;
}

button.stop {
  background: var(--danger);
}

.error {
  color: var(--danger);
  font-size: 0.875rem;
}

.dashboard {
  max-width: 60rem;
  margin: 2rem auto;
  padding: 0 1rem;
}

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

table.containers {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
}

table.containers th, table.containers td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

table.containers tr:last-child td {
  border-bottom: none;
}

.status-running { color: #16a34a; }
.status-other { color: var(--muted); }

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  cursor: pointer;
  list-style: none;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
}

.nav-menu summary::-webkit-details-marker { display: none; }

.nav-menu-items {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 12rem;
  padding: 0.6rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.nav-menu-items a {
  color: inherit;
  text-decoration: none;
  padding: 0.3rem 0.2rem;
}

.nav-menu-items a:hover {
  text-decoration: underline;
}

.nav-menu-items form {
  margin: 0;
}

.nav-menu-items button {
  width: 100%;
}

.users, .account-password, .container-logs {
  max-width: 60rem;
  margin: 2rem auto;
  padding: 0 1rem;
}

.create-user {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.create-user label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.create-user label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

table.users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
}

table.users-table th, table.users-table td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

table.users-table tr:last-child td {
  border-bottom: none;
}

.reset-password-row {
  display: flex;
  gap: 0.4rem;
  margin: 0;
}

.account-password form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 22rem;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.account-password label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.notice {
  padding: 0.6rem 0.9rem;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 0.375rem;
  color: #92400e;
}

.log-pane {
  height: 32rem;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  background: #111827;
  color: #e5e7eb;
  border-radius: 0.5rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8125rem;
  white-space: pre-wrap;
  word-break: break-word;
}
