/* ===== Widoki: pulpit, kalendarz, uczniowie, profil, finanse, księgowość, ustawienia, okno lekcji ===== */
.page { max-width: 1240px; margin: 0 auto; padding: clamp(16px, 3vw, 32px); }
.page-narrow { max-width: 780px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.035em; line-height: 1.15; }
.page-sub { color: var(--text-3); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wave { display: inline-block; animation: wave 2.4s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } 50%, 100% { transform: rotate(0); } }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-grid-wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.dash-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1000px) { .dash-grid, .dash-grid-wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1360px) { .dash-grid-wide { grid-template-columns: minmax(0, 1fr); } }
.page > .card, .page > .stat-grid, .page > .toolbar, .page > .q-nav { margin-bottom: 18px; }
.page > .card:last-child, .page > .dash-grid:last-child { margin-bottom: 0; }

/* ---- onboarding ---- */
.onboarding { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--card); border-color: var(--accent-soft-2); display: flex; flex-direction: column; gap: 14px; }
.onb-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.onb-title { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 16px; }
.onb-steps { display: grid; gap: 8px; }
.onb-step { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; background: var(--card-2); }
.onb-step.done { opacity: .55; } .onb-step.done .onb-text b { text-decoration: line-through; }
.onb-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 13px; flex: none; }
.onb-step.done .onb-num { background: var(--good); color: #052a1c; }
.onb-text { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.onb-text .muted { font-size: 13px; }

/* ---- skrzynka do potwierdzenia ---- */
.inbox-card { border-color: hsl(38 90% 55% / .35); background: linear-gradient(135deg, var(--warn-soft), transparent 55%), var(--card); }
.inbox-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.inbox-title { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 16px; color: var(--warn); }
.inbox-title + .muted { margin-top: 2px; }
.inbox-list { display: flex; flex-direction: column; gap: 6px; }
.inbox-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--card-2); }
.inbox-main { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; }
.inbox-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.inbox-text b { font-weight: 650; } .inbox-text .muted { font-size: 13px; }
.inbox-actions { display: flex; gap: 6px; flex: none; }
.inbox-more { padding: 10px 4px 0; font-size: 13px; }

/* ---- hero: następna lekcja ---- */
.hero-next { position: relative; overflow: hidden; padding: 22px; background: radial-gradient(520px 220px at 100% 0%, var(--sc-soft), transparent 70%), var(--card); display: flex; flex-direction: column; gap: 16px; }
.hero-next.is-live { border-color: hsl(var(--h) 72% var(--sl) / .55); box-shadow: 0 0 0 4px hsl(var(--h) 72% var(--sl) / .1), var(--shadow); }
.hero-kicker { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.hero-lead { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 650; color: var(--sc); background: var(--sc-soft); padding: 3px 11px; border-radius: 999px; }
.hero-main { display: flex; gap: 16px; align-items: center; }
.hero-title { font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.hero-sub { color: var(--text-2); }
.hero-when { margin-top: 4px; font-weight: 650; color: var(--sc); }
.hero-prep { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.prep-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.prep-row > .ico { color: var(--text-3); margin-top: 3px; }
.prep-k { font-weight: 700; color: var(--text); margin-right: 4px; }
.prep-hw { margin-top: 2px; font-size: 13px; color: var(--warn); } .prep-hw.done { color: var(--good); }
.prep-notes { white-space: pre-wrap; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-empty { align-items: flex-start; } .hero-empty .hero-title { font-size: 20px; }

/* ---- oś czasu ---- */
.timeline { display: flex; flex-direction: column; gap: 4px; }
.tl-item { display: flex; align-items: center; gap: 8px; border-radius: 14px; transition: background .15s; }
.tl-item:hover { background: var(--card-2); }
.tl-main { flex: 1; display: flex; align-items: stretch; gap: 12px; padding: 10px; min-width: 0; text-align: left; }
.tl-time { display: flex; flex-direction: column; width: 46px; font-variant-numeric: tabular-nums; line-height: 1.3; } .tl-time b { font-weight: 700; } .tl-time span { color: var(--text-3); font-size: 12.5px; }
.tl-bar { width: 4px; border-radius: 4px; background: var(--sc); flex: none; }
.tl-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.35; }
.tl-name { font-weight: 650; } .tl-sub { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-side { padding-right: 8px; flex: none; }
.tl-item.is-done .tl-bar { opacity: .45; }
.tl-item.is-cancelled_student, .tl-item.is-cancelled_tutor, .tl-item.is-noshow { opacity: .6; } .tl-item.is-cancelled_tutor .tl-name, .tl-item.is-cancelled_student .tl-name { text-decoration: line-through; }

/* ---- pasek tygodnia ---- */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 14px; background: var(--card-2); border: 1px solid transparent; transition: all .15s; }
.ws-day:hover { border-color: var(--line-2); transform: translateY(-1px); }
.ws-day.is-today { background: var(--accent-soft); border-color: var(--accent); }
.ws-day.is-past { opacity: .6; }
.ws-letter { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .05em; } .ws-date { font-weight: 750; font-size: 16px; }
.ws-bar { width: 8px; height: 34px; border-radius: 6px; background: var(--card-3); display: flex; align-items: flex-end; overflow: hidden; }
.ws-bar i { display: block; width: 100%; background: linear-gradient(0deg, var(--accent), var(--accent-hi)); border-radius: 6px; min-height: 0; }
.ws-count { font-size: 12px; font-weight: 700; color: var(--text-2); }

/* ---- podpowiedzi ---- */
.insight-list { display: flex; flex-direction: column; gap: 10px; }
.insight { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.insight-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); }
.insight-warn .insight-ico { background: var(--warn-soft); color: var(--warn); } .insight-danger .insight-ico { background: var(--danger-soft); color: var(--danger); } .insight-good .insight-ico { background: var(--good-soft); color: var(--good); }
.insight-body { min-width: 0; line-height: 1.4; }
.insight-title { font-weight: 650; } .insight-text { color: var(--text-3); font-size: 13.5px; }
.insight-cta { margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; font-weight: 650; font-size: 13px; color: var(--accent-text); }
.insight-cta:hover { text-decoration: underline; }

/* ---- kalendarz ---- */
.page-cal {
  max-width: none; height: calc(100dvh - var(--topbar-h)); min-height: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px clamp(12px, 2vw, 24px) 12px;
}
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; flex: none; }
.cal-nav { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.cal-heading { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cal-title { font-size: clamp(18px, 2vw, 24px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; text-transform: capitalize; }
.cal-summary { font-size: 13px; font-weight: 650; color: var(--text-2); }
.cal-tools { display: flex; gap: 8px; align-items: center; }
.cal-card { padding: 0; overflow: hidden; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-cal > .card { margin-bottom: 0; }
.cal-scroll { --hh: 76px; flex: 1; min-height: 0; overflow: auto; position: relative; overscroll-behavior: contain; }
.cal-grid { display: flex; flex-direction: column; min-width: 100%; }
.cal-grid.is-week { min-width: 760px; }
.cal-grid.is-day { min-width: 420px; }
.cal-head {
  position: sticky; top: 0; z-index: 6;
  display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(0, 1fr));
  background: var(--card-3); border-bottom: 1px solid var(--line-2);
  box-shadow: 0 10px 18px -16px rgba(0, 0, 0, .7);
}
.cal-corner { position: sticky; left: 0; z-index: 1; background: var(--card-3); }
.cal-dayhead {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 4px 8px; gap: 2px; border-left: 1px solid var(--line-2); min-width: 0;
  background: var(--card-3); transition: background .15s;
}
.cal-dayhead:hover { background: color-mix(in srgb, var(--text) 6%, var(--card-3)); }
.cal-dayhead.is-weekend { background: color-mix(in srgb, var(--text) 7%, var(--card-2)); }
.cdh-name { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.cdh-num { font-size: 18px; font-weight: 800; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; letter-spacing: -.02em; }
.cal-dayhead.is-today .cdh-num { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -6px hsl(var(--ah) var(--as) var(--al) / .8); }
.cal-dayhead.is-today .cdh-name { color: var(--accent-text); }
.cal-dayhead.is-today { background: hsl(var(--ah) var(--as) var(--al) / .2); }
.cdh-meta { min-height: 18px; display: flex; align-items: center; }
.cdh-meta span {
  font-size: 10.5px; font-weight: 700; color: var(--text-2); letter-spacing: -.02em;
  background: color-mix(in srgb, var(--bg) 55%, transparent); border-radius: 999px; padding: 1px 6px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cal-dayhead.is-today .cdh-meta span { background: var(--accent-soft); color: var(--accent-text); }
.cal-body { display: grid; grid-template-columns: 58px minmax(0, 1fr); }
.cal-times { position: sticky; left: 0; z-index: 4; background: var(--card); border-right: 1px solid var(--line-2); }
.cal-time { position: relative; }
.cal-time span {
  position: absolute; top: 4px; right: 8px;
  font-size: 11px; font-weight: 700; color: var(--text-2);
  font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1;
}
.cal-cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.day-col {
  position: relative; border-left: 1px solid var(--line); cursor: cell;
  background-color: transparent;
  background-image: repeating-linear-gradient(
    to bottom,
    color-mix(in srgb, var(--text) 20%, transparent) 0 1px,
    transparent 1px,
    transparent calc(var(--hh) / 2 - 1px),
    color-mix(in srgb, var(--text) 8%, transparent) calc(var(--hh) / 2 - 1px),
    color-mix(in srgb, var(--text) 8%, transparent) calc(var(--hh) / 2),
    transparent calc(var(--hh) / 2),
    transparent var(--hh)
  );
}
.day-col.is-weekend { background-color: color-mix(in srgb, var(--text) 3.5%, transparent); }
.day-col.is-today { background-color: hsl(var(--ah) var(--as) var(--al) / .06); }
.day-col:hover { background-color: color-mix(in srgb, var(--text) 4%, transparent); }
.day-col.is-today:hover { background-color: hsl(var(--ah) var(--as) var(--al) / .09); }
.ev {
  position: absolute; z-index: 2; padding: 4px 6px 3px 8px; border-radius: 8px;
  background: linear-gradient(180deg, hsl(var(--h) 72% var(--sl) / .22), hsl(var(--h) 72% var(--sl) / .1)), var(--card);
  border: 1px solid hsl(var(--h) 72% var(--sl) / .38);
  border-left: 4px solid var(--sc);
  overflow: hidden; text-align: left; line-height: 1.2; cursor: grab;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 0;
  box-shadow: 0 1px 0 hsl(var(--h) 72% var(--sl) / .12);
  transition: box-shadow .15s, transform .15s, opacity .15s; touch-action: manipulation;
}
.ev:hover { box-shadow: var(--shadow); z-index: 4; transform: translateY(-1px); }
.ev.is-dragging { opacity: .35; cursor: grabbing; }
body.is-dragging-ev, body.is-dragging-ev .ev { cursor: grabbing; }
.ev-mark { position: absolute; top: 4px; right: 4px; display: flex; color: var(--text-2); }
.ev-mark .ico { width: 12px; height: 12px; }
.ev-name { font-size: 12.5px; font-weight: 750; letter-spacing: -.02em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ev:has(.ev-mark) .ev-name { padding-right: 14px; }
.ev-time {
  color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 10.5px; font-weight: 650;
  letter-spacing: -.03em; line-height: 1.25; white-space: nowrap; max-width: 100%;
}
.ev-sub { color: var(--text-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.is-split .ev-name { font-size: 12px; }
.is-split .ev-time { font-size: 10px; }
.ev-done { background: var(--card-2); border-color: var(--line-2); border-left-color: var(--sc); }
.ev-done .ev-name { color: var(--text-2); }
.ev-done .ev-mark { color: var(--good); }
.ev-needs { box-shadow: inset 0 0 0 1px var(--warn); }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.ev-live { box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }
.ev-cancelled_student, .ev-cancelled_tutor { background: var(--card-2); border-color: var(--line); border-left-color: var(--text-3); opacity: .7; }
.ev-cancelled_student .ev-name, .ev-cancelled_tutor .ev-name { text-decoration: line-through; color: var(--text-3); }
.ev-noshow { border-color: var(--danger); }
.ev-ghost {
  --sc: hsl(var(--h, 220) 72% var(--sl));
  --sc-soft: hsl(var(--h, 220) 72% var(--sl) / .2);
  position: absolute; left: 3px; right: 4px; z-index: 6; border-radius: 9px;
  border: 2px dashed var(--sc); background: var(--sc-soft);
  display: grid; place-items: center; color: var(--text); font-weight: 750; font-size: 12px;
  pointer-events: none; font-variant-numeric: tabular-nums;
}
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); z-index: 5; pointer-events: none; }
.now-line i { position: absolute; left: -1px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 28%, transparent); }
.now-tag {
  position: absolute; left: 14px; top: -9px; height: 16px; padding: 0 6px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; line-height: 16px;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-3); align-items: center; flex: none; }
.cal-legend .lg { margin: 0 6px 0 0; vertical-align: -1px; }
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; flex: none; }
.ds-day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 58px; padding: 6px 0; border-radius: 14px; background: var(--card); border: 1px solid var(--line); gap: 1px; font-size: 11px; color: var(--text-3); font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.ds-day b { font-size: 16px; color: var(--text); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.ds-day.is-today:not(.is-sel) b { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-text); }
.ds-day.is-sel { background: var(--accent); border-color: transparent; color: #fff; }
.ds-day.is-sel b { color: #fff; box-shadow: none; }
.month { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.month-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 2; background: var(--card); }
.month-head span { padding: 12px 8px; text-align: center; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.month-head span.is-weekend { color: var(--text-2); }
.month-body { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(var(--rows), minmax(124px, 1fr)); flex: 1; }
.mcell { display: flex; flex-direction: column; gap: 5px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; min-width: 0; transition: background .15s; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell:hover { background: var(--card-2); }
.mcell.is-weekend { background: color-mix(in srgb, var(--text) 3%, transparent); }
.mcell.is-out { background: var(--bg-2); }
.mcell.is-out .mcell-num { color: var(--text-3); font-weight: 650; }
.mcell.is-out .mpill { opacity: .55; }
.mcell.is-today { background: hsl(var(--ah) var(--as) var(--al) / .07); }
.mcell-num { font-size: 13px; font-weight: 750; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.mcell.is-today .mcell-num { background: var(--accent); color: #fff; }
.mcell-list { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mpill {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 4px; align-items: center;
  font-size: 12px; font-weight: 650; line-height: 1.2; padding: 3px 6px 3px 7px; border-radius: 7px;
  background: var(--sc-soft); border-left: 3px solid var(--sc); min-width: 0;
}
.mpill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpill.is-done {
  background: color-mix(in srgb, var(--text-3) 34%, var(--card-2));
  border-left-color: var(--text-3);
  color: var(--text-2);
}
.mpill b { font-variant-numeric: tabular-nums; font-weight: 750; color: var(--text-2); }
.mpill.is-done b,
.mpill.is-done span { color: var(--text-2); }
.mmore { font-size: 11.5px; font-weight: 700; color: var(--text-2); padding-left: 4px; }
.mcell-dots { display: none; gap: 4px; justify-content: center; }
.mcell-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--sc); }
@media (max-width: 960px) {
  #main:has(.page-cal) { padding-bottom: 0; }
  .page-cal { height: calc(100dvh - var(--topbar-h) - 76px - var(--safe-b)); }
  .cal-scroll { --hh: 64px; }
  .cal-grid.is-week { min-width: 0; }
  .ev-sub { display: none; }
  .cal-grid.is-day { min-width: 0; }
}
@media (max-width: 720px) {
  .mcell-list { display: none; }
  .mcell-dots { display: flex; flex-wrap: wrap; }
  .month-body { grid-template-rows: repeat(var(--rows), minmax(72px, 1fr)); }
  .mcell { align-items: center; padding: 6px 4px; }
  .cal-summary { font-size: 12.5px; }
}

/* ---- uczniowie ---- */
.student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.student-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.student-card:hover { border-color: hsl(var(--h) 72% var(--sl) / .45); }
.sc-top { display: flex; align-items: center; gap: 12px; }
.sc-id { flex: 1; min-width: 0; line-height: 1.3; } .sc-name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-sub { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 12px; background: var(--card-2); border-radius: 12px; }
.sc-meta div { display: flex; flex-direction: column; font-size: 13.5px; line-height: 1.3; min-width: 0; } .sc-meta .muted { font-size: 11.5px; } .sc-meta b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-goal { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- profil ucznia ---- */
.profile-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px; background: radial-gradient(520px 220px at 0% 0%, var(--sc-soft), transparent 70%), var(--card); }
.ph-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ph-text { min-width: 0; }
.ph-name { font-size: 26px; font-weight: 800; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; line-height: 1.2; }
.ph-sub { color: var(--text-2); } .ph-goal { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13.5px; color: var(--sc); font-weight: 600; }
.ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.history { display: flex; flex-direction: column; }
.hist-item { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.hist-item:last-child { border-bottom: 0; }
.hist-item.is-cancelled_student, .hist-item.is-cancelled_tutor { opacity: .6; }
.hist-date { display: flex; flex-direction: column; line-height: 1.3; } .hist-date b { font-weight: 700; } .hist-date span { color: var(--text-3); font-size: 12.5px; }
.hist-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hist-title { font-weight: 650; text-align: left; } .hist-title:hover { color: var(--accent-text); }
.hw-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.hw-check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.hw-check span.done { text-decoration: line-through; color: var(--text-3); }
.hist-note { font-size: 13px; color: var(--text-3); white-space: pre-wrap; }
.hist-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; }
.contact-list { display: flex; flex-direction: column; gap: 2px; }
.contact { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 12px; color: var(--text-3); transition: background .15s; }
a.contact:hover { background: var(--card-2); }
.contact span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; } .contact b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; } .contact .muted { font-size: 12.5px; }
.notes-text { white-space: pre-wrap; color: var(--text-2); }

/* ---- księgowość ---- */
.q-nav { display: flex; align-items: center; gap: 12px; }
.q-label { font-weight: 750; font-size: 18px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .q-label .muted { font-size: 14px; font-weight: 500; }
.limit-card { display: flex; gap: 28px; align-items: center; padding: 24px; background: radial-gradient(520px 240px at 0% 0%, var(--accent-soft), transparent 70%), var(--card); }
.limit-card.is-warn { background: radial-gradient(520px 240px at 0% 0%, var(--warn-soft), transparent 70%), var(--card); } .limit-card.is-over { background: radial-gradient(520px 240px at 0% 0%, var(--danger-soft), transparent 70%), var(--card); }
.limit-body { flex: 1; min-width: 0; }
.limit-title { font-weight: 750; font-size: 16px; margin-bottom: 12px; }
.limit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.limit-grid div { display: flex; flex-direction: column; } .limit-grid b { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; } .limit-grid .muted { font-size: 12.5px; }
@media (max-width: 820px) { .limit-card { flex-direction: column; align-items: stretch; } .limit-ring { display: grid; place-items: center; } .limit-grid { grid-template-columns: 1fr 1fr; } }
.report-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.report-form .field { margin-bottom: 0; }
.report-btns { display: flex; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }

/* ---- ustawienia ---- */
.settings-card { margin-bottom: 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; margin-bottom: 4px; }
.setting-row:first-of-type { border-top: 0; }
.setting-row > div:first-child { display: flex; flex-direction: column; line-height: 1.4; min-width: 200px; flex: 1; } .setting-row b { font-weight: 650; } .setting-row .muted { font-size: 13px; }
.account-box { margin-top: 4px; padding: 14px; border-radius: var(--r); background: var(--card-2); display: grid; gap: 10px; }
.account-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.account-box .btn-row { margin-top: 2px; }
.placeholder-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.kbd-list { display: grid; gap: 8px; } .kbd-list > div { display: flex; align-items: center; gap: 14px; } .kbd-list kbd { min-width: 64px; text-align: center; }
.kbd-list span { color: var(--text-2); }

/* ---- okno lekcji ---- */
.lesson-hero { padding: 18px 20px 14px; background: radial-gradient(420px 160px at 100% 0%, var(--sc-soft), transparent 70%); border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.sheet-body.flush .lesson-section { padding: 0 20px; }
.sheet-body.flush .lesson-section:last-child { padding-bottom: 8px; }
.lesson-hero-main { display: flex; align-items: center; gap: 14px; }
.lesson-hero-text { flex: 1; min-width: 0; line-height: 1.3; } .lesson-hero-name { font-size: 20px; font-weight: 800; letter-spacing: -.025em; } .lesson-hero-sub { color: var(--text-2); }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13.5px; color: var(--text-2); }
.lesson-meta span { display: inline-flex; align-items: center; gap: 6px; } .lesson-meta .ico { color: var(--text-3); }
.lesson-section { margin-bottom: 16px; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.status-btn { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 8px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); font-weight: 600; font-size: 13px; color: var(--text-2); transition: all .15s; text-align: center; }
.status-btn:hover { background: var(--card-3); color: var(--text); }
.status-btn.is-active { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent); }
.status-btn.st-done.is-active { color: var(--good); background: var(--good-soft); border-color: var(--good); }
.status-btn.st-cancelled_student.is-active { color: var(--warn); background: var(--warn-soft); border-color: var(--warn); }
.status-btn.st-noshow.is-active { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.lesson-status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.prep-card { padding: 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); display: grid; gap: 4px; }
.prep-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.prep-topic { font-weight: 650; }
.prep-hw, .prep-card .prep-hw { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.prep-hw input { accent-color: var(--accent); width: 16px; height: 16px; }
.prep-note { font-size: 13px; color: var(--text-3); white-space: pre-wrap; }
.lesson-links { display: flex; gap: 8px; flex-wrap: wrap; }
.dur-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dur-input { display: flex; align-items: center; gap: 6px; color: var(--text-3); } .dur-input .input { width: 84px; height: 36px; }

/* ===== Pulpit: wyrównanie kolumn do wspólnej dolnej linii ===== */
.dash-grid { align-items: stretch; }
.dash-col > .card:last-child { flex: 1 1 auto; }
.insights-card { display: flex; flex-direction: column; }
.insights-card .insight-list { flex: 0 0 auto; gap: 8px; }
.insights-card .insight { padding: 10px 12px; gap: 10px; align-items: flex-start; }
.insights-card .insight-ico { width: 30px; height: 30px; border-radius: 10px; }
.insights-card .insight-text { font-size: 13px; }
.insights-toggle { margin-top: 10px; }
.btn-group { display: inline-flex; align-items: center; gap: 2px; }

/* ===== Cena lekcji (arkusz lekcji) ===== */
.price-edit { display: grid; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.price-edit label { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13.5px; color: var(--text-2); }
.price-input { position: relative; max-width: 220px; }
.price-input .input { padding-right: 36px; font-variant-numeric: tabular-nums; }
.price-input em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--text-3); pointer-events: none; }

/* ===== Wybór roli (rejestracja) ===== */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px 13px; border-radius: 14px; background: var(--card-2); border: 1.5px solid var(--line-2); transition: all .15s; line-height: 1.3; }
.role-card b { font-size: 14px; font-weight: 700; } .role-card > span:last-child { font-size: 12px; color: var(--text-3); }
.role-card:hover { border-color: var(--accent); }
.role-card.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.role-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--card-3); color: var(--accent-text); margin-bottom: 4px; }
.role-card.active .role-ico { background: var(--accent); color: #fff; }
.auth-single { grid-template-columns: 1fr; }
@media (max-width: 420px) { .role-grid { grid-template-columns: 1fr; } }
.notice-good { background: var(--good-soft); color: var(--good); }
.sheet-xl { max-width: 980px; }

/* ===== Portal ucznia (korepetytor: kod połączenia) ===== */
.pt-empty { padding: 8px 0 4px; }
.pt-code-box { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 18px 14px; margin: 12px 0; border-radius: 18px; background: linear-gradient(135deg, var(--accent-soft), transparent 80%), var(--card-2); border: 1px solid var(--accent-soft-2); }
.pt-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.pt-code { font-size: clamp(28px, 7vw, 38px); font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--accent-text); user-select: all; }
.pt-code-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ===== Portal ucznia (widok ucznia) ===== */
.student-root { min-height: 100dvh; background: var(--bg); }
.sp { min-height: 100dvh; }
.sp-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px clamp(14px, 3vw, 28px); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.sp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; color: var(--accent-text); background: var(--accent-soft); }
.sp-main { max-width: 1100px; margin: 0 auto; padding: clamp(16px, 3vw, 30px); display: flex; flex-direction: column; gap: 18px; }
.sp-preview { min-height: 0; } .sp-preview .sp-main { padding: 0; max-width: none; }
.sp-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px; background: radial-gradient(560px 220px at 100% 0%, var(--accent-soft), transparent 70%), var(--card); }
.sp-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.sp-hero-title { font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin: 4px 0 10px; }
.sp-hero-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .sp-stats { grid-template-columns: minmax(0, 1fr); } }
.sp-pay.danger { border-color: hsl(0 80% 60% / .35); }
.sp-price { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; } .sp-price.due { color: var(--danger); }
.hist-title.static { cursor: default; } .hist-title.static:hover { color: inherit; }
.hw-static { display: flex; gap: 7px; align-items: flex-start; font-size: 13.5px; color: var(--warn); } .hw-static.done { color: var(--good); }
.hw-static .ico { margin-top: 3px; flex: none; }
.sp-readonly { display: flex; gap: 6px; align-items: flex-start; margin-top: 12px; }
.sp-switch { margin-bottom: -6px; }
.sp-foot { text-align: center; font-size: 12.5px; }
.sp-loading { display: grid; place-items: center; gap: 12px; padding: 60px 0; }
.sp-claim { display: grid; justify-items: center; text-align: center; gap: 8px; max-width: 520px; margin: 6vh auto 0; padding: 32px 24px; }
.sp-claim .sp-hero-title { margin: 4px 0 0; }
.sp-claim-form { display: flex; gap: 8px; width: 100%; margin-top: 10px; }
.sp-code { text-align: center; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sp-claim .auth-msg { min-height: 20px; }
.sp-add { border-radius: var(--r-lg, 18px); }
.sp-add > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--accent-text); padding: 6px 4px; list-style: none; }
.sp-add > summary::-webkit-details-marker { display: none; }
.sp-add[open] > summary { margin-bottom: 10px; }
.sp-add .sp-claim { margin: 0 auto; }
@media (max-width: 480px) { .sp-claim-form { flex-direction: column; } .sp-hero { padding: 18px; } }
.debt-amount { font-weight: 750; color: var(--danger); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Portal ucznia: wylogowanie widoczne w nag³ówku */
.sp-logout { flex: none; white-space: nowrap; }
@media (max-width: 560px) { .sp-badge { display: none; } .sp-top { gap: 6px; } .sp-top .brand-name { display: none; } }
@media (max-width: 360px) { .sp-logout span { display: none; } }


/* Rozliczenia ucznia: rozbicie salda i oznaczanie lekcji jako op³aconych */
.ledger { display: grid; gap: 6px; padding: 4px 2px 12px; font-size: 14px; }
.ledger > div { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); }
.ledger b { color: var(--text); font-variant-numeric: tabular-nums; }
.ledger-sum { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; font-weight: 700; }
.settle-list { display: grid; gap: 4px; max-height: 280px; overflow: auto; margin: 12px 0 8px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; }
.settle-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.settle-row:hover { background: var(--hover, color-mix(in srgb, var(--text) 5%, transparent)); }
.settle-row .settle-date { flex: 1; }
.settle-row em { font-style: normal; color: var(--text-3); margin-left: 6px; }
.settle-row b { font-variant-numeric: tabular-nums; }
.settle-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

