:root {
  color-scheme: light dark;
  --bg: #f5f4f2;
  --surface: #ffffff;
  --border: #e2e0dc;
  --text: #2b2926;
  --text-muted: #726d66;
  --brown: #8b6e58;
  --up: #2e7d32;
  --down: #c62828;
  --unknown: #9e9e9e;
}

* { box-sizing: border-box; }

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

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

header h1 { font-size: 18px; margin: 0; }

.link-button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

main#projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-card-header h2 { font-size: 16px; margin: 0; }

.mode-badge {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 8px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.label { color: var(--text-muted); }

.status-up, .status-running { color: var(--up); font-weight: 600; }
.status-down, .status-crashed, .status-stopped { color: var(--down); font-weight: 600; }
.status-starting, .status-restarting, .status-unknown { color: var(--unknown); font-weight: 600; }

.meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.actions button {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.actions button:hover { background: var(--border); }

.logs {
  margin-top: 12px;
  background: #1e1c1a;
  color: #e8e6e3;
  border-radius: 8px;
  padding: 10px;
  font-size: 11px;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.login-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form h1 { margin: 0 0 8px; font-size: 18px; text-align: center; }

.maeum-login-button {
  display: block;
  text-align: center;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--brown);
  color: white;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.login-form .error { color: var(--down); font-size: 13px; margin: 0; text-align: center; }

.user-info { font-size: 13px; color: var(--text-muted); margin-right: 12px; }
