/*
  Grafik pracy Strefa Diamond. Barwy marki: czerń i złoto z logo.
  Złoto oznacza markę i główne akcje; statusy mają stałe znaczenie:
  czerwony = za mało osób, zielony = komplet, pomarańczowy = bez dyspozycyjności, niebieski = dostępność.
*/
:root {
  --bg: #0b0b0c;
  --surface: #151516;
  --surface-2: #1d1d1f;
  --ink: #f4f1ea;
  --ink-2: #d2cdc2;
  --muted: #9b968c;
  --line: #2a2928;
  --line-strong: #3a3836;
  --brand: #f5b324;
  --brand-ink: #1b1300;
  --brand-soft: rgba(245, 179, 36, 0.13);
  --short: #ef5b4f;
  --short-soft: rgba(239, 91, 79, 0.15);
  --ok: #4cc27c;
  --ok-soft: rgba(76, 194, 124, 0.15);
  --forced: #ff8a3d;
  --forced-soft: rgba(255, 138, 61, 0.15);
  --avail: #6ea4f5;
  --avail-soft: rgba(110, 164, 245, 0.15);
  --weekend: rgba(245, 179, 36, 0.04);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius-s: 6px;
  --radius: 10px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; }
h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
p { margin: 0; }
.lead { color: var(--muted); margin-top: 4px; max-width: 65ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.warnText { color: var(--forced); font-weight: 600; }
.printOnly { display: none; }
.sectionTitle { margin-top: 12px; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --- przyciski i pola --- */

button {
  font: 500 14px var(--font);
  border-radius: var(--radius-s);
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button.ghost, .btn { background: transparent; }
button.ghost:hover:not(:disabled), .btn:hover:not(:disabled) { background: var(--surface-2); }
button.danger, .btn-danger { background: transparent; color: var(--short); border-color: color-mix(in srgb, var(--short) 45%, transparent); }
button.danger:hover:not(:disabled), .btn-danger:hover:not(:disabled) { background: var(--short-soft); border-color: var(--short); }
button.armed { background: var(--short); color: #fff; border-color: var(--short); }
button.small { padding: 5px 10px; font-size: 13px; }
button.wide { width: 100%; padding: 11px; }
.btn.icon { width: 34px; height: 34px; padding: 0; font-size: 18px; }

input, select, textarea {
  font: 15px var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  min-height: 38px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
textarea { width: 100%; resize: vertical; }
input.short { width: 80px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field.grow { flex: 1; min-width: 200px; }
.formError { color: var(--short); font-size: 14px; min-height: 20px; }

.segmented { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; }
.segmented button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 7px 10px; }
.segmented button:hover:not(:disabled) { color: var(--ink); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented.small button { padding: 6px 8px; font-size: 13px; }

/* --- logowanie --- */

.loginScreen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: 48px;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px;
}
.loginLogo { height: 76px; width: auto; display: block; margin-bottom: 22px; }
.loginIntro h1 { font-size: 44px; line-height: 1.05; letter-spacing: -0.02em; }
.loginIntro p:last-child { color: var(--muted); margin-top: 14px; font-size: 17px; max-width: 34ch; }
.loginPanel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.loginForm, .loginForm form, .loginFields { display: flex; flex-direction: column; gap: 12px; }

/* --- szkielet: boczne menu (komputer), dolny pasek (telefon) --- */

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.sideHead { display: flex; flex-direction: column; padding: 0 8px; }
.sideLogo { height: 40px; width: auto; align-self: flex-start; margin-bottom: 12px; }
.sideHead strong { font-size: 17px; }
.sideHead span { color: var(--muted); font-size: 13px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-s);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logout { align-self: flex-start; }

.view { padding: 28px 32px 96px; display: flex; flex-direction: column; gap: 18px; max-width: 1280px; width: 100%; min-width: 0; }
.view:focus { outline: none; }
.view.wide { max-width: none; }
.viewHead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

.monthSwitcher { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.monthSwitcher .btn.icon { border: 0; }
.monthName { min-width: 150px; text-align: center; font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.infoBar, .quickActions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.formRow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wdLabel { display: inline-flex; align-items: center; gap: 6px; min-width: 120px; }
.addForm, .editForm { display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.editForm { width: 100%; }

.tag, .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.good, .badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn, .badge.warn { background: var(--forced-soft); color: var(--forced); border-color: transparent; }
.badge.danger { background: var(--short-soft); color: var(--short); border-color: transparent; }
.badge.accent { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.panelHead .tag { margin-left: 8px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; transition: background 0.2s; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s ease; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track .thumb { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 40px; justify-content: center; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
.emptyState { padding: 36px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* --- liczby --- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpiValue { font-size: 28px; font-weight: 600; line-height: 1.1; }
.kpiValue.small { font-size: 16px; line-height: 1.35; }
.kpiLabel { color: var(--muted); font-size: 13px; margin-top: 4px; }
.kpi.accent { border-color: var(--brand); }
.kpi.accent .kpiValue { color: var(--brand); }
.kpi.warn .kpiValue { color: var(--short); }
.kpi.ok .kpiValue { color: var(--ok); }

/* --- listy --- */

.list, .empList, .excList { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.listRow, .empRow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.listRow:last-child, .empRow:last-child { border-bottom: 0; }
.listRow.inactive, .empRow.inactive { color: var(--muted); }
.listRow .who, .empName { display: flex; flex-direction: column; flex: 1; min-width: 180px; }
.listRow .who .muted { font-size: 13px; }
.rowActions { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- moje zmiany --- */

.shiftList { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shift { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.shift:last-child { border-bottom: 0; }
.shift.past { color: var(--muted); }
.shift.next { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.shiftDate { text-align: center; }
.shiftDay { font-size: 24px; font-weight: 600; line-height: 1; }
.shiftWd { color: var(--muted); font-size: 13px; }
.shiftHours { font-size: 17px; font-weight: 600; }
.shiftBody .muted { display: flex; gap: 8px; align-items: center; font-size: 13px; }

/* --- tabela grafiku --- */

.tableWrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100vh - 210px); min-height: 320px; overscroll-behavior: contain; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
.schedule th, .schedule td { padding: 7px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; text-align: left; font-size: 14px; }
.schedule thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-weight: 600; }
.schedule th.sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); font-weight: 500; box-shadow: 1px 0 0 var(--line-strong), 6px 0 10px -6px rgba(0, 0, 0, 0.7); }
.schedule thead th.sticky { z-index: 3; background: var(--surface-2); }
.schedule td.off { color: var(--muted); }
.schedule td.on { font-weight: 600; }
.schedule tr.weekend td { background: var(--weekend); }
/* kolumny przyklejone muszą mieć pełne tło, inaczej przewijane komórki prześwitują */
.schedule tr.weekend th.sticky { background: linear-gradient(var(--weekend), var(--weekend)), var(--surface); }
.schedule tr.closed td, .schedule tr.closed th { color: var(--muted); background: var(--surface-2); }
.schedule .mine { background: var(--brand-soft) !important; }
.schedule tr.weekend td.mine { background: linear-gradient(var(--brand-soft), var(--brand-soft)), var(--weekend) !important; }
.schedule td.mine.on { color: var(--brand); }
.schedule tr.totals th, .schedule tr.totals td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--line-strong); }
.schedule tr.totals td.mine, .schedule thead th.mine { background: linear-gradient(var(--brand-soft), var(--brand-soft)), var(--surface-2) !important; }
.schedule th.events, .schedule td.events { min-width: 240px; max-width: 360px; white-space: normal; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.schedule thead th.events { color: var(--ink); }
.schedule td.events { padding: 4px 8px; vertical-align: top; }
.noteEdit textarea { width: 100%; min-width: 220px; font-size: 13px; padding: 6px 8px; resize: vertical; }
.noteEdit .small { display: block; margin-top: 4px; font-size: 11px; }
.noteText { all: unset; display: block; width: 100%; box-sizing: border-box; min-height: 26px; padding: 3px 6px; border-radius: var(--radius-s); cursor: text; white-space: pre-wrap; overflow-wrap: anywhere; }
/* w tabeli dłuższy opis skrócony do dwóch linii, całość po kliknięciu */
.schedule .noteText { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.noteText:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.noteText:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
.noteText.empty { color: var(--muted); opacity: 0; }
tr:hover .noteText.empty, .noteText.empty:focus-visible, .dayEvents .noteText.empty { opacity: 1; }
.dayEvents { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.dayEvents h3 { margin-bottom: 6px; }
.dayEvents .noteText { font-size: 14px; color: var(--ink); min-height: 32px; padding: 6px 8px; }
.calEvent { position: absolute; top: 7px; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--avail); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-left: 6px; vertical-align: middle; }

.schedule.avail th:not(.sticky), .schedule.avail td { text-align: center; padding: 5px 6px; font-size: 13px; }
.schedule.avail td.on { background: var(--avail-soft); color: var(--avail); font-weight: 500; }
.schedule.avail td.on.all { background: var(--avail); color: #0b1424; }
.schedule.avail .closed { opacity: 0.4; }
.schedule.avail td.note { text-align: left; white-space: normal; min-width: 200px; color: var(--muted); }

table.plain th, table.plain td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.plain th { color: var(--muted); font-weight: 500; font-size: 13px; }
td.num { text-align: right; }
.bar { position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; min-width: 120px; display: flex; align-items: center; }
.bar span { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 4px; }
.bar em { position: relative; left: calc(100% + 8px); font-style: normal; font-size: 12px; color: var(--muted); }

/* --- dyspozycyjność pracownika --- */

.availList { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.availRow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.availRow:last-child { border-bottom: 0; }
.availRow.weekend { background: var(--weekend); }
.availRow.closed { color: var(--muted); }
.availDate { display: flex; flex-direction: column; min-width: 100px; }
.availDate strong { font-size: 16px; font-weight: 600; }
.availDate .muted { font-size: 13px; }
.availRow .segmented { flex: 1; max-width: 380px; }
.rangePick { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.stickySave { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; gap: 8px; z-index: 5; }
.stickySave button { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); padding: 12px 20px; }

/* --- planer: kalendarz + dzień --- */

.plannerLayout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; position: sticky; top: 16px; }
.calHead { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.calDay {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-height: 62px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  position: relative;
}
.calDay.weekend { background: var(--weekend); }
.calDay.closed { background: var(--surface-2); color: var(--muted); }
.calDay.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.calNum { font-weight: 600; font-size: 14px; }
.calMissing { position: absolute; top: 5px; right: 6px; font-size: 11px; font-weight: 600; color: var(--short); }
.calClosed { font-size: 11px; }
/* pasek godzin dnia: każda kreska to jedna godzina */
.strip { display: flex; gap: 1px; height: 10px; margin-top: auto; }
.strip i, .sw { flex: 1; border-radius: 1px; background: var(--line); }
.strip i.short, .sw.short { background: var(--short); }
.strip i.ok, .sw.ok { background: var(--ok); }
.strip i.extra, .sw.extra { background: color-mix(in srgb, var(--brand) 55%, transparent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; flex: none; width: 14px; height: 8px; }

.dayPanel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panelHead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panelHead h2::first-letter { text-transform: uppercase; }
.panelHead .muted { margin-top: 2px; }
.panelStats { display: flex; gap: 18px; }
.panelStats div { display: flex; flex-direction: column; align-items: flex-end; }
.panelStats b { font-size: 22px; font-weight: 600; line-height: 1.1; }
.panelStats span { font-size: 12px; color: var(--muted); }
.panelStats .bad b { color: var(--short); }
.panelStats .good b { color: var(--ok); }
.dayPanel > .emptyState { margin: 16px; }
.rangeForm { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.rangeForm strong { font-size: 13px; font-weight: 600; }
.rangeFields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rangeFields select:first-child { flex: 1; min-width: 200px; }

.slots { display: flex; flex-direction: column; }
.slotRow { display: grid; grid-template-columns: 96px 122px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 18px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.slotRow:last-child { border-bottom: 0; }
.slotRow.short { border-left-color: var(--short); }
.slotRow.ok { border-left-color: var(--ok); }
.slotTime { font-weight: 600; padding-top: 7px; }
.slotCount { display: flex; align-items: center; gap: 6px; padding-top: 2px; }
.count { min-width: 44px; text-align: center; padding: 4px 6px; border-radius: 6px; font-weight: 600; font-size: 14px; background: var(--surface-2); color: var(--muted); transition: background 0.2s, color 0.2s; }
.count.short { background: var(--short-soft); color: var(--short); }
.count.ok { background: var(--ok-soft); color: var(--ok); }
.stepper { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.stepBtn { border: 0; border-radius: 0; padding: 0; width: 28px; height: 30px; font-size: 16px; }
.stepBtn + .stepBtn { border-left: 1px solid var(--line-strong); }
.slotPeople { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 34px; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 10px; border-radius: 6px; background: var(--avail-soft); color: var(--ink); font-size: 14px; font-weight: 500; }
.chip.forced { background: var(--forced-soft); color: var(--forced); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--forced) 50%, transparent); }
.chip.pop { animation: pop 0.25s ease-out both; }

/* --- role: K = kierownik, Z = zastępca managera --- */
.roleMark { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-right: 5px; padding: 0 4px; border-radius: 4px; font-size: 11px; font-weight: 700; background: var(--brand); color: var(--brand-ink); }
.roleMark.kierownik { background: var(--ink-2); color: var(--bg); }
.roleNeed { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.roleNeed.good { background: var(--ok-soft); color: var(--ok); }
.roleNeed.bad { background: var(--short); color: #fff; }
.roleSummary { display: flex; flex-direction: column; gap: 6px; }
.roleLine { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 12px; border-radius: var(--radius-s); font-size: 14px; }
.roleLine.bad { background: var(--short-soft); color: var(--short); }
.roleLine.good { background: var(--ok-soft); color: var(--ok); }
.roleLine span { color: var(--ink-2); }
.calRole { position: absolute; bottom: 14px; right: 6px; font-size: 10px; font-weight: 700; color: #fff; background: var(--short); border-radius: 3px; padding: 0 3px; line-height: 14px; }
.roleSelect { min-height: 34px; padding: 4px 8px; font-size: 14px; }
.roleSelect.kierownik { border-color: var(--ink-2); }
.roleSelect.zastepca { border-color: var(--brand); color: var(--brand); }
.roleRulesGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 32px; }
.roleRulesGrid strong { display: block; margin: 4px 0 6px; }
.chipX { border: 0; background: transparent; color: inherit; padding: 0 6px; min-height: 0; font-size: 16px; line-height: 1; opacity: 0.55; }
.chipX:hover:not(:disabled) { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.addSel { min-height: 32px; padding: 4px 8px; font-size: 14px; color: var(--muted); border-style: dashed; background: transparent; max-width: 220px; }
.waiting { width: 100%; font-size: 13px; color: var(--avail); }

/* --- ustawienia --- */

.reqTable th { white-space: nowrap; }
.reqTable td { padding: 3px; }
.reqInput { width: 54px; min-height: 30px; padding: 3px; text-align: center; }
.reqInput.outside { opacity: 0.35; }
.reqInput.nonzero { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* --- ewidencja --- */

.planHint { flex: 1; min-width: 160px; color: var(--avail); font-size: 14px; }
.hoursSel { min-width: 130px; }
.tsRow input[type="checkbox"], .wdLabel input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.tsNums { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.tsNums b { font-size: 18px; }
.tsGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tsDay { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--surface-2); border-radius: var(--radius-s); }

/* --- wykresy --- */

.chartGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; }
.chartBox { position: relative; height: 300px; }
.chartBox.tall { height: 380px; }

/* --- komunikaty --- */

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { padding: 11px 14px; border-radius: 8px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); max-width: 380px; font-size: 14px; animation: toastIn 0.2s ease-out both; }
.toast.ok { box-shadow: inset 4px 0 0 var(--ok), 0 8px 24px rgba(0, 0, 0, 0.2); }
.toast.error { box-shadow: inset 4px 0 0 var(--short), 0 8px 24px rgba(0, 0, 0, 0.2); }
.toast.leaving { animation: toastOut 0.3s ease-in both; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(8px); opacity: 0; } }

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

/* --- tablet --- */

@media (max-width: 1100px) {
  .plannerLayout { grid-template-columns: 1fr; }
  .calendar { position: static; }
}

/* --- telefon --- */

@media (max-width: 760px) {
  .loginScreen { grid-template-columns: 1fr; gap: 24px; padding: 28px 16px; align-content: start; }
  .loginIntro h1 { font-size: 34px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    height: auto;
    z-index: 30;
    flex-direction: row;
    padding: 0;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sideHead, .logout { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 0; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 1 0 auto; min-width: 72px; flex-direction: column; gap: 2px; padding: 8px 6px; font-size: 11px; border-radius: 0; justify-content: center; }
  .nav a.active { background: transparent; box-shadow: inset 0 2px 0 var(--brand); }
  .view { padding: 18px 14px 110px; }
  h1 { font-size: 22px; }
  .viewHead { align-items: stretch; }
  .monthSwitcher { width: 100%; justify-content: space-between; }
  .slotRow { grid-template-columns: 1fr auto; padding: 10px 14px; }
  .slotPeople { grid-column: 1 / -1; }
  .chartGrid { grid-template-columns: 1fr; }
  .availRow .segmented { max-width: none; width: 100%; flex: none; }
  .stickySave { bottom: 76px; }
  .stickySave button { flex: 1; }
  input, select, textarea { font-size: 16px; }
  .calDay { min-height: 50px; padding: 4px; }
  .strip { height: 7px; }
  #toasts { bottom: 80px; left: 16px; right: 16px; }
  .tableWrap { max-height: calc(100vh - 250px); }
  .schedule th, .schedule td { padding: 6px 8px; font-size: 13px; }
  .schedule th.events, .schedule td.events { min-width: 180px; }
  .noteText.empty { opacity: 1; }
}

/* --- druk / PDF grafiku --- */

@media print {
  body { background: #fff; color: #000; }
  .sidebar, .toolbar, .noPrint, .monthSwitcher, .viewHead, #toasts { display: none !important; }
  .shell { display: block; }
  .printOnly { display: block; }
  .view { padding: 0; max-width: none; }
  .tableWrap { max-height: none; overflow: visible; border: 0; }
  .schedule th, .schedule td { color: #000 !important; background: #fff !important; border: 1px solid #000 !important; padding: 3px 5px; font-size: 10px !important; position: static !important; }
  .schedule tr.weekend td, .schedule tr.weekend th { background: #ead1dc !important; }
  .schedule tr.closed td { background: #d9d9d9 !important; }
  .noteEdit .small { display: none; }
  .noteText.empty { opacity: 0 !important; }
}
