/* ==========================================================================
   EastROBO – style.css
   Paleta z logo: ZGASZONY FIOLET (kwiat/zębatka) + ŻYWA ZIELEŃ (liście)
   + grafit (napis EAST). Zmieniając kolory, edytuj tylko zmienne w :root.
   Bez zewnętrznych fontów i bibliotek – strona ładuje się natychmiast.
   ========================================================================== */

:root {
  /* Żywa zieleń (liście) */
  --green-50: #f0faf2;
  --green-100: #dcf4e2;
  --green-400: #6fd682;
  --green-500: #44c15a;
  --green-600: #2fa648;
  --green-700: #1f7a35;
  --green-800: #165a27;
  --on-green: #0c2a15;           /* ciemny tekst na żywej zieleni (kontrast > 7:1) */

  /* Zgaszony fiolet (kwiat / zębatka) */
  --purple-50: #f6f3fa;
  --purple-100: #ebe5f4;
  --purple-200: #d9cfe9;
  --purple-400: #9a82c1;
  --purple-500: #8a72b3;
  --purple-600: #6b5194;
  --purple-700: #553f78;
  --purple-800: #3f2f5a;

  /* Grafit (napis EAST) i ciemne tło Aktualności */
  --graphite-900: #1f1d24;
  --graphite-800: #2b2932;
  --graphite-700: #3d3b46;
  --night-900: #1b1626;
  --night-800: #251d38;
  --night-700: #32284d;

  --paper: #f5f4f8;
  --white: #ffffff;
  --ink: #221f2b;
  --muted: #5d5a6b;
  --line: #dcd8e6;

  /* Panel admina = fiolet z logo */
  --admin: var(--purple-600);
  --admin-dark: var(--purple-700);
  --admin-tint: var(--purple-50);
  --admin-line: var(--purple-200);

  --danger: #b3261e;
  --danger-tint: #fbeceb;
  --ok-tint: #e3f4ea;
  --warn-tint: #fdf1d6;

  --duo: linear-gradient(90deg, var(--green-500), var(--purple-500));

  --radius: 14px;
  --header-h: 72px;
  --sidebar-w: 250px;

  --font-head: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Motyw ścieżek PCB: zielone i fioletowe linie (SVG w data-URI, kafelkowany) */
  --pcb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180' fill='none' stroke-width='2'%3E%3Cpath stroke='%2344c15a' stroke-opacity='.55' d='M0 40h50l20 20h60l20-20h30M0 120h30l25 25h45l20-25h60'/%3E%3Cpath stroke='%238a72b3' stroke-opacity='.5' d='M90 0v30l20 20M90 180v-30l-25-25M150 60v40l-20 20'/%3E%3Cg stroke='%238a72b3' stroke-opacity='.65'%3E%3Ccircle cx='50' cy='40' r='4'/%3E%3Ccircle cx='130' cy='60' r='4'/%3E%3Ccircle cx='100' cy='145' r='4'/%3E%3Ccircle cx='30' cy='120' r='4'/%3E%3Ccircle cx='150' cy='100' r='4'/%3E%3Ccircle cx='110' cy='50' r='4'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 .6em;
  color: var(--graphite-800);
}
h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
h3 { font-size: 1.12rem; }

p { margin: 0 0 1em; }
a { color: var(--green-700); }
a:hover { color: var(--green-800); }
img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 3px solid var(--green-500);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: #fff;
  color: var(--graphite-800);
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { top: 8px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Górny pasek (jasny – logo ma ciemnoszary napis EAST, więc potrzebuje jasnego tła)
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(12px, 2vw, 24px);
  background: var(--white);
  color: var(--ink);
  border-bottom: 4px solid;
  border-image: linear-gradient(90deg, var(--green-500), var(--purple-500)) 1;
  box-shadow: 0 6px 18px -10px rgba(37, 29, 56, .35);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
  color: var(--graphite-800);
  text-decoration: none;
}
.brand:hover { color: var(--graphite-800); }
.brand img { display: block; }
.brand img.logo-wide {
  height: auto;
  width: auto;
  max-height: 56px;
  max-width: 220px;
  object-fit: contain;
}
.brand img.logo-icon { width: 44px; height: 44px; }
.brand span {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--graphite-800);
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.top-link:hover { background: var(--purple-100); color: var(--purple-700); }
.top-link[aria-current="page"] { background: var(--purple-100); color: var(--purple-700); }
.top-link.cta { background: var(--green-500); color: var(--on-green); }
.top-link.cta:hover { background: var(--green-400); color: var(--on-green); }

.top-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.lang-switch {
  display: inline-flex;
  border: 2px solid var(--purple-200);
  border-radius: 9px;
  overflow: hidden;
  margin-right: 6px;
}
.lang-switch a {
  padding: 5px 11px;
  color: var(--purple-700);
  text-decoration: none;
  font-weight: 800;
  font-size: .88rem;
}
.lang-switch a:hover { background: var(--purple-100); }
.lang-switch a[aria-current="true"] { background: var(--purple-600); color: #fff; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-weight: 700;
  white-space: nowrap;
}
.role-badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  background: var(--green-100);
  color: var(--green-800);
}
.role-badge.admin { background: var(--purple-600); color: #fff; }
.logout-form { margin: 0; display: inline; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: -6px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  flex: none;
}
.menu-toggle:hover { background: var(--purple-100); }
.menu-toggle .bar,
.menu-toggle .bar::before,
.menu-toggle .bar::after {
  content: "";
  position: absolute;
  left: 11px;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--graphite-800);
  transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle .bar { top: 20px; }
.menu-toggle .bar::before { left: 0; top: -7px; }
.menu-toggle .bar::after { left: 0; top: 7px; }
.menu-toggle[aria-expanded="true"] .bar { background: transparent; }
.menu-toggle[aria-expanded="true"] .bar::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar::after { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Układ: lewy pasek + treść
   ========================================================================== */
.layout { display: flex; align-items: flex-start; min-height: calc(100vh - var(--header-h)); }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 16px 12px;
  background: var(--white);
  border-right: 1px solid var(--line);
}

.nav-link {
  display: block;
  padding: 11px 14px;
  margin-bottom: 2px;
  border-radius: 10px;
  border-left: 4px solid transparent;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.nav-link:hover { background: var(--green-50); color: var(--green-800); }
.nav-link[aria-current="page"] {
  background: var(--green-100);
  border-left-color: var(--green-500);
  color: var(--green-800);
}

.nav-sep { height: 1px; margin: 12px 4px; background: var(--line); }

/* Pozycje tylko dla admina – fiolet z logo */
.nav-link.admin {
  margin: 6px 0 0;
  background: var(--purple-600);
  border-left-color: transparent;
  color: #fff;
}
.nav-link.admin:hover { background: var(--purple-700); color: #fff; }
.nav-link.admin[aria-current="page"] { background: var(--purple-800); border-left-color: var(--green-400); }

.mobile-only { display: none; }

.overlay { display: none; }

.content {
  flex: 1;
  min-width: 0;
  padding: 28px clamp(16px, 3vw, 40px) 24px;
}
.content-inner { max-width: 1100px; margin: 0 auto; }

.site-footer {
  padding: 18px 16px 26px;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
}

/* ==========================================================================
   Komponenty
   ========================================================================== */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.4vw, 28px);
  margin-bottom: 22px;
}
.card > :last-child { margin-bottom: 0; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 12px;
}
.section-title h2 { margin: 0; }
.card .section-title:first-child { margin-top: 0; }

.empty {
  padding: 18px;
  border: 1px dashed #b9b3cc;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  background: var(--white);
}

.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  border: 1px solid;
  font-weight: 600;
}
.flash.ok { background: var(--ok-tint); border-color: #9ad3b3; color: #0f5132; }
.flash.err { background: var(--danger-tint); border-color: #eab5b1; color: #7a1712; }

.form-errors {
  margin: 0 0 18px;
  padding: 12px 16px 12px 34px;
  border: 1px solid #eab5b1;
  border-radius: 10px;
  background: var(--danger-tint);
  color: #7a1712;
  font-weight: 600;
}

/* --- Hero (jasny – dzięki temu ciemne Aktualności wyraźnie się wyróżniają) --- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 46px);
  padding-left: clamp(26px, 4.4vw, 52px);
  color: var(--ink);
  background-color: var(--white);
  background-image:
    linear-gradient(100deg, #fff 0%, rgba(255, 255, 255, .93) 46%, rgba(255, 255, 255, .3) 100%),
    var(--pcb);
  border: 1px solid var(--line);
  border-left: 10px solid var(--green-500);
  border-radius: 20px;
  box-shadow: 0 16px 34px -24px rgba(37, 29, 56, .5);
}
.hero h1 {
  margin: 0 0 20px;
  color: var(--graphite-900);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  letter-spacing: -.01em;
}
.hero h1::after {
  content: "";
  display: block;
  width: 84px;
  height: 6px;
  margin-top: 12px;
  border-radius: 3px;
  background: var(--duo);
}
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 34px;
  margin: 0 0 18px;
}
.hero-facts div { border-left: 3px solid var(--purple-500); padding-left: 12px; }
.hero-facts dt { font-size: .88rem; color: var(--muted); }
.hero-facts dd { margin: 0; font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; color: var(--graphite-800); }
.hero-desc { max-width: 62ch; margin: 0; color: var(--graphite-700); }

/* --- Panele admina (rozwijane, natywne <details>) --- */
details.admin-panel {
  margin-top: 14px;
  background: var(--admin-tint);
  border: 1px solid var(--admin-line);
  border-left: 5px solid var(--admin);
  border-radius: 12px;
}
details.admin-panel > summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  color: var(--admin-dark);
}
.admin-body { padding: 4px 16px 16px; }

/* --- Aktualności: jasny panel --- */
.news-panel {
  position: relative;
  overflow: hidden;
  margin: 30px 0 0;
  padding: clamp(22px, 3vw, 36px);
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 16px 34px -24px rgba(37, 29, 56, .15);
}
.news-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--duo);
}
.news-panel :focus-visible { outline-color: var(--green-500); }
.news-panel h2 { margin: 4px 0 20px; color: var(--graphite-900); }
.news-empty { margin: 0; color: var(--muted); }

.news-item { padding: 22px 0; border-top: 1px solid var(--line); }
.news-panel h2 + .news-item { border-top: 0; padding-top: 4px; }
.news-item:last-child { padding-bottom: 4px; }
.news-item.has-image {
  display: grid;
  grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.news-media {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.news-media:hover { border-color: var(--green-500); }
.news-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.news-main { min-width: 0; }
.news-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.news-head h3 { margin: 0; color: var(--graphite-800); font-size: 1.28rem; }
.news-date { color: var(--muted); font-size: .88rem; font-weight: 600; }
.news-body { margin: 8px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.news-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 16px; }

details.news-tools {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}
details.news-tools > summary { padding: 6px 14px; cursor: pointer; font-size: .88rem; font-weight: 700; color: var(--graphite-800); }
.news-photo-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 14px 12px; }
.news-photo-form input[type="file"] { max-width: 100%; color: var(--ink); font: inherit; font-size: .9rem; }
.news-photo-remove { margin: 0; padding: 0 14px 12px; }
/* --- Sponsorzy --- */
.sponsors { margin-top: 38px; padding-top: 22px; border-top: 2px solid var(--graphite-700); }
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sponsor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.sponsor img { max-height: 90px; object-fit: contain; }
.sponsor-name { font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }

/* --- Grafiki (harmonogram / wyniki) i regulamin --- */
.doc-image { margin: 0 0 16px; }
.doc-image img {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.action-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rules-text { overflow-wrap: anywhere; max-width: 78ch; }

/* ==========================================================================
   Formularze i przyciski
   ========================================================================== */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 4px; font-weight: 700; font-size: .93rem; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #a49dbb;
  border-radius: 10px;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input[type="file"] { width: 100%; font: inherit; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 3px solid rgba(68, 193, 90, .4);
  border-color: var(--green-600);
}
.hint { color: var(--muted); font-size: .86rem; margin: 4px 0 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 800;
  color: var(--on-green);
  background: var(--green-500);
  border: 2px solid var(--green-600);
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--green-400); border-color: var(--green-500); color: var(--on-green); }
.btn-outline { background: #fff; color: var(--green-800); border-color: var(--green-600); }
.btn-outline:hover { background: var(--green-50); color: var(--green-800); border-color: var(--green-600); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-admin { background: var(--purple-600); border-color: var(--purple-600); color: #fff; }
.btn-admin:hover { background: var(--purple-700); border-color: var(--purple-700); color: #fff; }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: .88rem; border-radius: 8px; }
.btn-lg { min-height: 56px; padding: 12px 24px; font-size: 1.12rem; border-radius: 12px; }
.btn-block { width: 100%; }
.inline-form { display: inline; margin: 0; }

/* ==========================================================================
   Logowanie i rejestracja – "ciężka", masywna karta
   ========================================================================== */
.auth-wrap { max-width: 540px; margin: 14px auto 0; }

.auth-card {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 42px);
  padding-top: clamp(34px, 4.6vw, 50px);
  background: var(--white);
  border: 2px solid var(--purple-200);
  border-radius: 20px;
  box-shadow:
    0 3px 0 var(--purple-200),
    0 30px 60px -22px rgba(37, 29, 56, .55);
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: linear-gradient(90deg, var(--purple-600) 0%, var(--purple-500) 45%, var(--green-500) 100%);
}

.auth-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.auth-head h1 { margin: 0; color: var(--graphite-900); font-size: clamp(1.7rem, 4vw, 2.1rem); font-weight: 800; }
.auth-icon {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  color: #fff;
  background: var(--purple-600);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--purple-800);
}
.auth-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 18px;
  height: 18px;
  background: var(--green-500);
  border: 3px solid #fff;
  border-radius: 50%;
}

.auth-card .field { margin-bottom: 18px; }
.auth-card .field label { margin-bottom: 6px; font-size: .97rem; font-weight: 800; color: var(--graphite-800); }
.auth-card .field input[type="text"],
.auth-card .field input[type="email"],
.auth-card .field input[type="password"] {
  padding: 14px 16px;
  font-size: 1.05rem;
  background: #faf9fc;
  border: 2px solid #8c84a6;
  border-radius: 12px;
  box-shadow: inset 0 2px 0 rgba(37, 29, 56, .07);
}
.auth-card .field input:hover { border-color: var(--purple-500); }
.auth-card .field input:focus {
  background: #fff;
  border-color: var(--purple-600);
  outline: 4px solid rgba(107, 81, 148, .25);
  outline-offset: 0;
}
.auth-card .hint { margin-top: 6px; }
.auth-card .form-errors { border-width: 2px; border-left-width: 6px; border-radius: 12px; }

.auth-card .btn-lg {
  margin-top: 6px;
  border-color: var(--green-700);
  box-shadow: 0 5px 0 var(--green-700);
}
.auth-card .btn-lg:hover { box-shadow: 0 5px 0 var(--green-700), 0 10px 22px -8px rgba(31, 122, 53, .6); }
.auth-card .btn-lg:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--green-700); }

.auth-alt { margin: 26px 0 0; padding-top: 18px; border-top: 2px solid var(--purple-100); color: var(--muted); }
.auth-alt a { color: var(--purple-700); font-weight: 800; }
.auth-alt a:hover { color: var(--purple-800); }

/* ==========================================================================
   Elementy: statusy, akordeon, tabele
   ========================================================================== */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  background: var(--purple-100);
  color: var(--purple-700);
}
.badge-pending { background: var(--warn-tint); color: #6b4a00; }
.badge-accepted { background: var(--ok-tint); color: #0f5132; }
.badge-rejected { background: var(--danger-tint); color: #7a1712; }

.acc-item { margin-bottom: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-weight: 700;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.acc-head:hover { background: var(--purple-50); }
.acc-head::after { content: "+"; flex: none; font-size: 1.4rem; line-height: 1; color: var(--purple-600); }
.acc-head[aria-expanded="true"]::after { content: "\2013"; }
.acc-panel { padding: 8px 16px 16px; border-top: 1px solid var(--line); }
.acc-panel[hidden] { display: none; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 700; font-size: .86rem; }

/* ==========================================================================
   Grupy, roboty, konstruktorzy, panel admina (akceptacja / grupy)
   ========================================================================== */
.form-card { max-width: 560px; }
.counter { font-family: var(--font-head); font-weight: 700; color: var(--purple-700); }

.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 10px; }
.group-head h2, .group-head h3 { margin: 0; }

.status-note {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--green-50);
  border-left: 4px solid var(--green-500);
  border-radius: 10px;
}
.status-note.pending { background: var(--warn-tint); border-left-color: #d9a21b; }
.status-note.rejected { background: var(--danger-tint); border-left-color: var(--danger); }

.detail-list { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0 0 18px; }
.detail-list div { padding-left: 10px; border-left: 3px solid var(--green-500); }
.detail-list dt { font-size: .85rem; color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* Rozwijany panel lidera (zielony odpowiednik panelu admina) */
details.panel {
  margin-top: 4px;
  background: var(--green-50);
  border: 1px solid var(--line);
  border-left: 5px solid var(--green-500);
  border-radius: 12px;
}
details.panel > summary { padding: 11px 16px; cursor: pointer; font-weight: 700; color: var(--green-800); }
.panel-body { padding: 4px 16px 16px; }

.inline-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.inline-fields .field { flex: 1 1 240px; margin: 0; }
.inline-fields .btn { flex: none; }
.add-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

.robot-card {
  margin-bottom: 12px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card .robot-card { background: var(--purple-50); }
.robot-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 4px; }
.robot-head .group-head { margin-bottom: 0; }
.robot-card .hint { margin: 6px 0 0; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px 3px 12px;
  background: var(--green-100);
  border-radius: 999px;
  font-size: .93rem;
  font-weight: 600;
}
.chip.static { padding: 4px 12px; }
.chip .btn-sm { min-height: 28px; padding: 1px 10px; border-radius: 999px; font-size: .8rem; }

.builder-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.builder-form select {
  flex: 1 1 220px;
  max-width: 360px;
  padding: 7px 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #a49dbb;
  border-radius: 8px;
}
.builder-form select:focus { outline: 3px solid rgba(68, 193, 90, .4); border-color: var(--green-600); }

.danger-zone { border-color: #eab5b1; }
.danger-zone h2 { color: var(--danger); }

.admin-card { border-left: 5px solid var(--admin); }
.decision-row { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.summary-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 16px; }
.summary-item { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

.acc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.acc-name { font-family: var(--font-head); font-size: 1.08rem; overflow-wrap: anywhere; }
.acc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-left: auto;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
}
.acc-panel h3 { margin: 20px 0 8px; font-size: 1.02rem; }
.acc-panel > .detail-list { margin-top: 12px; }
.card > .detail-list + h3, .card > h3 { margin-top: 20px; }

/* ==========================================================================
   RWD
   ========================================================================== */
@media (max-width: 900px) {
  :root { --header-h: 64px; }

  .menu-toggle { display: inline-block; }
  .hide-m { display: none; }
  .top-sep { display: none; }
  .brand img.logo-wide { max-height: 44px; max-width: min(46vw, 200px); }
  .brand img.logo-icon { width: 38px; height: 38px; }
  .brand span { font-size: 1.25rem; }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 80;
    width: min(86vw, 320px);
    height: auto;
    transform: translateX(-104%);
    transition: transform .22s ease, visibility 0s linear .22s;
    box-shadow: 6px 0 24px rgba(0, 0, 0, .22);
    visibility: hidden;
  }
  .sidebar.open { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }

  .overlay {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 75;
    background: rgba(37, 29, 56, .55);
  }
  .overlay.show { display: block; }

  .mobile-only { display: block; }
  .mobile-user { padding: 6px 14px 10px; font-weight: 700; }
  .nav-button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .content { padding-top: 20px; }
  .hero { border-radius: 16px; border-left-width: 8px; }
  .news-panel { border-radius: 16px; }
  .news-item.has-image { grid-template-columns: 1fr; gap: 14px; }
  .news-media img { aspect-ratio: 16 / 10; }
  .sponsor-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .action-row .btn { flex: 1 1 100%; }
  .auth-card { border-radius: 16px; }
  .auth-icon { width: 52px; height: 52px; border-radius: 14px; }
  .acc-meta { margin-left: 0; width: 100%; }
  .acc-head { flex-wrap: wrap; }
  .decision-row .inline-form, .decision-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .auth-card .btn-lg:active { transform: none; }
}
