:root {
  --bg: #0f1115;
  --panel: #171a21;
  --text: #eef0f3;
  --muted: #9aa3af;
  --accent: #4da3ff;
  --border: #262a33;
  --danger: #ff6b6b;
}

:root[data-theme="light"] {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #14161a;
  --muted: #5b6270;
  --accent: #1a73e8;
  --border: #dde1e6;
  --danger: #c62828;
}

* {
  box-sizing: border-box;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 50;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.theme-toggle:hover {
  opacity: 0.85;
}

.report-title-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  margin: 0 auto 2rem;
  max-width: 480px;
}

.report-title-bar h1 {
  margin: 0;
}

.report-title-bar input[type="text"] {
  width: auto;
  min-width: 280px;
  max-width: 480px;
  text-align: center;
  font-size: 1.1rem;
}

.report-field {
  margin-bottom: 2rem;
}

.report-form {
  background: none;
  border: none;
  padding: 0;
  max-width: none;
}

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

header {
  padding: 2rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

header p {
  margin: 0;
  color: var(--muted);
}

nav {
  margin-top: 0.75rem;
}

nav a {
  margin-right: 1rem;
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

section {
  margin-bottom: 2.5rem;
}

h2 {
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.section-header h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin: 0;
}

.section-header a {
  font-size: 0.85rem;
  white-space: nowrap;
}

h3 {
  font-size: 1.05rem;
  color: var(--muted);
}

a {
  color: var(--accent);
}

p.muted {
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

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

th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 420px;
}

form.inline {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  max-width: none;
}

label {
  display: block;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

input[type="checkbox"] {
  margin-right: 0.5rem;
}

button {
  background: var(--accent);
  color: #071019;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

.error {
  color: var(--danger);
}

.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.chart-card.small {
  max-width: 320px;
}

.row {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
