/* KS Strefa — panel klubowy. Motyw: ciemny granat, niebieskie akcenty (#0077FF), białe napisy. */

:root {
  --bg: #071324;
  --bg-deep: #050e1c;
  --surface: #0f2038;
  --surface-2: #142a49;
  --surface-3: #1b3557;
  --sidebar: #040b16;
  --sidebar-active: #0077ff;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #eef4fb;
  --text-soft: #b6c6dc;
  --muted: #7e93ad;
  --blue: #0077ff;
  --blue-dark: #0059c2;
  --teal: #087582;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 16px 40px rgba(2, 8, 20, 0.55);
  --shadow-soft: 0 6px 18px rgba(2, 8, 20, 0.4);
  --sidebar-w: 104px;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  background-color: var(--bg);
  /* Tło marki: podmieniane przez /static/brand/background.png */
  background-image: url("/static/brand/background.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  /* Przygaszenie tła, żeby karty i tekst pozostały czytelne. */
  background: linear-gradient(180deg, rgba(7, 19, 36, 0.93), rgba(5, 14, 28, 0.97));
}

a {
  color: inherit;
  text-decoration: none;
}

/* Zabezpieczenie — SVG bez jawnego rozmiaru nie może być większe niż 24px */
svg:not([width]):not([height]) {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

::selection {
  background: var(--blue);
  color: #fff;
}

/* ---------- Layout ---------- */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  border-radius: 0 26px 26px 0;
  padding: 22px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  box-shadow: var(--shadow);
}

/* Przewijalna lista pozycji (pion na desktopie, poziom na mobile) */
.sidebar__nav {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.sidebar__nav::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.sidebar__brand {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  overflow: visible;
  flex: none;
}

.sidebar__brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0, 119, 255, 0.4));
  transition: filter 0.2s;
}

.sidebar__brand:hover img {
  filter: drop-shadow(0 0 16px rgba(0, 119, 255, 0.7));
}

.sidebar__brand span {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: #fff;
}

.nav-item {
  width: 100%;
  padding: 11px 4px 9px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item--active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 119, 255, 0.4);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item span {
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
}

.nav-spacer {
  flex: 1;
}

/* ── veralo.io branding ─────────────────────────────────────────────────── */
/* ── Panel veralo footer ──────────────────────────────── */
.panel-veralo {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 32px 4px 16px;
  opacity: 0.6;
  transition: opacity .2s;
}
.panel-veralo:hover { opacity: 1; }
.panel-veralo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  display: block;
}
.panel-veralo span {
  font-size: 9px;
  letter-spacing: .07em;
  color: var(--muted);
  text-transform: uppercase;
}

.panel-veralo--auth {
  align-items: center;
  text-align: center;
  padding: 8px 16px 24px;
  width: 100%;
  max-width: 420px;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 26px 32px 48px;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

/* Przesuń grupę przełącznik+chip maksymalnie w prawo */
.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-title strong {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-title small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--blue);
  text-transform: uppercase;
}

/* ── Notification bell ─────────────────────────────────────────────────── */
.notif-bell {
  position: relative;
}

/* ── Help button ──────────────────────────────────────── */
.help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.help-btn:hover { border-color: var(--blue); color: var(--blue); }

.notif-bell__btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  transition: border-color .15s, color .15s;
}

.notif-bell__btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.notif-bell__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notif-bell__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
  z-index: 300;
  overflow: hidden;
  flex-direction: column;
}

.notif-bell--open .notif-bell__dropdown {
  display: flex;
}

.notif-bell__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.notif-bell__mark-all {
  font-size: 11px;
  color: var(--blue);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.notif-bell__mark-all:hover { text-decoration: underline; }

.notif-bell__item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  transition: background .12s;
}

.notif-bell__item:last-child { border-bottom: none; }
.notif-bell__item:hover { background: rgba(255,255,255,.04); }

.notif-bell__item--unread {
  background: rgba(0, 119, 255, .06);
}

.notif-bell__item-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.notif-bell__item-body {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.notif-bell__empty {
  padding: 20px 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ── Role switcher ─────────────────────────────────────────────────────── */
.role-switcher {
  position: relative;
}

.role-switcher__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
}

.role-switcher__btn:hover {
  border-color: var(--blue);
  background: var(--surface-hover, var(--surface));
}

.role-switcher__label {
  color: var(--blue);
}

.role-switcher__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 200;
  flex-direction: column;
  gap: 2px;
}

.role-switcher--open .role-switcher__dropdown {
  display: flex;
}

.role-switcher__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}

.role-switcher__option:hover {
  background: var(--line);
}

.role-switcher__option--active {
  color: var(--blue);
  font-weight: 700;
}

/* ── User chip ─────────────────────────────────────────────────────────── */
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 8px 7px 16px;
  box-shadow: var(--shadow-soft);
}

.user-chip__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-chip__meta strong {
  font-size: 13px;
  font-weight: 700;
}

.user-chip__meta span {
  font-size: 11px;
  color: var(--muted);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  flex: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── upload zdjęcia profilowego ─────────────────────────────────────── */
.avatar-upload {
  position: relative;
  flex: none;
}

.avatar-upload__img,
.avatar-upload__placeholder {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--blue);
  display: block;
}

.avatar-upload__placeholder {
  background: var(--surface2);
  color: var(--blue);
  font-size: 28px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.avatar-upload__btn {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  background: var(--blue);
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}

.avatar-upload__btn:hover { background: var(--blue-dark); }
.avatar-upload__btn svg { width: 14px; height: 14px; stroke: #fff; }

.btn--sm {
  padding: 4px 12px;
  font-size: 11px;
  border-radius: 8px;
}

/* ---------- Dashboard layout ---------- */

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.dash-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.period-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.period-tab {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}

.period-tab:hover { border-color: var(--blue); color: var(--blue); }

.period-tab--active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.kpi-card__value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-top: 8px;
}

.kpi-card__unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}

.kpi-card__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.kpi-card__new { color: #22c55e; }

.kpi-card__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.card--link {
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}

.card--link:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

/* ---------- Greeting & grid ---------- */

.greeting {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.greeting + .meta {
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.grid--halves {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

.grid--stats {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

.card--span {
  grid-column: 1 / -1;
}

.card--unread {
  border-color: rgba(0, 119, 255, .35);
  background: rgba(0, 119, 255, .04);
}

.card--blue {
  background: linear-gradient(140deg, var(--blue), #0b4ea8);
  border-color: rgba(255, 255, 255, 0.2);
}

.card--teal {
  background: linear-gradient(140deg, var(--teal), #045c66);
  border-color: rgba(255, 255, 255, 0.16);
}

.card__title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.card--blue .card__title,
.card--teal .card__title {
  color: rgba(255, 255, 255, 0.92);
}

.card__title svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card__head .card__title {
  margin-bottom: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
  width: 100%;
}

.btn:hover:not(:disabled) {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--line-strong);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--blue);
}

.btn--light {
  background: #fff;
  color: #071324;
}

.btn--light:hover:not(:disabled) {
  background: #dbe7f5;
}

.btn--danger {
  background: var(--danger);
}

.btn--danger:hover:not(:disabled) {
  background: #c22c2c;
}

.btn--sm {
  width: auto;
  padding: 9px 14px;
  font-size: 11px;
}

.btn-stack {
  display: grid;
  gap: 10px;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Forms ---------- */

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  font: inherit;
  font-size: 14px;
  color: var(--text);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: #030a14;
}

.field select option {
  background: var(--surface);
  color: var(--text);
}

.field-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field-inline {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

/* ---------- Auth ---------- */

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px calc(24px + env(safe-area-inset-bottom));
  gap: 4px;
}

.auth__box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px 28px;
  box-shadow: var(--shadow);
}

.auth__brand {
  text-align: center;
  margin-bottom: 22px;
}

.auth__brand img {
  max-width: 140px;
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(0, 119, 255, 0.35));
}

.auth__brand-text strong {
  display: block;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.auth__brand-text small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--blue);
}

.auth__box h1 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 18px;
}

.auth__alt {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.auth__foot {
  margin-top: 18px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

.auth__foot a {
  font-weight: 700;
  color: var(--blue);
}

.legal-links {
  margin: 12px 0 0;
  font-size: 11px;
  text-align: center;
  color: var(--muted);
}
.legal-links a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-links a:hover { color: var(--blue); }
.legal-links span { margin: 0 6px; opacity: 0.5; }

.panel-veralo .legal-links {
  width: 100%;
  margin-top: 8px;
  text-align: right;
}

.field--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
}
.field--checkbox input {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
}
.field--checkbox span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.field--checkbox a {
  color: var(--blue);
  font-weight: 600;
}

.legal-page .legal-page__box {
  max-width: 720px;
  width: 100%;
  text-align: left;
  max-height: 90vh;
  overflow-y: auto;
}
.legal-page h1 {
  font-size: 22px;
  margin-bottom: 8px;
}
.legal-page__meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 24px;
}
.legal-page__back {
  margin-bottom: 16px;
  font-size: 13px;
}
.legal-page__back a { color: var(--blue); }
.legal-page section {
  margin-bottom: 22px;
}
.legal-page h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.legal-page p,
.legal-page li {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.legal-page ul {
  padding-left: 18px;
  margin: 8px 0;
}
.legal-table-wrap { overflow-x: auto; margin: 10px 0; }
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.legal-table th,
.legal-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: var(--bg-deep);
  color: var(--text);
  font-weight: 600;
}
.legal-table code {
  font-size: 11px;
  color: var(--blue);
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 12px 16px;
  background: rgba(10, 14, 26, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.cookie-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  justify-content: space-between;
}
.cookie-banner__text {
  flex: 1;
  min-width: 240px;
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.cookie-banner__text a {
  color: var(--blue);
  font-weight: 600;
}
.cookie-banner__btn { flex-shrink: 0; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Alerts ---------- */

.alert {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid;
}

.alert--error {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.4);
}

.alert--ok {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.4);
}

/* ---------- Badges / meta ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--text-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.badge--ok {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}

.badge--blue {
  background: rgba(0, 119, 255, 0.2);
  color: #93c5fd;
  border-color: rgba(0, 119, 255, 0.5);
}

.badge--warn {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

.badge--danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.meta {
  font-size: 13px;
  color: var(--muted);
}

.meta strong {
  color: var(--text);
}

.stat {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.stat--sm {
  font-size: 22px;
}

.trend {
  font-size: 12px;
  font-weight: 800;
}

.trend--up {
  color: #86efac;
}

.trend--down {
  color: #fca5a5;
}

/* ---------- Charts (SVG generowane serwerowo) ---------- */

.chart {
  width: 100%;
  overflow: hidden;
}

.chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart__bar {
  fill: var(--blue);
}

.chart__bar--muted {
  fill: var(--surface-3);
}

.chart__line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart__area {
  fill: rgba(0, 119, 255, 0.18);
}

.chart__axis {
  stroke: var(--line);
  stroke-width: 1;
}

.chart__label {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 700;
  font-family: inherit;
  text-anchor: middle;
}

.chart__value {
  fill: var(--text-soft);
  font-size: 9px;
  font-weight: 700;
  font-family: inherit;
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
}

.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--blue);
  margin-right: 6px;
}

.chart-legend span.is-muted::before {
  background: var(--surface-3);
}

/* ---------- Schedule ---------- */

.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.week-head__range {
  font-size: 17px;
  font-weight: 800;
}

.week-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.week {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-top: 18px;
}

.day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 12px 15px;
  box-shadow: var(--shadow-soft);
  min-height: 150px;
  display: flex;
  flex-direction: column;
}

.day--today {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), var(--shadow-soft);
}

.day__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.day__name {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.day__num {
  font-size: 17px;
  font-weight: 800;
}

.day__list {
  display: grid;
  gap: 8px;
}

.day__add {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 4px 8px;
  margin-bottom: 9px;
}

.day__add:hover {
  color: #fff;
  border-color: var(--blue);
  border-style: solid;
  background: rgba(0, 119, 255, 0.14);
}

.session {
  display: block;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 8px 9px;
  background: var(--surface-2);
  font-size: 12px;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.session:hover {
  background: var(--surface-3);
  border-color: var(--blue);
}

.session--mine {
  border-left-color: var(--ok);
  background: rgba(34, 197, 94, 0.1);
}

.session--past {
  opacity: 0.5;
  border-left-color: var(--muted);
}

.session__title {
  font-weight: 700;
  margin-bottom: 2px;
}

.session__time {
  color: var(--text-soft);
  font-size: 11.5px;
}

.session__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--muted);
}

.day__empty {
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0.7;
}

/* ---------- Table ---------- */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 9px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

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

.td-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ---------- Paginacja ---------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pager__pages {
  display: flex;
  gap: 6px;
}

.pager__page {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-soft);
}

.pager__page:hover {
  border-color: var(--blue);
  color: #fff;
}

.pager__page--active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.pager__page--off {
  opacity: 0.35;
  pointer-events: none;
}

/* ---------- Sklep ---------- */

.shop-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.product {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}

.product__thumb {
  height: 128px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--surface-2), var(--surface-3));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.product__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product__thumb svg {
  width: 44px;
  height: 44px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.4;
}

.product__name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
}

.product__prices {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.product__cash {
  font-size: 19px;
  font-weight: 800;
}

.product__points {
  font-size: 12.5px;
  font-weight: 700;
  color: #93c5fd;
}

.product__foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty input {
  width: 68px;
  padding: 9px 10px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--bg-deep);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

/* ---------- Pass card ---------- */

.pass {
  background: linear-gradient(145deg, #0b1f3d, #0077ff);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.pass__name {
  font-size: 19px;
  font-weight: 800;
}

.pass__email {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 18px;
}

.barcode {
  background: #fff;
  border-radius: 12px;
  padding: 14px 12px 8px;
  text-align: center;
}

.barcode svg {
  width: 100%;
  height: auto;
  max-height: 110px;
}

.barcode__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #071324;
  padding-bottom: 6px;
}

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 18, 0.72);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.modal__box {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal__box--form {
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
}

.modal__title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 4px;
}

.modal__actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.dl {
  display: grid;
  gap: 8px;
  margin: 14px 0 2px;
  font-size: 13.5px;
}

.dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.dl dd {
  font-weight: 600;
  text-align: right;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .week {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  html {
    background-attachment: scroll;
  }

  :root {
    --sidebar-w: 100%;
  }

  .shell {
    flex-direction: column;
    max-width: 100%;
    overflow-x: clip;
  }

  /* Dolny pasek — przewijanie w .sidebar__nav (Safari wymaga min-width: 0 na flex) */
  .sidebar {
    width: 100%;
    max-width: 100vw;
    flex: none;
    height: auto;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 100;
    border-radius: 0;
    border-right: none;
    border-top: 1px solid var(--line);
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    gap: 0;
    order: 2;
    box-shadow: 0 -8px 24px rgba(2, 8, 20, 0.55);
  }

  .sidebar__brand {
    display: none;
  }

  .sidebar__nav {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    padding: 6px 10px;
  }

  .sidebar__nav::-webkit-scrollbar {
    display: none;
  }

  .nav-spacer {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 56px;
    max-width: 80px;
    padding: 6px 4px 8px;
  }

  .nav-item span {
    font-size: 9px;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
  }

  .main {
    padding: 16px 14px calc(78px + env(safe-area-inset-bottom));
    order: 1;
    width: 100%;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
  }

  .brand-title strong {
    font-size: 20px;
    letter-spacing: 0.06em;
  }

  .brand-title small {
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  .topbar__right {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
  }

  .user-chip {
    padding: 4px 4px 4px 10px;
    gap: 8px;
  }

  .notif-bell__dropdown {
    width: min(340px, calc(100vw - 28px));
    right: -8px;
  }

  .grid,
  .grid--halves,
  .grid--stats,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card__value {
    font-size: 26px;
  }

  .card {
    padding: 16px 14px;
  }

  .card__head {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-veralo {
    align-items: center;
    text-align: center;
    padding-top: 24px;
  }

  .panel-veralo .legal-links {
    text-align: center;
  }

  .cookie-banner {
    bottom: calc(58px + env(safe-area-inset-bottom));
    padding: 10px 12px;
  }

  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner__text {
    min-width: 0;
  }

  .cookie-banner__btn {
    width: 100%;
  }

  .auth {
    padding: 24px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .auth__box {
    padding: 24px 20px;
  }

  .modal {
    padding: 12px;
    align-items: flex-end;
  }

  .modal__box,
  .modal__box--form {
    max-height: 88vh;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    margin: 0 -14px;
    padding: 0 14px;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 12.5px;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .td-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .pager {
    flex-direction: column;
    align-items: stretch;
  }

  .week {
    grid-template-columns: 1fr;
  }

  .greeting {
    font-size: 22px;
  }

  .dash-header {
    flex-direction: column;
    align-items: stretch;
  }

  .btn--sm {
    min-height: 40px;
  }

  /* iOS Safari — bez powiększania przy focusie w polach */
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
}

@supports (backdrop-filter: blur(8px)) {
  .cookie-banner {
    backdrop-filter: blur(8px);
  }
}

@media (max-width: 480px) {
  .user-chip__meta {
    display: none;
  }

  .role-switcher__btn {
    padding: 7px 10px;
    font-size: 11px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .brand-title small {
    display: none;
  }
}
