:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --bg: #18181b;
  --bg-alt: #23232b;
  --bg-table: #1e1e24;
  --text: #e5e7eb;
  --text-muted: #a1a1aa;
  --border: #333;
  --hover: #27272f;
  --accent: #60a5fa;
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  font-size: 17px;
  letter-spacing: 0.01em;
}

header {
  background: var(--bg-alt);
  padding: 2rem 1rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px #0004;
  display: flex;
  flex-direction: column;
  align-items: center;      /* Wyśrodkowanie w poziomie */
  text-align: center;       /* Wyśrodkowanie tekstu */
}

.logo {
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.03em;
  font-size: 2.2rem;
  margin-top: 0;
}

h1, h2 {
  color: #fff;
  margin-bottom: 1.0rem;
  margin-top: 0;
}

h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.datetitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.5em;
}

.dateinfo {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  width: 100%;
  text-align: center;
  margin: 0;
  margin-top: 0.4rem;
}

form#filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem;
  margin-top: 1.1rem;
  justify-content: center;
}

form label {
  margin-right: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
}

form select, form input[type="date"], form button {
  background: var(--bg-table);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.9rem;
  font-size: 1rem;
  margin-left: 0.4rem;
  outline: none;
  transition: border 0.2s, background 0.2s;
}

form button {
  background: var(--primary);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

form button:hover {
  background: var(--primary-dark);
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0;
  font-size: 1.05rem;
  padding: 1rem 0 0.5rem 0;
  justify-content: center;
}

.summary div {
  background: var(--bg-table);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 0.6em 1.2em;
  font-weight: 500;
  box-shadow: 0 2px 8px #0002;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.summary div span {
  color: var(--text-muted);
  font-weight: 400;
  margin-right: 0.4em;
}

main {
  padding: 2rem 1rem 2rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.switcher {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
}

.switcher button {
  background: var(--bg-alt);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 2.1rem;
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 2px 8px #0002;
}

.switcher button.active, .switcher button:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--accent);
}

#tableWrap, #chartWrap {
  width: 100%;
}

#categories, #chart {
  margin: 0 auto;
  width: 100%;
  max-width: 800px;
}

#categories {
  background: var(--bg-alt);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: 0 2px 12px #0002;
  margin-bottom: 2rem;
  font-size: 1.08rem;
}

th, td {
  padding: 1.1rem 1rem;
  text-align: left;
}

th {
  background: #1f2937;
  cursor: pointer;
  color: var(--primary);
  user-select: none;
  font-size: 1.08rem;
  font-weight: 600;
  border-bottom: 1.5px solid var(--border);
}

tr:nth-child(even) { background: var(--bg-table); }
tr:hover { background: var(--hover); }

td {
  border-bottom: 1px solid var(--border);
}

.nodata {
  padding: 2.5em 0 2em 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 1.12rem;
  font-style: italic;
}

#chartWrap {
  min-height: 340px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chart {
  background: var(--bg-alt);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px #0002;
  padding: 1.2rem;
  max-height: 320px;
  height: 320px;
}

footer {
  background: var(--bg);
  color: #888;
  text-align: center;
  padding: 2.5rem 1rem 1.2rem 1rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.01rem;
  letter-spacing: 0.03em;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  main { padding: 1.2rem 0.5rem; }
  .summary { gap: 0.6rem; }
  .summary div { padding: 0.5em 0.7em; font-size: 0.98rem; }
  #categories, #chart { font-size: 0.98rem; }
  .switcher button { padding: 0.55rem 1.1rem; font-size: 1rem; }
}
