/* HR Tapiso – kalendarze: miesiąc, tydzień, edytor grafiku, oś dnia */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: var(--fs-xs); color: var(--c-text-muted); margin-top: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ---- miesiąc ---- */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--c-border); border-radius: var(--radius-lg); overflow: hidden; background: var(--c-border); gap: 1px; box-shadow: var(--shadow-sm); }
.cal-weekday { background: var(--c-surface-2); padding: 8px 6px; text-align: center; font-size: var(--fs-xs); letter-spacing: .01em; color: var(--c-text-muted); font-weight: var(--fw-semibold); }
.cal-day { background: var(--c-surface); min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.cal-day.is-other { background: var(--c-surface-2); color: var(--c-text-faint); }
.cal-day.is-weekend { background: var(--c-weekend-bg); }
.cal-day.is-holiday { background: var(--c-holiday-bg); }
.cal-day.is-company-free { background: var(--c-company-free-bg); }
.cal-day.is-company-working { background: var(--c-company-working-bg); }
.cal-day.is-clickable { cursor: pointer; }
.cal-day.is-clickable:hover { box-shadow: inset 0 0 0 2px var(--c-primary-soft); }
.cal-day.is-selected { box-shadow: inset 0 0 0 2px var(--c-primary); }
.cal-daynum { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--c-text-2); }
.cal-day.is-today .cal-daynum { background: var(--c-today); color: var(--c-on-primary); }
.cal-day.is-holiday .cal-daynum { color: var(--c-holiday-text); }
.cal-dayname { font-size: 11.5px; color: var(--c-holiday-text); font-weight: var(--fw-medium); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day.is-company-free .cal-dayname, .cal-day.is-company-working .cal-dayname { color: var(--c-text-muted); }
.cal-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-item { display: flex; align-items: center; gap: 5px; height: 20px; padding: 0 6px; border-radius: 5px; font-size: 11.5px; font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--chip-slate-bg); color: var(--chip-slate-fg); cursor: pointer; border: 0; width: 100%; text-align: left; }
.cal-item > span { overflow: hidden; text-overflow: ellipsis; }
.cal-item.is-pending { opacity: .7; border: 1px dashed currentColor; background: transparent; }
.cal-item.is-masked { background: var(--chip-slate-bg); color: var(--chip-slate-fg); }
.cal-item.is-start { border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
.cal-more { font-size: 11.5px; color: var(--c-primary-text); font-weight: var(--fw-medium); background: none; padding: 0 6px; text-align: left; }
.cal-dot-row { display: flex; gap: 3px; flex-wrap: wrap; }
.cal-dot-row .dot { width: 7px; height: 7px; }

/* ---- tydzień (osoby × dni) ---- */
.cal-week-wrap { overflow-x: auto; border: 1px solid var(--c-border); border-radius: var(--radius-lg); background: var(--c-surface); box-shadow: var(--shadow-sm); }
.cal-week { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px; }
.cal-week th, .cal-week td { border-bottom: 1px solid var(--c-border); border-right: 1px solid var(--c-border); vertical-align: top; }
.cal-week th:last-child, .cal-week td:last-child { border-right: 0; }
.cal-week tr:last-child td { border-bottom: 0; }
.cal-week th { position: sticky; top: 0; z-index: 2; background: var(--c-surface-2); padding: 8px 6px; text-align: center; font-size: var(--fs-xs); color: var(--c-text-muted); font-weight: var(--fw-semibold); }
.cal-week th .cal-th-day { display: block; font-size: var(--fs-lg); color: var(--c-text); font-weight: var(--fw-bold); line-height: 1.2; }
.cal-week th.is-today .cal-th-day { color: var(--c-primary-text); }
.cal-week th.is-weekend, .cal-week td.is-weekend { background: var(--c-weekend-bg); }
.cal-week th.is-holiday, .cal-week td.is-holiday { background: var(--c-holiday-bg); }
.cal-week .cal-person { position: sticky; left: 0; z-index: 1; background: var(--c-surface); min-width: 190px; padding: 8px 12px; text-align: left; font-weight: var(--fw-medium); white-space: nowrap; }
.cal-week th.cal-person { z-index: 3; }
.cal-week td { padding: 4px; height: 44px; min-width: 70px; }
.cal-week td .cal-item { height: 26px; justify-content: center; font-size: var(--fs-xs); }
.cal-week td .cal-item + .cal-item { margin-top: 3px; }

/* ---- edytor grafiku (osoby × dni, siatka) ---- */
.sched-wrap { overflow: auto; border: 1px solid var(--c-border); border-radius: var(--radius-lg); background: var(--c-surface); box-shadow: var(--shadow-sm); max-height: 75vh; }
.sched { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.sched th, .sched td { border-bottom: 1px solid var(--c-border); border-right: 1px solid var(--c-border); }
.sched th { position: sticky; top: 0; z-index: 2; background: var(--c-surface-2); padding: 6px 4px; text-align: center; font-size: 11.5px; color: var(--c-text-muted); font-weight: var(--fw-semibold); min-width: 54px; line-height: 1.2; }
.sched th .sched-th-num { display: block; font-size: var(--fs-md); color: var(--c-text); font-weight: var(--fw-bold); }
.sched th.is-today .sched-th-num { color: var(--c-primary-text); }
.sched th.is-weekend, .sched td.is-weekend { background: var(--c-weekend-bg); }
.sched th.is-holiday, .sched td.is-holiday { background: var(--c-holiday-bg); }
.sched th.is-company-free, .sched td.is-company-free { background: var(--c-company-free-bg); }
.sched .sched-person { position: sticky; left: 0; z-index: 1; background: var(--c-surface); min-width: 200px; max-width: 240px; padding: 6px 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched th.sched-person { z-index: 3; }
.sched .sched-person .person-sub { font-size: 11.5px; }
.sched .sched-total { position: sticky; right: 0; z-index: 1; background: var(--c-surface-2); text-align: right; font-variant-numeric: tabular-nums; padding: 6px 10px; font-weight: var(--fw-medium); min-width: 76px; }
.sched td { padding: 3px; height: 46px; text-align: center; vertical-align: middle; }
.sched-cell { width: 100%; height: 40px; border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11.5px; line-height: 1.15; font-weight: var(--fw-semibold); border: 1px dashed transparent; color: var(--c-text-faint); transition: background var(--t-fast), border-color var(--t-fast); gap: 1px; }
.sched-cell.is-editable { cursor: pointer; }
.sched-cell.is-editable:hover { border-color: var(--c-border-strong); background: var(--c-surface-hover); }
.sched-cell.is-filled { border-style: solid; border-color: transparent; }
.sched-cell .sched-code { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.sched-cell .sched-hours { font-weight: var(--fw-regular); opacity: .85; }
.sched-cell.is-off { background: var(--c-surface-3); color: var(--c-text-muted); border-style: solid; border-color: transparent; }
.sched-cell.has-warning { box-shadow: inset 0 0 0 2px var(--c-warning); }
.sched-cell.has-error { box-shadow: inset 0 0 0 2px var(--c-danger); }
.sched-cell.is-selected { box-shadow: 0 0 0 2px var(--c-primary); }
.sched-cell.chip-blue { background: var(--chip-blue-bg); color: var(--chip-blue-fg); } .sched-cell.chip-indigo { background: var(--chip-indigo-bg); color: var(--chip-indigo-fg); } .sched-cell.chip-purple { background: var(--chip-purple-bg); color: var(--chip-purple-fg); } .sched-cell.chip-pink { background: var(--chip-pink-bg); color: var(--chip-pink-fg); } .sched-cell.chip-rose { background: var(--chip-rose-bg); color: var(--chip-rose-fg); } .sched-cell.chip-orange { background: var(--chip-orange-bg); color: var(--chip-orange-fg); } .sched-cell.chip-amber { background: var(--chip-amber-bg); color: var(--chip-amber-fg); } .sched-cell.chip-lime { background: var(--chip-lime-bg); color: var(--chip-lime-fg); } .sched-cell.chip-green { background: var(--chip-green-bg); color: var(--chip-green-fg); } .sched-cell.chip-teal { background: var(--chip-teal-bg); color: var(--chip-teal-fg); } .sched-cell.chip-cyan { background: var(--chip-cyan-bg); color: var(--chip-cyan-fg); } .sched-cell.chip-slate { background: var(--chip-slate-bg); color: var(--chip-slate-fg); }
.sched-palette { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sched-palette .pal { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--radius-sm); border: 2px solid transparent; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.sched-palette .pal.is-active { border-color: var(--c-primary); }
.sched-palette .pal small { font-weight: var(--fw-regular); opacity: .8; }
.sched-warnings .list-item { padding: 8px 0; align-items: flex-start; }

/* ---- oś dnia (karta czasu pracy) ---- */
.day-bar { position: relative; height: 14px; border-radius: 4px; background: var(--c-surface-3); overflow: hidden; min-width: 120px; }
.day-bar span { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.day-bar .seg-planned { background: var(--c-primary-soft); }
.day-bar .seg-worked { background: var(--c-primary); opacity: .85; }
.day-bar .seg-break { background: var(--c-warning); opacity: .7; }
.day-bar .seg-overtime { background: var(--c-danger); opacity: .8; }
.day-bar .seg-absence { background: var(--chip-teal); opacity: .7; }
.day-bar .seg-night { background: repeating-linear-gradient(45deg, transparent 0 3px, rgba(0, 0, 0, .18) 3px 6px); }
.day-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--c-text-faint); margin-top: 2px; }

/* ---- mini kalendarz (siatka miesięcy w planie rocznym) ---- */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mini-month { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: 10px; }
.mini-month h4 { margin: 0 0 6px; font-size: var(--fs-sm); text-align: center; text-transform: capitalize; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 11.5px; text-align: center; }
.mini-grid .mini-wd { color: var(--c-text-faint); font-weight: var(--fw-semibold); }
.mini-grid .mini-day { height: 24px; display: grid; place-items: center; border-radius: 5px; color: var(--c-text-2); }
.mini-grid .mini-day.is-weekend { color: var(--c-text-faint); }
.mini-grid .mini-day.is-holiday { color: var(--c-holiday-text); background: var(--c-holiday-bg); }
.mini-grid .mini-day.is-planned { background: var(--c-primary-soft); color: var(--c-primary-text); font-weight: var(--fw-semibold); }
.mini-grid .mini-day.is-approved { background: var(--c-primary); color: var(--c-on-primary); font-weight: var(--fw-semibold); }
.mini-grid .mini-day.is-today { box-shadow: inset 0 0 0 2px var(--c-today); }
.mini-grid .mini-day.is-empty { visibility: hidden; }

@media (max-width: 720px) {
  .cal-month { gap: 0; }
  .cal-day { min-height: 64px; padding: 4px; }
  .cal-item { height: 16px; font-size: 11.5px; padding: 0 4px; }
  .cal-item > span { display: none; }
  .cal-day.is-other { display: none; }
  .cal-month.is-compact { grid-template-columns: 1fr; }
  .cal-month.is-compact .cal-weekday { display: none; }
  .cal-month.is-compact .cal-day { flex-direction: row; align-items: flex-start; min-height: 0; padding: 8px 10px; gap: 10px; }
  .cal-month.is-compact .cal-item { height: 22px; font-size: var(--fs-xs); }
  .cal-month.is-compact .cal-item > span { display: inline; }
  .cal-month.is-compact .cal-items { flex: 1; }
}
