/* =========================================================
   sprawdz-sie.pl – panel nauczyciela (bloki)
   Korzysta ze zmiennych z app.css (--green, --ink, --border …)
   ========================================================= */

.tp { background: var(--tint); padding: 32px 0 72px; min-height: 70vh; }
.tp-wrap { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .tp-wrap { grid-template-columns: 240px minmax(0, 1fr); align-items: start; } }

/* ---------- Boczne menu ---------- */
.tp-side { background: #FFF; border-radius: var(--radius-lg); padding: 18px; border: 1px solid var(--border); }
@media (min-width: 1000px) { .tp-side { position: sticky; top: 96px; } }
.tp-side__who { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.tp-avatar {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
}
.tp-side__name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.tp-side__role { font-size: 13px; color: var(--muted); }
.tp-nav { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 999px) { .tp-nav { flex-direction: row; flex-wrap: wrap; } }
.tp-nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 600; font-size: 15px; text-decoration: none;
}
.tp-nav a:hover { background: var(--surface); color: var(--ink); }
.tp-nav a[aria-current="page"] { background: var(--green-soft); color: var(--green); }
.tp-nav__count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--green); color: #FFF; font-size: 12px; text-align: center; }
.tp-nav__soon { font-size: 11px; font-weight: 600; color: var(--muted); }

/* ---------- Bloki ---------- */
.tp-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tp-block { background: #FFF; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 28px; min-width: 0; }
.tp-block--green { background: var(--green); border-color: var(--green); color: #FFF; }
.tp-block--green h2, .tp-block--green h3 { color: #FFF; }
.tp-block--soft { background: var(--green-soft); border-color: transparent; }
.tp-block--dashed { background: transparent; border: 1px dashed #CDD2CC; }
.tp-grid { display: grid; gap: 20px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.tp-grid > * { grid-column: span 12; }
@media (min-width: 900px) {
  .tp-span-4 { grid-column: span 4 !important; }
  .tp-span-5 { grid-column: span 5 !important; }
  .tp-span-6 { grid-column: span 6 !important; }
  .tp-span-7 { grid-column: span 7 !important; }
  .tp-span-8 { grid-column: span 8 !important; }
}

.tp-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.tp-head--page { margin-bottom: 0; }
.tp-title { margin: 0; font-weight: 800; font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -0.6px; line-height: 1.2; }
.tp-h2 { margin: 0; font-weight: 800; font-size: 20px; letter-spacing: -0.3px; }
.tp-lead { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.tp-muted { color: var(--muted); font-size: 14px; }
.tp-crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.tp-crumbs a { color: var(--muted); text-decoration: none; }
.tp-crumbs a:hover { color: var(--green); text-decoration: underline; }
.tp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tp-actions form { margin: 0; }

/* ---------- Liczniki ---------- */
.tp-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tp-stat { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); }
a.tp-stat:hover { background: var(--green-soft); }
.tp-stat__num { display: block; font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -1px; line-height: 1.1; }
.tp-stat__label { font-size: 14px; color: var(--text-2); }

/* ---------- Listy ---------- */
.tp-list { list-style: none; margin: 0; padding: 0; }
.tp-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.tp-row:last-child { border-bottom: 0; }
.tp-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.tp-row__title { font-weight: 700; color: var(--ink); text-decoration: none; }
a.tp-row__title:hover { color: var(--green); }
.tp-row__meta { font-size: 14px; color: var(--muted); }

.tp-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tp-card {
  display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); color: var(--ink); text-decoration: none; min-width: 0;
}
a.tp-card:hover { background: var(--green-soft); }
.tp-card__num { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -1px; color: var(--green); }
.tp-card__title { font-family: var(--font-display); font-weight: 800; font-size: 19px; line-height: 1.25; }
.tp-card__meta { font-size: 14px; color: var(--text-2); }

.tp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface); color: var(--text-2); white-space: nowrap; }
.tp-chip--green { background: var(--green-soft); color: var(--green); }
.tp-chip--warn { background: var(--premium-bg); color: var(--premium-fg); }
.tp-chip--red { background: #FBE9E7; color: var(--danger); }

.tp-progress { height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; min-width: 120px; }
.tp-progress > span { display: block; height: 100%; background: var(--green); border-radius: 999px; }

/* ---------- Formularze ---------- */
.tp-form { display: flex; flex-direction: column; gap: 4px; }
.tp-form .field { margin-bottom: 14px; }
.tp-form textarea.field-input { min-height: 120px; padding-top: 12px; resize: vertical; line-height: 1.5; }
.tp-form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .tp-form-grid { grid-template-columns: 1fr 1fr; } .tp-form-grid .tp-full { grid-column: 1 / -1; } }
.tp-hint { font-size: 13px; color: var(--muted); }
.tp-fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.tp-fieldset legend { font-weight: 700; font-size: 15px; margin-bottom: 10px; padding: 0; }
.tp-radio { display: flex; flex-direction: column; gap: 8px; }
.tp-radio label {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #FFF; cursor: pointer;
}
.tp-radio label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.tp-radio input { margin-top: 3px; accent-color: var(--green); width: 18px; height: 18px; flex: none; }
.tp-radio strong { display: block; font-size: 15px; }
.tp-radio span { font-size: 14px; color: var(--text-2); }

.tp-subjects { display: flex; flex-direction: column; gap: 8px; }
.tp-subject {
  display: grid; gap: 8px 12px; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface); grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 720px) { .tp-subject { grid-template-columns: minmax(0, 1fr) 150px 20px 150px; } }
.tp-subject label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.tp-subject input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
.tp-subject select { min-height: 40px !important; padding: 6px 34px 6px 12px; font-size: 14px; }
.tp-subject__dash { text-align: center; color: var(--muted); }

.tp-danger { border-color: #F1D0CC; }
.tp-danger .tp-h2 { color: var(--danger); }
.btn--danger { background: #FFF; border-color: #E8B4AE; color: var(--danger); }
.btn--danger:hover { background: #FBE9E7; color: var(--danger); }

/* ---------- Tabela wyników ---------- */
.tp-scroll { overflow-x: auto; margin: 0 -28px; padding: 0 28px; }
.tp-results { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 560px; font-size: 14px; }
.tp-results th, .tp-results td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; }
.tp-results thead th { font-weight: 700; color: var(--text-2); background: #FFF; vertical-align: bottom; }
.tp-results th:first-child, .tp-results td:first-child { text-align: left; position: sticky; left: 0; background: #FFF; z-index: 1; min-width: 150px; }
.tp-results tbody tr:hover td { background: #FAFBF9; }
.tp-results tfoot td { font-weight: 700; background: var(--surface); }
.tp-results tfoot td:first-child { background: var(--surface); }
.tp-ws-head { display: flex; flex-direction: column; gap: 6px; align-items: center; max-width: 150px; margin: 0 auto; }
.tp-ws-head a { color: var(--ink); text-decoration: none; font-size: 13px; line-height: 1.3; }
.tp-ws-head a:hover { color: var(--green); }
.tp-cell { display: inline-flex; align-items: center; gap: 6px; }
.tp-num {
  width: 58px; min-height: 36px; padding: 4px 6px; text-align: center;
  font: inherit; font-size: 15px; border: 1px solid #D6DAD5; border-radius: 8px; background: #FFF; color: var(--ink);
}
.tp-num:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.tp-num--max { width: 64px; background: var(--surface); }
.tp-cell input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
.tp-sum { font-weight: 700; white-space: nowrap; }
.tp-pct { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.tp-sticky-save {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 12px; align-items: center;
  margin: 16px -28px -28px; padding: 14px 28px; background: rgba(255,255,255,.96);
  border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.tp-form > .tp-sticky-save { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); }
@media (max-width: 720px) { .tp-sticky-save { margin: 16px -20px -20px; padding: 12px 20px; } }

/* ---------- Wybór kart ---------- */
.tp-filters { display: grid; gap: 10px; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 900px) { .tp-filters { grid-template-columns: minmax(0, 2fr) 1fr 1fr auto; } }
.tp-filters .field { margin: 0; }
.tp-pick { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: #FFF; cursor: pointer; }
.tp-pick:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.tp-pick input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.tp-pick__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tp-pick__title { font-weight: 700; }
.tp-pick__meta { font-size: 13px; color: var(--muted); }
.tp-pick--in { opacity: .6; cursor: default; }
.tp-picks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ---------- Zapytania ---------- */
.tp-inquiry { padding: 18px 0; border-bottom: 1px solid var(--border); }
.tp-inquiry:last-child { border-bottom: 0; }
.tp-inquiry__msg { margin: 8px 0 10px; white-space: pre-line; color: var(--text-2); }

/* ---------- Korepetytorzy (publiczne) ---------- */
.tutor-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tutor-card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--radius-lg); background: #FFF; border: 1px solid var(--border); color: var(--ink); text-decoration: none; }
.tutor-card:hover { border-color: var(--green); }
.tutor-card__name { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.3px; }
.tutor-card__headline { color: var(--text-2); font-size: 15px; }
.tutor-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tutor-card__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }

@media (max-width: 720px) {
  .tp { padding-top: 16px; }
  .tp-block { padding: 20px; }
  .tp-scroll { margin: 0 -20px; padding: 0 20px; }
}

@media print {
  .site-header, .site-footer, .tp-side, .tp-actions, .tp-sticky-save, .tp-no-print { display: none !important; }
  .tp { background: #FFF; padding: 0; }
  .tp-wrap { display: block; }
  .tp-block { border: 0; padding: 0; }
}

/* ---------- v2: zdjęcia, statusy, zakładki, notatki ---------- */
.tp-photo { width: 96px; height: 96px; border-radius: 20px; object-fit: cover; background: var(--surface); flex: none; display: block; }
.tp-photo--lg { width: 180px; height: 180px; border-radius: 24px; }
.tp-photo--sm { width: 44px; height: 44px; border-radius: 12px; }
.tp-photo-empty {
  width: 96px; height: 96px; border-radius: 20px; flex: none; background: var(--surface); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 28px;
}
.tp-photo-field { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.tp-photo-field input[type="file"] { font: inherit; font-size: 14px; }

.tp-banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); }
.tp-banner strong { display: block; font-size: 15px; }
.tp-banner p { margin: 4px 0 0; font-size: 14px; color: var(--text-2); }
.tp-banner--ok { background: var(--green-soft); }
.tp-banner--ok strong { color: var(--green); }
.tp-banner--warn { background: var(--premium-bg); }
.tp-banner--warn strong { color: var(--premium-fg); }
.tp-banner--error { background: #FBE9E7; }
.tp-banner--error strong { color: var(--danger); }
.tp-banner__dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; margin-top: 6px; flex: none; }

.tp-tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface); padding: 4px; border-radius: 12px; }
.tp-tabs a { padding: 9px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--text-2); text-decoration: none; }
.tp-tabs a[aria-current="page"] { background: #FFF; color: var(--ink); box-shadow: var(--shadow-sm); }
.tp-tabs__count { margin-left: 4px; color: var(--muted); font-weight: 500; }

.tp-lesson { position: relative; padding: 0 0 22px 26px; border-left: 2px solid var(--border); margin-left: 6px; }
.tp-lesson:last-child { padding-bottom: 0; }
.tp-lesson::before { content: ''; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); border: 2px solid #FFF; }
.tp-lesson__date { font-size: 13px; font-weight: 600; color: var(--muted); }
.tp-lesson__topic { font-family: var(--font-display); font-weight: 800; font-size: 17px; margin: 2px 0 6px; }
.tp-lesson__text { margin: 0; white-space: pre-line; color: var(--text-2); font-size: 15px; }
.tp-lesson__hw { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--green-soft); font-size: 14px; white-space: pre-line; }
.tp-lesson details { margin-top: 8px; }
.tp-lesson summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--green); }

.tp-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 15px; }
.tp-kv dt { color: var(--muted); }
.tp-kv dd { margin: 0; overflow-wrap: anywhere; }

.tp-ws-row { display: grid; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--border); grid-template-columns: minmax(0, 1fr); }
.tp-ws-row:last-child { border-bottom: 0; }
@media (min-width: 900px) { .tp-ws-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.tp-ws-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.tp-ws-form select, .tp-ws-form .field-input { min-height: 38px !important; padding: 6px 30px 6px 10px; font-size: 14px; }
.tp-note-form { display: flex; gap: 8px; margin: 8px 0 0; }
.tp-note-form .field-input { min-height: 38px; padding: 6px 12px; font-size: 14px; flex: 1 1 auto; }
.tp-note { font-size: 14px; color: var(--text-2); background: #FFFBEA; border-radius: 8px; padding: 6px 10px; margin-top: 6px; white-space: pre-line; }

/* pola nie mogą wychodzić poza blok */
.tp-form-grid { min-width: 0; }
.tp-form-grid > * { min-width: 0; }
.tp-form .field-input { width: 100%; max-width: 100%; }
.tp-ws-form .field-input, .tp-note-form .field-input, .tp-filters .field-input { width: auto; }
.tp-filters .field-input { width: 100%; }

/* =========================================================
   Etap 1: kalendarz, rezerwacje, materiały, rozliczenia
   ========================================================= */
.tp-wide { max-width: none; }
.tp-toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; }
.tp-toolbar__left, .tp-toolbar__right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tp-iconbtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: #FFF; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: var(--ink); text-decoration: none; }
.tp-iconbtn:hover { border-color: var(--green); color: var(--green); }
.tp-week-title { margin: 0 0 0 6px; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.3px; }

.tp-cal-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1360px) { .tp-cal-layout { grid-template-columns: minmax(0, 1fr) 300px; } }

.tp-cal-scroll { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.tp-cal { display: grid; grid-template-columns: 48px repeat(7, minmax(92px, 1fr)); min-width: 720px; }
.tp-cal__head { text-align: center; padding: 6px 0 10px; color: var(--text-2); text-decoration: none; display: block; border-radius: 10px; }
.tp-cal__head:hover { background: var(--surface); color: var(--ink); }
.tp-cal__dow { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.tp-cal__dom { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--ink); }
.tp-cal__head.is-today .tp-cal__dom { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%; background: var(--green); color: #FFF; }
.tp-cal__hours { position: relative; }
.tp-cal__hour { position: absolute; right: 8px; font-size: 11px; color: #8E9590; transform: translateY(-7px); }
.tp-cal__day { position: relative; border-left: 1px solid #EEF0EC; background-image: linear-gradient(#EEF0EC 1px, transparent 1px); background-size: 100% var(--hour); }
.tp-cal__day.is-off { background-color: #FAFAF8; background-image: repeating-linear-gradient(135deg, transparent 0 8px, #F0F1EE 8px 9px), linear-gradient(#EEF0EC 1px, transparent 1px); background-size: auto, 100% var(--hour); }
.tp-cal__avail { position: absolute; left: 0; right: 0; background: rgba(207, 230, 214, .38); }
.tp-cal__add { position: absolute; inset: 0; display: block; }
.tp-ev {
  position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 7px; box-sizing: border-box; overflow: hidden;
  color: #FFF; text-decoration: none; font-size: 12px; line-height: 1.3; z-index: 2; transition: box-shadow .15s;
}
.tp-ev:hover { color: #FFF; box-shadow: 0 4px 12px rgba(20,33,28,.22); }
.tp-ev strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-ev span { display: block; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-ev.is-cancelled { opacity: .45; text-decoration: line-through; }
.tp-ev.is-selected { outline: 3px solid var(--ink); outline-offset: 1px; }
.tp-ev--booking { background: var(--premium-bg) !important; color: var(--premium-fg); border: 1.5px dashed #C9962E; }
.tp-ev--booking:hover { color: var(--premium-fg); }
.tp-ev__paid { position: absolute; top: 4px; right: 6px; font-size: 11px; }
.tp-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; }
.tp-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.tp-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--text-2); margin-top: 14px; }
.tp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tp-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

.tp-agenda-day { padding: 14px 0; border-bottom: 1px solid var(--border); }
.tp-agenda-day:last-child { border-bottom: 0; }
.tp-agenda-day h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--text-2); font-family: var(--font-body); }
.tp-agenda-item { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.tp-agenda-item:hover { background: var(--surface); color: var(--ink); }
.tp-agenda-item__bar { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.tp-agenda-item__time { width: 92px; flex: none; font-weight: 700; font-size: 14px; }

.tp-panel { position: sticky; top: 96px; }
.tp-panel h2 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.4px; }
.tp-mat-link { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); text-decoration: none; color: var(--ink); font-size: 14px; }
.tp-mat-link:hover { border-color: var(--green); color: var(--ink); }
.tp-badge { font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 6px; flex: none; letter-spacing: .2px; }
.tp-badge--PDF { background: #FBE9E7; color: #B3261E; }
.tp-badge--IMG, .tp-badge--DOC, .tp-badge--XLS, .tp-badge--PPT { background: #E8EEF6; color: #204D90; }
.tp-badge--LINK { background: var(--green-soft); color: var(--green); }
.tp-badge--NOTATKA { background: var(--premium-bg); color: var(--premium-fg); }
.tp-badge--other { background: var(--surface); color: var(--text-2); }

/* Dostępność */
.tp-avail-row { display: grid; gap: 10px 14px; padding: 14px 0; border-bottom: 1px solid var(--border); grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 900px) { .tp-avail-row { grid-template-columns: 140px minmax(0, 1fr); } }
.tp-avail-day { font-weight: 700; }
.tp-avail-ranges { display: flex; flex-wrap: wrap; gap: 10px; }
.tp-range { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--surface); }
.tp-range input { font: inherit; font-size: 14px; width: 92px; padding: 6px 8px; border: 1px solid #D6DAD5; border-radius: 8px; background: #FFF; }
.tp-switch { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; }
.tp-switch input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }

/* Sloty (profil publiczny) */
.tp-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tp-slots__day { display: flex; flex-direction: column; gap: 6px; }
.tp-slots__head { text-align: center; font-size: 13px; font-weight: 600; color: var(--text-2); line-height: 1.3; margin-bottom: 2px; }
.tp-slots__head strong { display: block; font-family: var(--font-display); font-size: 16px; color: var(--ink); }
.tp-slot { display: block; text-align: center; padding: 9px 0; border-radius: 10px; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 14px; text-decoration: none; border: 1px solid var(--green-soft); }
.tp-slot:hover { border-color: var(--green); color: var(--green); }
.tp-slot.is-chosen { background: var(--green); border-color: var(--green); color: #FFF; }
.tp-slots__none { text-align: center; font-size: 13px; color: #8E9590; padding: 8px 0; }

/* Materiały */
.tp-mat-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 760px) { .tp-mat-layout { grid-template-columns: 200px minmax(0, 1fr); } .tp-mat-layout > .tp-panel { grid-column: 1 / -1; position: static; } }
@media (min-width: 1360px) { .tp-mat-layout { grid-template-columns: 200px minmax(0, 1fr) 290px; } .tp-mat-layout > .tp-panel { grid-column: auto; position: sticky; } }
.tp-folders { display: flex; flex-direction: column; gap: 2px; }
.tp-folders a { display: flex; justify-content: space-between; padding: 9px 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.tp-folders a:hover { background: var(--surface); color: var(--ink); }
.tp-folders a[aria-current="page"] { background: var(--green-soft); color: var(--green); }
.tp-folders__label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 12px 10px 6px; }
.tp-mat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tp-mat {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; border: 1px solid var(--border);
  background: #FFF; color: var(--ink); text-decoration: none; min-height: 128px;
}
.tp-mat:hover { border-color: var(--green); color: var(--ink); }
.tp-mat.is-selected { border: 2px solid var(--green); background: #FAFBF9; }
.tp-mat__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tp-mat__title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.tp-mat__meta { font-size: 13px; color: var(--muted); margin-top: auto; }
.tp-add-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tp-add-tabs label { cursor: pointer; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; background: var(--surface); }
.tp-add-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.tp-add-tabs label:has(input:checked) { background: var(--green); color: #FFF; }
.tp-add-panel { display: none; }
.tp-add:has(#add-file:checked) .tp-add-panel--file,
.tp-add:has(#add-link:checked) .tp-add-panel--link,
.tp-add:has(#add-note:checked) .tp-add-panel--note { display: block; }
.tp-quota { height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.tp-quota span { display: block; height: 100%; background: var(--green); }

/* Rozliczenia */
.tp-money { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.6px; }
.tp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tp-table th, .tp-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.tp-table th { font-size: 13px; color: var(--muted); font-weight: 600; }
.tp-table td.num, .tp-table th.num { text-align: right; white-space: nowrap; }
.tp-table form { margin: 0; }
.tp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.tp-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-colors label { cursor: pointer; }
.tp-colors input { position: absolute; opacity: 0; pointer-events: none; }
.tp-colors span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid #FFF; box-shadow: 0 0 0 1px var(--border); }
.tp-colors input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.tp-colors input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }
.tp-chip--muted { background: var(--surface); color: var(--muted); }
.tp-empty { color: var(--muted); padding: 18px 0; margin: 0; }
.tp-empty a { color: var(--green); font-weight: 600; }
.tp-cal__add:hover { background: rgba(19, 92, 67, .06); }
.tp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Panel jest narzędziem pracy – szerszy niż strony katalogu */
.tp > .container.tp-wrap { max-width: 1520px; }

/* =========================================================
   Powłoka panelu – niezależna od nawigacji serwisu
   ========================================================= */
body.tpx { background: var(--tint); min-height: 100vh; }
.tpx-menu-toggle { position: absolute; opacity: 0; pointer-events: none; }

.tpx-side {
  position: fixed; inset: 0 auto 0 0; width: 256px; z-index: 40;
  display: flex; flex-direction: column; gap: 10px;
  background: #FFF; border-right: 1px solid var(--border); padding: 18px 14px; overflow-y: auto;
}
.tpx-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none; color: var(--ink); }
.tpx-brand strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.3px; line-height: 1.1; }
.tpx-brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.tpx-nav { display: flex; flex-direction: column; gap: 2px; }
.tpx-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 600; font-size: 15px; text-decoration: none;
}
.tpx-nav a svg { flex: none; color: #8A928D; }
.tpx-nav a span:first-of-type { flex: 1; }
.tpx-nav a:hover { background: var(--surface); color: var(--ink); }
.tpx-nav a[aria-current="page"] { background: var(--green-soft); color: var(--green); }
.tpx-nav a[aria-current="page"] svg { color: var(--green); }
.tpx-side__foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.tpx-who { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); margin-bottom: 4px; }
.tpx-who:hover { background: var(--surface); }
.tpx-foot-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: var(--radius-sm); text-align: left;
}
.tpx-foot-link:hover { background: var(--surface); color: var(--ink); }
.tpx-side__foot form { margin: 0; }

.tpx-body { min-width: 0; }
.tpx-top {
  position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: rgba(246, 247, 245, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.tpx-top__brand, .tpx-burger { display: none; }
.tpx-top__date { font-size: 14px; font-weight: 600; color: var(--muted); }
.tpx-top__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tpx-top__actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.tpx-pill { padding: 7px 12px; border-radius: 999px; background: var(--premium-bg); color: var(--premium-fg); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.tpx-main { padding: 24px 28px 64px; max-width: 1560px; }
.tpx-flash { padding: 12px 18px; border-radius: var(--radius); background: var(--green-soft); color: var(--green); font-weight: 600; }
.tpx .tp-panel { top: 84px; }
.tpx-scrim, .tpx-tabbar { display: none; }

@media (min-width: 1000px) {
  .tpx-body { margin-left: 256px; }
}
@media (max-width: 999px) {
  .tpx-side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(20,33,28,.18); width: 280px; }
  .tpx-menu-toggle:checked ~ .tpx-side { transform: none; }
  .tpx-menu-toggle:checked ~ .tpx-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(20,33,28,.35); }
  .tpx-top { padding: 0 16px; height: 58px; }
  .tpx-burger { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 10px; cursor: pointer; margin-left: -8px; }
  .tpx-top__brand { display: inline-flex; }
  .tpx-top__date { display: none; }
  .tpx-main { padding: 16px 14px 96px; }
  .tpx .tp-block { padding: 20px; }
  .tpx-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #FFF; border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tpx-tabbar a, .tpx-tabbar label {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
    font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; cursor: pointer;
  }
  .tpx-tabbar a[aria-current="page"] { color: var(--green); }
  .tpx-dot { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #FFF; font-size: 10px; font-style: normal; line-height: 17px; text-align: center; }
  .tpx-hide-sm { display: none !important; }
}
@media (max-width: 420px) { .tpx-hide-xs { display: none; } }

/* Katalog: karta z najbliższymi terminami (cała karta klikalna, godziny osobno) */
.tutor-card { position: relative; }
.tutor-card__link { color: var(--ink); text-decoration: none; }
.tutor-card__link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.tutor-card__slots { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--radius); background: var(--tint); }
.tutor-card__when { font-size: 13px; font-weight: 600; color: var(--text-2); }
.tutor-card__times { display: flex; flex-wrap: wrap; gap: 6px; }
.tutor-card__times .tp-slot { padding: 7px 12px; background: #FFF; border-color: var(--border); }
.tutor-card__times .tp-slot:hover { border-color: var(--green); }
.tutor-card:has(.tutor-card__link:hover) { border-color: var(--green); }
.tp-booked-check { display: inline-flex; width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #FFF; font-size: 32px; font-weight: 800; align-items: center; justify-content: center; }
.tp-steps { margin: 14px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); }
.tp-steps strong { color: var(--ink); }
.tp-plesson { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.tp-plesson:last-child { border-bottom: 0; }
.tp-plesson__date { text-align: center; border-radius: 14px; background: var(--green-soft); color: var(--green); padding: 8px 0; align-self: start; }
.tp-plesson__date strong { display: block; font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.tp-plesson__date span { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.tp-plesson__title { font-weight: 700; font-size: 17px; }

/* Gwiazdki */
.tp-stars { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.tp-stars__bg { position: relative; display: inline-block; color: #D9DDD8; font-size: var(--size); letter-spacing: 1px; line-height: 1; }
.tp-stars__fg { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: #E0A526; }
.tp-stars__count { color: var(--muted); }

/* Katalog: jeden korepetytor w wierszu */
.tutor-list { display: flex; flex-direction: column; gap: 12px; }
.tutor-row {
  position: relative; display: grid; gap: 14px 24px; align-items: center;
  grid-template-columns: 88px minmax(0, 1fr);
  padding: 20px 22px; background: #FFF; border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.tutor-row:has(.tutor-card__link:hover) { border-color: var(--green); }
.tutor-row__photo { width: 88px; height: 88px; border-radius: 18px; object-fit: cover; background: var(--surface); grid-row: span 3; align-self: start; }
.tutor-row__name { margin: 0 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.3px; }
.tutor-row__subjects { margin-top: 6px; font-size: 14px; color: var(--text-2); }
.tutor-row__headline { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.tutor-row__avail, .tutor-row__price { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.tutor-row__state { font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.tutor-row__state::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.tutor-row__state--ok { color: var(--green); }
.tutor-row__state--later { color: var(--premium-fg); }
.tutor-row__state--none { color: var(--muted); }
.tutor-row__avail .tutor-card__times { margin-top: 6px; }
.tutor-row__avail .tp-slot { padding: 6px 11px; background: var(--green-soft); }
.tutor-row__amount { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.5px; line-height: 1.1; }
.tutor-row__cta { margin-top: 8px; align-self: flex-start; }
@media (min-width: 900px) {
  .tutor-row { grid-template-columns: 96px minmax(0, 1.3fr) minmax(0, 1.2fr) 150px; }
  .tutor-row__photo { width: 96px; height: 96px; grid-row: auto; align-self: center; }
  .tutor-row__price { align-items: flex-end; text-align: right; }
  .tutor-row__cta { align-self: flex-end; }
}
@media (max-width: 899px) {
  .tutor-row__avail, .tutor-row__price { grid-column: 2; }
}

/* Opinie */
.tp-review { padding: 14px 0; border-bottom: 1px solid var(--border); }
.tp-review:last-child { border-bottom: 0; }
.tp-review__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
.tp-review__text { margin: 6px 0 0; color: var(--text-2); white-space: pre-line; }
.tp-review-form { padding: 16px 0; border-bottom: 1px solid var(--border); }
.tp-review-form:last-child { border-bottom: 0; }
.tp-review-form__who { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tp-rate { border: 0; padding: 0; margin: 0; display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.tp-rate input { position: absolute; opacity: 0; pointer-events: none; }
.tp-rate label { font-size: 30px; line-height: 1; color: #D9DDD8; cursor: pointer; padding: 0 2px; }
.tp-rate label:hover, .tp-rate label:hover ~ label, .tp-rate input:checked ~ label { color: #E0A526; }
.tp-rate input:focus-visible + label { outline: 2px solid var(--green); border-radius: 4px; }
@media (max-width: 599px) {
  .tutor-row { grid-template-columns: 64px minmax(0, 1fr); padding: 16px; gap: 12px 14px; }
  .tutor-row__photo { width: 64px; height: 64px; border-radius: 14px; grid-row: auto; }
  .tutor-row__avail, .tutor-row__price { grid-column: 1 / -1; }
  .tutor-row__price { flex-direction: row; align-items: center; gap: 8px; }
  .tutor-row__price .tutor-row__cta { margin: 0 0 0 auto; }
}
.tutor-row__badge { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--green); }
