:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #14161a;
  --muted: #5c6470;
  --line: #e3e6ea;
  --accent: #1f5eff;
  --accent-ink: #ffffff;
  --danger: #c0392b;
  --ok: #1e7d4f;
  --warn: #a86a00;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { width: min(960px, 100% - 2.5rem); margin-inline: auto; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; letter-spacing: -.02em; }

.lang { font-size: .85rem; color: var(--muted); }

.hero { padding: 4rem 0 2.5rem; }
.hero-row { display: grid; gap: 1.5rem; align-items: center; }
.hero-row .lead { margin-bottom: 0; }
@media (min-width: 760px) {
  .hero-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2.5rem; }
}

.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .9rem;
}

h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 .75rem; }

.lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 2rem; max-width: 46ch; }

.price-card {
  display: inline-flex; flex-direction: column; gap: .2rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.4rem; box-shadow: var(--shadow);
}

.price-card .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.price-card .value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}

.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .grid-2 { grid-template-columns: 1.05fr .95fr; align-items: start; } }

section { padding: 1rem 0 3rem; }

h2 { font-size: 1.15rem; letter-spacing: -.01em; margin: 0 0 .35rem; }

.muted { color: var(--muted); font-size: .9rem; }

label { display: block; font-size: .85rem; font-weight: 600; margin: .9rem 0 .35rem; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: .65rem .8rem; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

textarea { min-height: 130px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 9px; border: 1px solid transparent; background: var(--accent);
  color: var(--accent-ink); text-decoration: none;
}

.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--danger { background: transparent; color: var(--danger); border-color: #e8c4bf; }
.btn--sm { padding: .35rem .7rem; font-size: .85rem; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { border-radius: 9px; padding: .75rem 1rem; font-size: .9rem; margin-bottom: 1rem; }
.notice--ok { background: #e9f7ef; color: var(--ok); }
.notice--err { background: #fdecea; color: var(--danger); }

.chart { width: 100%; height: auto; display: block; }
.chart-axis { stroke: #dfe3e9; stroke-width: 1; }
.chart-grid { stroke: #eef1f5; stroke-width: 1; }
.chart-bar { fill: #c9d6ff; }
.chart-bar--today { fill: #8fb0ff; }
.chart-bar--peak { fill: var(--accent); }
.chart-tick { font-size: 12px; fill: var(--muted); font-family: inherit; font-variant-numeric: tabular-nums; }
.chart-label { font-size: 13px; fill: var(--muted); font-family: inherit; }

.chart-stats { display: flex; gap: 1.75rem; flex-wrap: wrap; margin: .35rem 0 1.1rem; }
.chart-stats strong { display: block; font-size: 1.2rem; letter-spacing: -.02em; }
.chart-stats span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.stack { display: grid; gap: 1.5rem; max-width: 760px; margin-inline: auto; }

.site-footer {
  border-top: 1px solid var(--line); padding: 1.5rem 0 3rem;
  color: var(--muted); font-size: .85rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* panel */
.panel-shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 860px) { .panel-shell { grid-template-columns: 220px 1fr; } }

.side { background: #101318; color: #cfd6e0; padding: 1.5rem 1.25rem; }
.side .brand { color: #fff; display: block; margin-bottom: 1.5rem; }
.side nav { display: grid; gap: .25rem; }
.side nav a { color: #aab4c2; padding: .5rem .6rem; border-radius: 8px; font-size: .92rem; }
.side nav a:hover, .side nav a[aria-current=page] { background: #1c222b; color: #fff; text-decoration: none; }
.side form { margin-top: 1.5rem; }

.main { padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.topbar h1 { font-size: 1.5rem; margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; }
.badge--active { background: #e9f7ef; color: var(--ok); }
.badge--pending { background: #fff4e0; color: var(--warn); }

.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.stat { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.2rem; }
.stat strong { display: block; font-size: 1.5rem; letter-spacing: -.02em; }
.stat span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.login-card { width: min(380px, 100%); }

.msg { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; background: var(--surface); }
.msg header { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.msg p { margin: 0; white-space: pre-wrap; }
.msg .msg-error { margin-top: .5rem; color: var(--danger); font-size: .85rem; white-space: pre-wrap; }

.hint { font-size: .85rem; color: var(--muted); background: #f0f3f7; border-radius: 9px; padding: .8rem 1rem; }

.field-row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.optional { font-weight: 400; color: var(--muted); font-size: .82em; }

.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 2rem; }
.notfound h1 { font-size: 1.3rem; margin-bottom: .5rem; }

/* Narzędzia zamiast stylów inline (CSP: style-src 'self') */
.mt-lg { margin-top: 1.5rem; }
.mb-sm { margin-bottom: .5rem; }
.card--narrow { max-width: 560px; }
.hint--narrow { max-width: 560px; margin-top: 1.5rem; }
.login-title { font-size: 1.3rem; margin: 0 0 .25rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: #eef1f5; padding: .1rem .35rem; border-radius: 5px; }
