/* ==========================================================================
   Rejestracja SDE – style
   Kolor dodatkowych elementów #8fc640, tło #ffffff, czcionka #000000
   ========================================================================== */

:root {
  --accent: #8fc640;
  --accent-dark: #6f9e2c;
  --accent-soft: #eef7e2;
  --accent-ink: #3f6312;
  --bg: #ffffff;
  --text: #000000;
  --muted: #5f6368;
  --faint: #9aa0a6;
  --line: #e3e6e8;
  --surface: #f6f7f5;
  --row-alt: #f7f9f3;
  --danger: #c62828;
  --danger-soft: #fdecea;
  --warning: #8a5a00;
  --warning-soft: #fff4dc;
  --info-soft: #eef4fb;
  --info: #1d4f86;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 24px rgba(0, 0, 0, .06);
  --sidebar: 264px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

body.modal-open { overflow: hidden; }

button, input, textarea, select { font: inherit; color: inherit; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

h1, h2 { line-height: 1.25; }

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

.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.clamp {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 420px;
}

:focus-visible { outline: 3px solid rgba(143, 198, 64, .55); outline-offset: 2px; }

/* --- Ładowanie --------------------------------------------------------- */

.splash { min-height: 100vh; display: grid; place-items: center; }
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { color: var(--muted); padding: 24px 0; }
.empty {
  color: var(--muted); padding: 32px 16px; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius);
}

/* --- Marka ------------------------------------------------------------- */

.brand, .auth-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  flex: none; width: 46px; height: 46px; border-radius: 10px;
  background: var(--accent); color: #000; font-weight: 800; letter-spacing: .5px;
  display: grid; place-items: center; font-size: 15px;
}
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { font-size: 12px; color: var(--muted); line-height: 1.35; }

/* --- Ekrany logowania / rejestracji ------------------------------------ */

.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(circle at 15% 10%, var(--accent-soft) 0, transparent 40%),
    radial-gradient(circle at 90% 95%, var(--accent-soft) 0, transparent 35%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--bg);
  border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}
.auth-brand { margin-bottom: 18px; }
.auth-intro { margin: 0 0 20px; font-size: 15px; }
.auth-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.auth-actions .btn { flex: 1 1 140px; }

/* --- Formularze -------------------------------------------------------- */

.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.field-hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field-hint-ok { color: var(--accent-ink); }
.field-hint-ok::before { content: "✓ "; }
.field-hint-error { color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-narrow { max-width: 260px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], textarea, select {
  width: 100%; padding: 10px 12px; background: var(--bg);
  border: 1px solid #cfd4d8; border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 44px; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(143, 198, 64, .25);
}

input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--accent-dark); cursor: pointer; vertical-align: middle; margin: 0;
}
input[type="checkbox"]:disabled { cursor: progress; opacity: .6; }

.checkbox-field { display: flex; gap: 10px; align-items: center; cursor: pointer; margin: 6px 0 4px; }

.form-actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px;
}

/* --- Przyciski --------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-outline { background: var(--bg); color: #000; border-color: #c7cdd1; }
.btn-outline:hover:not(:disabled) { border-color: var(--accent-dark); background: var(--accent-soft); }
.btn-danger { background: var(--bg); color: var(--danger); border-color: #efc4c0; }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger-solid:hover:not(:disabled) { background: #a51f1f; border-color: #a51f1f; }
.btn-small { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.link-button {
  background: none; border: 0; padding: 4px 0; color: var(--accent-ink); font-weight: 600;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-button:hover { color: #000; }

/* --- Komunikaty -------------------------------------------------------- */

.alert {
  display: flex; align-items: flex-start; gap: 10px; justify-content: space-between;
  padding: 12px 14px; border-radius: 8px; margin: 0 0 16px; border: 1px solid transparent; font-size: 14.5px;
}
.alert-success { background: var(--accent-soft); border-color: #cfe6ae; color: var(--accent-ink); font-weight: 600; }
.alert-error { background: var(--danger-soft); border-color: #f5c6c1; color: #8e1c1c; }
.alert-warning { background: var(--warning-soft); border-color: #f2dca8; color: var(--warning); }
.alert-info { background: var(--info-soft); border-color: #cddcef; color: var(--info); }
.alert-close {
  flex: none; background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .7;
}
.alert-close:hover { opacity: 1; }

.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-ink); margin-left: 6px; vertical-align: middle;
}
.badge-muted { background: var(--surface); color: var(--muted); margin: 0; }

.chip {
  display: inline-block; font-size: 12.5px; padding: 2px 9px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); margin: 2px 4px 2px 0;
}

/* --- Układ aplikacji --------------------------------------------------- */

.layout { min-height: 100vh; }

.topbar { display: none; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  display: flex; flex-direction: column; gap: 18px; padding: 22px 16px;
  background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto; z-index: 30;
}
.sidebar .brand { padding: 0 6px 16px; border-bottom: 1px solid var(--line); }

.menu { display: flex; flex-direction: column; gap: 2px; }
.menu-item {
  display: block; width: 100%; text-align: left; padding: 10px 12px 10px 14px;
  background: none; border: 0; border-left: 4px solid transparent; border-radius: 0 8px 8px 0;
  font-weight: 500; cursor: pointer; color: #000;
}
.menu-item:hover { background: var(--surface); }
.menu-item.active { background: var(--accent-soft); border-left-color: var(--accent); font-weight: 700; }
/* Informacje zwrotne oczekujące na weryfikację – przycisk menu na czerwono */
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.menu-item-alert { background: var(--danger); color: #fff; font-weight: 700; }
.menu-item-alert:hover { background: #a92020; }
.menu-item-alert.active { background: var(--danger); border-left-color: #7f1515; color: #fff; }
.menu-badge {
  min-width: 22px; padding: 1px 7px; border-radius: 99px; background: #fff; color: var(--danger);
  font-size: 12px; font-weight: 700; text-align: center; line-height: 18px;
}

.sidebar-footer { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sidebar-footer .badge { margin: 6px 0 0; }
.user-name { font-weight: 700; }
.user-email { color: var(--muted); font-size: 13px; word-break: break-all; }
.sidebar-actions { display: flex; gap: 16px; margin-top: 8px; }

.menu-overlay { display: none; }

.content { margin-left: var(--sidebar); padding: 28px; }
.card {
  max-width: 1180px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px 30px;
}
.card-title { margin: 0 0 18px; font-size: 22px; padding-bottom: 14px; border-bottom: 3px solid var(--accent); display: inline-block; }
.lead { margin: -4px 0 16px; color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .search { max-width: 320px; margin-left: auto; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; background: #fcfdfb; }
.panel-title { font-size: 16px; margin: 0 0 14px; }

/* --- Tabele ------------------------------------------------------------ */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
  font-weight: 700; background: var(--surface); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th.num { text-align: right; }
.table th.center { text-align: center; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-clickable tbody tr { cursor: pointer; }
/* Naprzemienne tło wierszy we wszystkich zestawieniach panelu administracyjnego */
.table tbody tr:nth-child(odd) { background: var(--bg); }
.table tbody tr:nth-child(even) { background: var(--row-alt); }
.table tbody tr:hover { background: #f3f6ee; }
.table-clickable tbody tr:hover { background: var(--accent-soft); }
.check-col { width: 44px; text-align: center; }
.actions-col { width: 1%; text-align: right; }
.row-inactive td { color: var(--faint); }
.row-top .points { background: var(--accent); }
.points {
  display: inline-block; min-width: 40px; text-align: center; font-weight: 700;
  padding: 2px 8px; border-radius: 6px; background: var(--accent-soft);
}

/* --- Panel użytkownika: rejestracja na wydarzenia ---------------------- */

.event-list, .career-list, .registration-list, .question-list, .answer-list { list-style: none; margin: 0; padding: 0; }

.event-row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  padding: 14px 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px;
  transition: border-color .15s, background-color .15s;
}
.event-row.is-registered { border-color: #cfe6ae; background: #fbfdf7; }
.event-check { display: flex; justify-content: center; }
.checkbox-hit { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; border-radius: 8px; }
.checkbox-hit:hover { background: var(--accent-soft); }
.checkbox-hit input { width: 24px; height: 24px; }
.event-name { font-weight: 700; font-size: 16px; }
.event-desc { font-size: 13.5px; color: var(--muted); margin-top: 2px; white-space: pre-line; }
.event-count { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --- Panel użytkownika: indeks kariery --------------------------------- */

.score {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 18px;
  border-radius: var(--radius); background: var(--accent-soft); border: 1px solid #d7ebbb;
}
.score-value { font-size: 40px; font-weight: 800; line-height: 1; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.score-label { font-weight: 700; line-height: 1.3; }
.score-label .muted { font-weight: 400; font-size: 13px; }

.career-item {
  display: grid; grid-template-columns: 1fr auto 28px; gap: 12px; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 16px;
}
.career-item:last-child { border-bottom: 0; }
.career-points { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.career-tick { font-size: 22px; font-weight: 800; text-align: center; line-height: 1; }
.is-active { color: #000; }
.is-inactive, .is-inactive .career-points { color: var(--faint); }
.is-confirmed, .is-confirmed .career-points { color: var(--accent-dark); font-weight: 700; }
.career-item.is-confirmed .career-tick { color: var(--accent-dark); }
.career-item.career-questionnaire { border-top: 2px solid var(--accent, #8fc640); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 4px; }
.legend-item::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; background: currentColor; vertical-align: 0;
}
.legend-item.is-confirmed::before { display: none; }

/* --- Ankieta ----------------------------------------------------------- */

.question-list { counter-reset: q; }
.question { counter-increment: q; padding: 16px 0 6px; border-bottom: 1px solid var(--line); }
.question-text { font-weight: 700; margin-bottom: 4px; }
.question-list .question-text::before { content: counter(q) ". "; color: var(--accent-dark); }
.question-desc { color: var(--muted); font-size: 13.5px; margin-bottom: 10px; white-space: pre-line; }

.radio-group { display: flex; gap: 10px; margin: 6px 0 12px; flex-wrap: wrap; }
.radio-option {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 18px;
  border: 1px solid #cfd4d8; border-radius: 8px; cursor: pointer; font-weight: 600; user-select: none;
}
.radio-option:hover { border-color: var(--accent-dark); }
.radio-option.checked { border-color: var(--accent-dark); background: var(--accent-soft); }
.radio-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-dark); }

.answer-badge { display: inline-block; min-width: 34px; text-align: center; font-weight: 700; padding: 2px 10px; border-radius: 6px; background: var(--surface); }
.score-1 { background: #fbe3e1; color: #8e1c1c; }
.score-2 { background: #fdebd9; color: #8a4a00; }
.score-3 { background: #fdf3cf; color: #6b5300; }
.score-4 { background: #edf6dc; color: #3f6312; }
.score-5 { background: #d9f0e2; color: #1e6b3d; }

/* Ocena 1–5 w ankiecie */
.rating-group { gap: 8px; margin-bottom: 4px; }
.rating-option { min-width: 56px; justify-content: center; padding: 8px 12px; }
.rating-scale { display: flex; justify-content: space-between; max-width: 312px; margin-bottom: 12px; }

/* Treść Markdown (opisy, regulaminy) */
.markdown { line-height: 1.6; overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown h1 { font-size: 20px; margin: 18px 0 8px; }
.markdown h2 { font-size: 17px; margin: 16px 0 8px; }
.markdown h3 { font-size: 15px; margin: 14px 0 6px; }
.markdown p, .markdown ul, .markdown ol { margin: 0 0 10px; }
.markdown ul, .markdown ol { padding-left: 22px; }
.markdown a { color: var(--accent-ink); }
.markdown blockquote { margin: 0 0 10px; padding: 6px 12px; border-left: 3px solid var(--accent); background: var(--surface); }
.markdown table { border-collapse: collapse; margin-bottom: 10px; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 4px 8px; }
.markdown-terms { padding: 12px 14px; background: var(--surface); border-radius: 8px; font-size: 14px; }
.markdown-preview { margin-top: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: 8px; background: var(--bg); max-height: 360px; overflow-y: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }
.section-heading { font-size: 16px; margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.event-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 6px; font-weight: 600; }
.footer-note { flex-basis: 100%; margin: 0 0 4px; font-size: 13.5px; color: var(--muted); }

/* Akceptacja regulaminu przy rejestracji */
.terms-field { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.terms-link {
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-weight: 600;
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px;
}
.terms-link:hover { color: #000; }

/* Lista wydarzeń: klikalne wiersze i ikona informacji */
.event-row-clickable { cursor: pointer; }
.event-row-clickable:hover { border-color: var(--accent); }
.event-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.info-icon {
  flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--accent-dark); color: var(--accent-dark); font: italic 700 12px/1 Georgia, "Times New Roman", serif;
}

/* Menu: zakładka niedostępna */
.menu-item-disabled { color: var(--faint); cursor: not-allowed; }
.menu-item-disabled:hover { background: none; }

/* Harmonogram */
.schedule-legend { margin: 0 0 14px; }
.schedule-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.schedule-day { margin-bottom: 22px; }
.schedule-day-title {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; font-size: 18px; margin: 0 0 10px;
  padding-bottom: 8px; border-bottom: 2px solid var(--accent);
}
.schedule-day-date { font-size: 14px; font-weight: 500; color: var(--muted); }
.schedule-list { list-style: none; margin: 0; padding: 0; }
.schedule-item {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 10px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.schedule-item:hover { background: var(--accent-soft); }
.schedule-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.schedule-name { font-weight: 700; }
.schedule-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 13.5px; margin-top: 2px; }
.schedule-reg { display: flex; align-items: center; gap: 8px; }
.reg-icon {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 700;
}
.reg-required { background: #fff4dc; color: var(--warning); border: 1px solid #f2dca8; }
.reg-open { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid #cfe6ae; }

.answer-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.answer-list li:last-child { border-bottom: 0; }
.answer { margin-top: 4px; white-space: pre-line; }
.answer-details {
  margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--accent);
  background: var(--surface); font-size: 14px; white-space: pre-line;
}

/* --- Rejestracja wydarzenia (admin) ------------------------------------ */

.registration-item { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.registration-head {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center;
  padding: 14px 16px; background: var(--bg); border: 0; text-align: left; cursor: pointer;
}
.registration-item:nth-child(even) .registration-head { background: var(--row-alt); }
.registration-head:hover, .registration-item:nth-child(even) .registration-head:hover { background: var(--accent-soft); }
.registration-name { font-weight: 700; }
.registration-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.progress { grid-column: 1 / -1; height: 6px; background: var(--surface); border-radius: 99px; overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.progress-bar.full { background: var(--accent-dark); }
.registration-people { padding: 4px 16px 14px; border-top: 1px solid var(--line); background: #fcfdfb; }
.registration-people ol { margin: 10px 0 0; padding-left: 22px; }
.registration-people li { padding: 2px 0; }

/* --- Okno modalne ------------------------------------------------------ */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 100;
  display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--bg); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); border-top: 4px solid var(--accent);
}
.modal-wide { max-width: 780px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; color: var(--muted); }
.modal-close:hover { color: #000; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }

.confirm-message { margin: 0; white-space: pre-line; }

.qr-box { text-align: center; }
.qr-image { width: 280px; max-width: 100%; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; }

/* --- Telefon / tablet -------------------------------------------------- */

@media (max-width: 900px) {
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20;
    height: 56px; padding: 0 12px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .topbar-title { font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-brand {
    background: var(--accent); color: #000; font-weight: 800; font-size: 12px; padding: 4px 8px; border-radius: 6px;
  }
  .menu-toggle {
    width: 44px; height: 44px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; padding: 0;
  }
  .menu-toggle-alert { position: relative; border-color: var(--danger); }
  .menu-toggle-alert::after {
    content: ""; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--danger); border: 2px solid #fff;
  }
  .menu-toggle span { display: block; width: 20px; height: 2px; background: #000; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .sidebar {
    top: 56px; width: min(300px, 86vw); transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: none;
  }
  .menu-open .sidebar { transform: translateX(0); box-shadow: 8px 0 30px rgba(0, 0, 0, .15); }
  .menu-open .menu-overlay { display: block; position: fixed; inset: 56px 0 0 0; background: rgba(0, 0, 0, .35); z-index: 25; }

  .content { margin-left: 0; padding: 12px; }
  .card { padding: 18px 16px 22px; border-radius: 8px; }
  .card-title { display: none; }
  .toolbar .search { max-width: none; margin-left: 0; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .auth-card { padding: 22px 18px; }
  .toolbar .btn { flex: 1 1 auto; }

  .event-row { grid-template-columns: 44px 1fr; padding: 12px 10px; gap: 6px 10px; }
  .schedule-item { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .schedule-time { grid-column: 1 / -1; font-size: 13.5px; color: var(--accent-ink); }
  .rating-option { min-width: 0; flex: 1 1 0; }
  .rating-scale { max-width: none; }
  .event-count { grid-column: 2; font-size: 13px; color: var(--muted); }
  .event-count::before { content: "Zapisani: "; font-weight: 400; }

  /* Tabele jako karty */
  .table-wrap { border: 0; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    position: relative; border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 10px; padding: 8px 12px; background: var(--bg);
  }
  .table td { border: 0; padding: 4px 0; text-align: left; }
  .table td.num, .table td.center { text-align: left; }
  .table td[data-label]::before {
    content: attr(data-label); display: block; font-size: 11.5px; text-transform: uppercase;
    letter-spacing: .4px; color: var(--muted); font-weight: 700;
  }
  .table td.check-col { position: absolute; top: 10px; right: 10px; width: auto; padding: 0; }
  .table td.actions-col { width: auto; text-align: left; padding-top: 8px; }
  .table td[data-label="Aktywny"], .table td[data-label="Zmiana hasła"] {
    display: inline-flex; flex-direction: column; width: auto; margin-right: 24px; gap: 4px;
  }
  .table tbody tr:nth-child(even), .table tbody tr:nth-child(even):hover { background: var(--row-alt); }
  .table tbody tr:nth-child(odd):hover { background: var(--bg); }

  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal { max-width: none; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .modal-footer .btn { flex: 1 1 auto; }
}

@media print {
  .sidebar, .topbar, .toolbar, .menu-overlay { display: none !important; }
  .content { margin: 0; padding: 0; }
  .card { box-shadow: none; border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- Raport PDF wyników ankiety (renderowany poza ekranem) ------------- */

.report-host { position: absolute; left: -10000px; top: 0; }
.report {
  width: 718px; /* szerokość A4 (210 mm) minus marginesy 2 × 10 mm przy 96 dpi */
  padding: 8px 4px; background: #ffffff; color: #000000;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 12px; line-height: 1.45;
}
.report-header { margin-bottom: 18px; }
.report-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: #3f6312; }
.report-mark { background: #8fc640; color: #000; font-weight: 800; font-size: 11px; padding: 3px 7px; border-radius: 5px; }
.report h1 { font-size: 26px; margin: 12px 0 4px; }
.report-meta { margin: 0; color: #5f6368; }
.report-empty { color: #5f6368; }
.rq-block { padding: 14px 0 18px; border-top: 1px solid #e3e6e8; }
.rq-title { font-size: 15px; margin: 0 0 2px; }
.rq-desc { margin: 0 0 2px; color: #5f6368; }
.rq-count { margin: 0 0 12px; font-size: 11px; color: #5f6368; }
.rq-row { display: flex; gap: 22px; align-items: stretch; margin-bottom: 12px; }
.rq-average {
  flex: none; width: 170px; border: 1px solid #e3e6e8; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px;
}
.rq-average-label { font-size: 16px; font-weight: 700; }
.rq-average-value { background: #8fc640; color: #ffffff; font-size: 24px; font-weight: 800; padding: 6px 14px; border-radius: 6px; }
.rq-chart { flex: 1; }
.rq-plot { position: relative; height: 150px; margin-left: 36px; }
.rq-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid #d5d8da; }
.rq-grid span { position: absolute; left: -36px; top: -7px; width: 30px; text-align: right; font-size: 9px; color: #5f6368; }
.rq-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-around; }
.rq-bar-col { width: 13%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.rq-bar { position: relative; width: 100%; border-radius: 3px 3px 0 0; min-height: 0; }
.rq-bar-label { position: absolute; top: -15px; left: 0; right: 0; text-align: center; font-size: 9.5px; color: #333; }
.rq-axis { display: flex; justify-content: space-around; margin-left: 36px; padding-top: 4px; font-size: 10px; color: #5f6368; }
.rq-table, .rq-details { width: 100%; border-collapse: collapse; font-size: 11px; }
.rq-details { table-layout: fixed; }
.rq-table th, .rq-details th { background: #eef0f1; text-align: left; font-weight: 700; padding: 6px 8px; }
.rq-table td { text-align: right; padding: 6px 8px; border-bottom: 1px solid #e3e6e8; }
.rq-table th:not(:first-child) { text-align: right; }
.rq-avg-cell { font-weight: 700; font-size: 13px; }
.rq-sub { font-size: 9px; color: #9aa0a6; }
.rq-details-title { font-size: 12.5px; margin: 14px 0 6px; }
.rq-details td { padding: 5px 8px; border-bottom: 1px solid #e3e6e8; vertical-align: top; }
.rq-lp { width: 36px; color: #5f6368; }
.rq-score { width: 52px; text-align: center !important; font-weight: 700; }
.rq-none { color: #9aa0a6; margin: 0; }
.report-footer { margin-top: 16px; padding-top: 8px; border-top: 1px solid #e3e6e8; font-size: 10px; color: #9aa0a6; text-align: right; }

/* --- Zmiany 27.10.2026: grupy wydarzeń, ograniczenia, klonowanie ------- */

/* Wydarzenie niedostępne do zapisu (limit, inna uczelnia / wydział, inne wydarzenie z grupy) */
.event-row.is-unavailable { background: var(--surface); }
.event-row.is-unavailable .event-name,
.event-row.is-unavailable .event-count { color: var(--muted); }

/* Rejestracja wstrzymana przez administratora (isActive = 0) – kolor niebieski */
.event-row.is-inactive { border-color: #9cc3ef; background: #eef5fd; }
.event-row.is-inactive .event-name,
.event-row.is-inactive .event-count { color: #1a5fb4; }
.event-row.is-inactive .badge-muted { background: #d7e7fa; color: #1a5fb4; }
.event-soon {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px;
  background: #d7e7fa; color: #1a5fb4; font-size: 12.5px; font-weight: 600; vertical-align: middle;
}
.row-event-inactive td:first-child { box-shadow: inset 3px 0 0 #1a5fb4; }
.row-event-inactive .strong { color: #1a5fb4; }
.event-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.event-tag {
  display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.4;
  padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
}
.event-tag-muted { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }

/* Harmonogram: wydarzenia, na które użytkownik jest zapisany – półprzezroczyste czerwone tło */
.schedule-item.is-registered { background: rgba(220, 38, 38, 0.14); }
.schedule-item.is-registered:hover { background: rgba(220, 38, 38, 0.22); }
.legend-swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px;
}
.legend-registered { background: rgba(220, 38, 38, 0.14); border: 1px solid rgba(220, 38, 38, 0.35); }

/* Listy z zaznaczaniem (klonowanie) */
.toolbar .selection-info { align-self: center; }
.table tr.row-selected td { background: var(--accent-soft); }
/* Informacje zwrotne: wiersz oczekujący na weryfikację (feedbackStatus = 0) pogrubiony */
.table tr.row-pending td, .table tr.row-pending td .feedback-text { font-weight: 700; }

/* Rejestracja wydarzenia: lista uczestników z usuwaniem */
.people-list { list-style: none; margin: 0; padding: 0; }
.people-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.people-list li:last-child { border-bottom: 0; }
.people-list li:nth-child(even) { background: var(--row-alt); }
.people-list li { padding-left: 6px; padding-right: 6px; }
.people-name { font-weight: 600; }

/* --- Informacje zwrotne ------------------------------------------------ */

.event-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.feedback-cell { display: flex; align-items: center; gap: 6px; }
.fb-icon {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: 13px; font-weight: 800; line-height: 1; flex: none;
}
.fb-pending  { background: #eceeef; color: #6b7177; border: 1px solid #d5d9dc; }
.fb-accepted { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid #cfe6ae; }
.fb-rejected { background: #fdecec; color: #b42318; border: 1px solid #f5c2c0; }
.feedback-status-line { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 12px; }
.feedback-status-line.fb-pending, .feedback-status-line.fb-accepted, .feedback-status-line.fb-rejected {
  width: auto; height: auto; border-radius: var(--radius); padding: 8px 12px; display: flex;
}
.feedback-text { white-space: pre-line; max-width: 46ch; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; font-weight: 600; }

@media (max-width: 640px) {
  .event-side { grid-column: 2; align-items: flex-start; }
}

/* --- Filtrowanie i sortowanie list w panelu administracyjnym ----------- */

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.filter-bar .filter-input { flex: 1 1 260px; max-width: 420px; }
.th-sort {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; font-weight: inherit;
}
.th-sort:hover { color: var(--accent-ink); }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sort-arrow { font-size: 11px; color: var(--muted); min-width: 10px; }
.th-sort.sorted .sort-arrow { color: var(--accent-ink); }
.registration-sortbar { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; font-size: 13px; color: var(--muted); }
