:root {
  --ink: #0c1f2e; --ink2: #143246; --sea: #2f7d73; --sea2: #3d9b8f;
  --bg: #f4f6f8; --card: #ffffff; --line: #e6ebef; --mut: #6b7b86; --text: #1a2b36;
  --sand: #e0a84a; --red: #d7483b; --amber: #d9880f; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}
a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Układ: sidebar + treść */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #dfe8ec; padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -0.3px; margin: 2px 6px 18px; }
.brand span { color: var(--sea2); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: #c3d0d9; font-weight: 500; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,0.06); text-decoration: none; }
.nav a.on { background: var(--sea); color: #fff; }
.sidebar .foot { position: absolute; bottom: 16px; left: 14px; right: 14px; }
.sidebar .foot button {
  width: 100%; background: rgba(255,255,255,0.08); color: #dfe8ec; border: 0;
  padding: 9px; border-radius: 10px; cursor: pointer; font-weight: 600;
}
.content { padding: 24px 28px; max-width: 1100px; }
h1.page { font-size: 22px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.4px; }
.sub { color: var(--mut); margin: 0 0 20px; }

/* Karty */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi .label { color: var(--mut); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi .val { font-size: 30px; font-weight: 700; letter-spacing: -1px; margin-top: 4px; }
.kpi .delta { font-size: 12px; color: var(--sea); font-weight: 600; margin-top: 2px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .cols-2 { grid-template-columns: 1fr; } }

.card h2 { font-size: 14px; font-weight: 700; margin: 0 0 14px; }

/* Wykres słupkowy */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bars .bar { flex: 1; background: linear-gradient(180deg, var(--sea2), var(--sea)); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .bar:hover::after {
  content: attr(data-label); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 6px; white-space: nowrap; margin-bottom: 4px;
}
.axis { display: flex; justify-content: space-between; color: var(--mut); font-size: 11px; margin-top: 6px; }

/* Tabela */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--mut); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }

/* Znaczniki / przyciski */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.ok { background: rgba(47,125,115,0.12); color: var(--sea); }
.badge.off { background: #eef1f3; color: var(--mut); }
.badge.admin { background: rgba(224,168,74,0.16); color: #9a6a12; }
.badge.editor { background: #eef1f3; color: var(--mut); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 6px 11px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f7f9fa; text-decoration: none; }
.btn.primary { background: var(--sea); border-color: var(--sea); color: #fff; }
.btn.primary:hover { background: var(--ink2); }
.btn.danger { color: var(--red); border-color: #f0c9c5; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.inline { display: inline; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Przełącznik */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.switch input { display: none; }
.slider { position: absolute; inset: 0; background: #cdd5da; border-radius: 999px; transition: 0.2s; cursor: pointer; }
.slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: var(--sea); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Formularze */
label.field { display: block; margin-bottom: 14px; }
label.field .cap { display: block; font-size: 12px; font-weight: 600; color: var(--mut); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.03em; }
input[type=text], input[type=password], input[type=url], textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fbfcfd;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--sea2); box-shadow: 0 0 0 3px rgba(61,155,143,0.15); }

.notice { padding: 10px 14px; border-radius: 10px; font-weight: 600; margin-bottom: 16px; }
.notice.info { background: rgba(47,125,115,0.1); color: var(--sea); }
.notice.warn { background: rgba(217,136,15,0.12); color: var(--amber); }
.notice.err { background: rgba(215,72,59,0.1); color: var(--red); }
.muted { color: var(--mut); }
.mt { margin-top: 18px; }

/* Logowanie */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { width: 100%; max-width: 360px; }
