:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222c;
  --border: #2a2f3a;
  --text: #e6e8ec;
  --muted: #9aa1ad;
  --accent: #5b8cff;
  --accent-2: #35d08f;
  --danger: #ff5c6c;
}

* { box-sizing: border-box; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.topbar .brand { font-weight: 700; font-size: 18px; letter-spacing: 0.02em; }
.topbar .brand span { color: var(--accent); }

.container { max-width: 1000px; margin: 0 auto; padding: 32px 24px; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}

.card.login { width: 100%; max-width: 380px; }

h1 { font-size: 22px; margin: 0 0 20px; }
h2 { font-size: 16px; color: var(--muted); margin: 0 0 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

input[type=text], input[type=password], input[type=file] {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

input:focus { outline: none; border-color: var(--accent); }

button, .btn {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

button:hover, .btn:hover { filter: brightness(1.1); text-decoration: none; }

.btn.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.btn.danger { background: var(--danger); }

.error {
  background: rgba(255,92,108,0.12);
  border: 1px solid rgba(255,92,108,0.4);
  color: #ffb3ba;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 6px;
}

.notice {
  background: rgba(53,208,143,0.12);
  border: 1px solid rgba(53,208,143,0.4);
  color: #a6f0d1;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.project-grid { display: grid; gap: 14px; }

.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.project-card .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.project-card .name { font-size: 17px; font-weight: 600; }
.project-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.project-card .actions form { display: inline; }

.empty { color: var(--muted); padding: 40px 0; text-align: center; }

.actions-row { display: flex; justify-content: flex-end; margin-bottom: 18px; }

.viewer-frame {
  width: 100%;
  height: 78vh;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.report-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.stat-pill {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--muted);
  margin-right: 6px;
}
