:root {
  color-scheme: light dark;
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #5b9fd4;
  --danger: #e06c75;
  --border: #2a3545;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 600; margin-right: auto; }

.topbar nav { display: flex; gap: 1rem; }
.topbar nav a.active { font-weight: 600; text-decoration: underline; }

.logout-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.container.narrow { max-width: 420px; }

h1 { margin-top: 0; }

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

.error {
  color: var(--danger);
  background: rgba(224, 108, 117, 0.12);
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

.period-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.period-tabs a {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.period-tabs a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

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

.stat .value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.25rem 0 0;
}

label {
  display: block;
  margin-bottom: 1rem;
}

input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

button {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

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

th, td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th { background: rgba(255, 255, 255, 0.03); }

table.wide { font-size: 0.92rem; }

pre {
  max-width: 320px;
  overflow: auto;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}
