/* Strefa pracownika PROTECH */
:root {
  --navy: #12263a;
  --brand: #0b5fa5;
  --brand-dark: #094c84;
  --brand-soft: #e8f1fa;
  --accent: #f2a900;
  --text: #1d2733;
  --muted: #637081;
  --line: #dde3ea;
  --bg: #f2f5f8;
  --card: #ffffff;
  --soft: #f7f9fb;
  --ok: #18794e;
  --ok-bg: #e3f5ec;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --bad: #b42318;
  --bad-bg: #fde8e6;
  --grey-bg: #eceff3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(18, 38, 58, .06), 0 4px 16px rgba(18, 38, 58, .05);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2 { color: var(--navy); line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
code { background: var(--grey-bg); padding: .1em .35em; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.text-danger { color: var(--bad); }
.break { word-break: break-all; }

/* ---------- Pasek górny ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-name { font-weight: 600; font-size: .95rem; border-left: 1px solid var(--line); padding-left: 12px; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.who-name { color: var(--muted); }
.who-link { font-weight: 600; text-decoration: none; }
.tabs {
  max-width: 1180px; margin: 0 auto; padding: 0 8px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--navy); }
.tabs a.on { color: var(--navy); border-bottom-color: var(--accent); }
.count {
  display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px;
  background: var(--accent); color: var(--navy); font-size: .78rem; line-height: 1.4em; text-align: center; font-weight: 700;
}

/* ---------- Układ ---------- */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; flex: 1; }
body.wide .wrap { max-width: none; }
.page-head { margin-bottom: 16px; }
.page-head p { margin: 0; }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.section { margin-top: 28px; }
.back { margin: 0 0 12px; font-size: .92rem; }
.back a { text-decoration: none; font-weight: 600; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card-soft { background: var(--soft); box-shadow: none; }
.card + .card { margin-top: 16px; }
.card h2:not(:first-child) { margin-top: 1.4rem; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.narrow { max-width: 620px; }

.grid-2 { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .grid-wide-left { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}

/* ---------- Komunikaty ---------- */
.alert { padding: 12px 14px; border-radius: 8px; margin: 0 0 14px; border: 1px solid transparent; }
.alert p { margin: .2rem 0; }
.alert-success { background: var(--ok-bg); color: #0f5132; border-color: #bfe5d0; }
.alert-error { background: var(--bad-bg); color: #8a1c13; border-color: #f5c2bd; }
.alert-info { background: var(--brand-soft); color: #0b3e6b; border-color: #c4dcf2; }
.alert-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.temp-pass-value code { font-size: 1.4rem; letter-spacing: .06em; background: #fff; padding: .2em .5em; user-select: all; }

/* ---------- Formularze ---------- */
.form { display: block; }
.field { margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend, .filters label {
  display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--navy);
}
.field > label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number],
input[type=month], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 1px solid #c6cfd9; border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; min-height: 84px; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; }
select { padding-right: 32px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 95, 165, .18);
}
input[type=file] { font-size: .92rem; max-width: 100%; }
.row { display: grid; gap: 0 14px; }
@media (min-width: 560px) { .row { grid-template-columns: 1fr 1fr; } }
.hint {
  margin: 8px 0 0; font-size: .875rem; color: #0b3e6b; background: var(--brand-soft);
  border-radius: 8px; padding: 9px 11px;
}
.field-error { color: var(--bad); font-size: .875rem; margin: 6px 0 0; font-weight: 600; }
.mode-switch { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.mode-switch legend { width: 100%; }
.radio, .check { display: flex; align-items: flex-start; gap: 8px; font-size: .95rem; cursor: pointer; }
.check { margin: 0 0 10px; }
.radio input, .check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.daycount { margin: -4px 0 14px; font-size: .9rem; color: var(--muted); min-height: 1.2em; }
.daycount strong { color: var(--navy); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.stack { display: grid; gap: 8px; margin-bottom: 16px; }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 8px; padding: 11px 18px; min-height: 44px;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-sm { padding: 7px 12px; min-height: 36px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--brand); border-color: #b9cfe4; }
.btn-secondary:hover { background: var(--brand-soft); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: #fff; border-color: #c6cfd9; color: var(--navy); }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover { background: #12603d; color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #8f1c13; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--bad); border-color: #f0c4bf; }
.btn-danger-ghost:hover { background: var(--bad-bg); color: var(--bad); }
.btn:focus-visible { outline: 3px solid rgba(11, 95, 165, .35); outline-offset: 2px; }

/* ---------- Statusy ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  white-space: nowrap; line-height: 1.4;
}
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-approved { background: var(--ok-bg); color: var(--ok); }
.badge-rejected { background: var(--bad-bg); color: var(--bad); }
.badge-cancelled { background: var(--grey-bg); color: var(--muted); }
.tag {
  display: inline-block; font-size: .75rem; font-weight: 600; color: var(--brand); background: var(--brand-soft);
  padding: 1px 8px; border-radius: 999px; vertical-align: middle;
}

/* ---------- Karty wniosków ---------- */
.req-list { display: grid; gap: 10px; }
.req {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.req-pending { border-left-color: var(--accent); }
.req-approved { border-left-color: var(--ok); }
.req-rejected { border-left-color: var(--bad); }
.req-cancelled { opacity: .75; }
.req-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.req-title { display: flex; flex-direction: column; min-width: 0; }
.req-person { font-size: 1.02rem; color: var(--navy); }
.req-type { font-weight: 600; }
.req-person + .req-type { font-weight: 400; color: var(--muted); font-size: .94rem; }
.req-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.req-dates { font-weight: 700; color: var(--navy); }
.req-amount { color: var(--muted); }
.req-comment { margin: 8px 0 0; font-size: .93rem; background: var(--soft); padding: 8px 10px; border-radius: 6px; }
.req-comment span { color: var(--muted); }
.req-admin { background: var(--brand-soft); }
.req-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: .85rem; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.req-actions form { margin: 0; }
.empty {
  background: #fff; border: 1px dashed #c6cfd9; border-radius: var(--radius); padding: 22px;
  text-align: center; color: var(--muted);
}

/* ---------- Podsumowania i listy ---------- */
.usage { list-style: none; margin: 0 0 10px; padding: 0; }
.usage li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .94rem; }
.usage li:last-child { border-bottom: 0; }
.usage strong { text-align: right; color: var(--navy); }
.usage .muted { font-weight: 400; }
.mini-list { list-style: none; padding: 0; margin: 0 0 14px; }
.mini-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; font-size: .93rem; }
.mini-list li .badge { justify-self: start; }
.list { padding-left: 1.2rem; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 14px 0; }
.details dt { color: var(--muted); font-size: .92rem; }
.details dd { margin: 0; }
@media (max-width: 480px) {
  .details { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 8px; }
}
.decision { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }

/* ---------- Filtry, zakładki ---------- */
.segmented { display: inline-flex; background: #e3e8ee; border-radius: 9px; padding: 3px; margin-bottom: 14px; }
.segmented a { padding: 7px 14px; border-radius: 7px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; }
.segmented a.on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.filters {
  display: grid; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
@media (min-width: 760px) { .filters { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; } }
.filters label { margin: 0; }
.filters label select, .filters label input { margin-top: 6px; font-weight: 400; }
.filters-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }

/* ---------- Tabele ---------- */
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.inactive td { opacity: .55; }
.search { margin-bottom: 10px; }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* ---------- Kalendarz ---------- */
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-name { min-width: 150px; text-align: center; color: var(--navy); }
.cal-toggle { margin: 0 0 10px; font-size: .9rem; }
.cal-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cal { border-collapse: separate; border-spacing: 0; font-size: .78rem; min-width: 100%; }
.cal th, .cal td { border-right: 1px solid #edf0f3; border-bottom: 1px solid #edf0f3; text-align: center; padding: 0; }
.cal thead th { padding: 6px 0; font-weight: 600; color: var(--muted); min-width: 30px; background: #fff; }
.cal thead th .d { display: block; color: var(--navy); font-size: .85rem; }
.cal thead th .w { display: block; font-weight: 400; font-size: .7rem; }
.cal thead th.today { background: var(--warn-bg); }
.cal .cal-name {
  position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; padding: 6px 10px;
  white-space: nowrap; font-weight: 600; color: var(--navy); min-width: 160px; border-right: 1px solid var(--line);
}
.cal td { height: 32px; min-width: 30px; }
.cal .off { background: #f3f5f8; }
.cal thead th.off { background: #f3f5f8; }
.cal td.has a {
  display: flex; align-items: center; justify-content: center; height: 100%; min-height: 31px;
  text-decoration: none; font-weight: 700; font-size: .68rem; color: #fff;
}
.cal tfoot th, .cal tfoot td { background: var(--soft); font-weight: 700; color: var(--navy); height: 30px; }
.legend { margin-top: 18px; }
.legend ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); font-size: .9rem; }
.legend-code { display: inline-block; min-width: 38px; text-align: center; background: var(--brand); color: #fff; border-radius: 4px; font-weight: 700; font-size: .75rem; padding: 1px 4px; margin-right: 6px; }

/* ---------- Logowanie ---------- */
body.auth-page { background: linear-gradient(160deg, #12263a 0%, #173450 55%, #0b5fa5 140%); }
body.auth-page .foot, body.auth-page .foot a { color: rgba(255,255,255,.75); }
.auth-card {
  max-width: 420px; margin: 6vh auto 0; background: #fff; border-radius: 14px; padding: 28px 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.auth-wide { max-width: 640px; }
.auth-logo { height: 46px; width: auto; display: block; margin-bottom: 18px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .3rem; }
.auth-card > .muted { margin-top: 0; }
.auth-links { text-align: center; margin: 16px 0 0; font-size: .95rem; }
.auth-help { text-align: center; margin: 10px 0 0; font-size: .85rem; color: var(--muted); }

/* ---------- Stopka ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px;
  padding: 18px 16px 24px; font-size: .82rem; color: var(--muted);
}
.foot a { color: var(--muted); }

@media (max-width: 560px) {
  h1 { font-size: 1.3rem; }
  .card { padding: 16px; }
  .brand-name { display: none; }
  .who-name { display: none; }
  .req-foot { flex-direction: column; align-items: stretch; }
  .req-actions .btn, .req-actions form, .req-actions form .btn { flex: 1; }
  .page-head-row .btn { width: 100%; }
}

@media print {
  .topbar, .foot, .req-actions, .btn { display: none !important; }
  body { background: #fff; }
}
body.wide .topbar-inner, body.wide .tabs { max-width: none; }

/* ---------- Wersja 1.1: urlopy i raporty ---------- */
h3 { font-size: .95rem; color: var(--navy); margin: 1.3rem 0 .5rem; }
.balance-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.year-nav { display: flex; gap: 6px; }
.year-nav a {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--navy); background: #fff;
}
.year-nav a:hover { border-color: #c6cfd9; }
.big-left { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 10px; }
.big-number { font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.big-number.neg { color: var(--bad); }
.big-label { color: var(--navy); font-weight: 600; line-height: 1.3; }
.bar { display: flex; height: 10px; background: #e3e8ee; border-radius: 999px; overflow: hidden; margin: 0 0 12px; }
.bar-thin { height: 6px; margin: 4px 0 0; }
.bar-used { background: var(--brand); display: block; height: 100%; }
.bar-pending { display: block; height: 100%; background: repeating-linear-gradient(135deg, #f2a900, #f2a900 3px, #ffd66b 3px, #ffd66b 6px); }
.balance-rows { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: .93rem; }
.balance-rows dt { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.balance-rows dd { margin: 0; text-align: right; font-weight: 600; color: var(--navy); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot-used { background: var(--brand); }
.dot-pending { background: var(--accent); }
.limits { list-style: none; padding: 0; margin: 0 0 6px; }
.limits li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.limits li:last-child { border-bottom: 0; }
.limit-row { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; }
.limit-row strong { white-space: nowrap; color: var(--navy); }
.hint-left { background: var(--ok-bg); color: #0f5132; font-weight: 600; }
.over-limit { display: block; color: var(--bad); font-weight: 700; margin-top: 4px; }
.req-note { margin: 8px 0 0; font-size: .88rem; color: #0b3e6b; background: var(--brand-soft); padding: 7px 10px; border-radius: 6px; }
.req-note-warn { color: #8a1c13; background: var(--bad-bg); font-weight: 600; }

.leave-table th, .leave-table td { white-space: nowrap; }
.leave-table thead th { vertical-align: bottom; }
.leave-table thead th.group { text-align: center; border-bottom: 1px solid var(--line); }
.leave-table .name { font-weight: 600; color: var(--navy); text-align: left; }
.leave-table td { padding: 6px 8px; }
.in-num { width: 72px !important; min-height: 38px !important; padding: 6px 8px !important; text-align: right; }
.in-pair { display: inline-flex; align-items: center; gap: 6px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.fill-btns { display: inline-flex; gap: 4px; margin-left: 4px; }
.link-btn { font: inherit; font-size: .75rem; font-weight: 700; border: 1px solid #b9cfe4; background: #fff; color: var(--brand); border-radius: 5px; padding: 1px 6px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.link-btn:hover { background: var(--brand-soft); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, rgba(242,245,248,0)); padding: 12px 0; align-items: center; z-index: 2; }
.cal-scroll .table { min-width: 100%; }
.cal-scroll .table th:first-child, .cal-scroll .table td:first-child { padding-left: 14px; }

.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.report-actions form { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.stat-num { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .85rem; }
.report-table th.name a { text-decoration: none; color: var(--navy); }
.report-table th.name a:hover { color: var(--brand); }
.report-table tr.quiet td, .report-table tr.quiet th { color: var(--muted); }
.report-table td { white-space: nowrap; }
.report-table thead th { white-space: nowrap; vertical-align: bottom; }
.chip { display: inline-block; background: var(--brand-soft); color: #0b3e6b; border-radius: 6px; padding: 2px 7px; margin: 1px 4px 1px 0; font-size: .82rem; }
.chip b { font-weight: 800; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; }
.select-short { width: auto !important; min-width: 90px; }
.cron-help { margin: 10px 0 4px; }
.cron-help summary { cursor: pointer; font-weight: 600; color: var(--brand); font-size: .92rem; }
.code { background: var(--navy); color: #e8f1fa; padding: 10px 12px; border-radius: 8px; font-size: .8rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.table tbody th { text-transform: none; letter-spacing: 0; font-size: .93rem; color: var(--navy); font-weight: 600; border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; white-space: nowrap; }

/* ---------- Wersja 1.2: kolory rodzajów nieobecności (kalendarz, legenda, raport) ---------- */
.t-wypoczynkowy { --tc: #1d6fd1; }
.t-na_zadanie { --tc: #6d4fd6; }
.t-bezplatny { --tc: #64748b; }
.t-opiekunczy { --tc: #be3a83; }
.t-szkoleniowy { --tc: #15803d; }
.t-okol_slub { --tc: #0e7490; }
.t-okol_narodziny { --tc: #0e7490; }
.t-okol_zgon_bliski { --tc: #0e7490; }
.t-okol_slub_dziecka { --tc: #0e7490; }
.t-okol_zgon_dalszy { --tc: #0e7490; }
.t-l4 { --tc: #c62828; }
.t-opieka_zasilek { --tc: #d9480f; }
.t-opieka_188 { --tc: #b45309; }
.t-sila_wyzsza { --tc: #7c4a1e; }
.t-macierzynski { --tc: #db2777; }
.t-macierzynski_uzup { --tc: #be185d; }
.t-macierzynski_przysp { --tc: #9d174d; }
.t-ojcowski { --tc: #4338ca; }
.t-rodzicielski { --tc: #a21caf; }
.t-wychowawczy { --tc: #7e22ce; }
.t-badania_ciaza { --tc: #e11d48; }
.t-poszukiwanie_pracy { --tc: #0369a1; }
.t-badania_okresowe { --tc: #047857; }
.t-krwiodawstwo { --tc: #7f1d1d; }
.t-wezwanie { --tc: #4d7c0f; }
.t-wojsko { --tc: #1e3a8a; }
.t-akcja_ratownicza { --tc: #9a3412; }
.t-funkcja_publiczna { --tc: #155e75; }
.t-inne { --tc: #374151; }
.cal td.has { background-color: var(--tc, var(--brand)); }
.cal td.has a { color: #fff; }
.cal td.has.off { opacity: .55; }
.cal td.has.pending { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.62) 0 4px, transparent 4px 8px); }
.cal td.has.pending a { text-shadow: 0 0 3px rgba(0,0,0,.75), 0 0 1px rgba(0,0,0,.9); }
.cal td.school { background: repeating-linear-gradient(90deg, #eef3fb 0 3px, #f8fafd 3px 6px); }
.cal td.outside { background: #e9ecf0; }
.cal tr.cal-group th, .cal tr.cal-group td { background: var(--soft); color: var(--navy); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; height: 28px; border-top: 2px solid var(--line); }
.cal-sub { display: block; font-weight: 400; color: var(--muted); font-size: .7rem; }
.legend-code { background: var(--tc, var(--brand)); }
.legend-pending { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.62) 0 4px, transparent 4px 8px); text-shadow: 0 0 3px rgba(0,0,0,.75); }
.legend-school { display: inline-block; width: 38px; height: 16px; vertical-align: middle; background: repeating-linear-gradient(90deg, #dbe5f5 0 3px, #f8fafd 3px 6px); border: 1px solid var(--line); }
.chip[class*=" t-"] { background: var(--tc); color: #fff; }
.leave-table tr.group-row th, .report-table tr.group-row th { background: var(--soft); color: var(--navy); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 14px; border-top: 2px solid var(--line); }

/* ---------- Wersja 1.2: młodociani, regulaminy, zgłoszenia ---------- */
.nowrap { white-space: nowrap; }
.tag-juv { color: #6b21a8; background: #f3e8ff; }
.tag-warn { color: var(--warn); background: var(--warn-bg); }
.badge-info { background: var(--brand-soft); color: var(--brand); }
.juv-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: -4px 0 16px; }
.juv-info > div { background: #f3e8ff; border: 1px solid #e3d0fb; border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; }
.juv-info .muted { font-size: .8rem; }
.juv-info strong { color: #4c1d95; }
.juv-fields { border: 1px solid #e3d0fb; background: #faf5ff; border-radius: var(--radius); padding: 12px 14px 4px; margin: 4px 0 14px; min-width: 0; }
.juv-fields > legend { font-weight: 700; color: #6b21a8; padding: 0 6px; font-size: .9rem; }
.day-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.day-check { position: relative; cursor: pointer; }
.day-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-check span { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 40px; border: 1px solid #c6cfd9; border-radius: 8px; background: #fff; font-weight: 700; color: var(--muted); }
.day-check input:checked + span { background: #6b21a8; border-color: #6b21a8; color: #fff; }
.day-check input:focus-visible + span { outline: 3px solid rgba(107, 33, 168, .35); outline-offset: 2px; }
.details-compact { margin: 6px 0 10px; font-size: .9rem; }

.doc-list { display: grid; gap: 10px; }
.doc { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.doc-read { background: var(--soft); }
.doc-icon { width: 44px; height: 54px; border-radius: 6px; background: #fde8e6; color: var(--bad); font-weight: 800; font-size: .72rem; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; border: 1px solid #f5c2bd; }
.doc-title { font-size: 1.02rem; margin: 0 0 4px; }
.doc-desc { margin: 0 0 4px; font-size: .93rem; }
.doc-body p { margin: 0 0 4px; }
.doc-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.doc-actions form { margin: 0; }
.read-progress { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.read-progress .bar { flex: 0 0 120px; margin: 0; }
.doc details { margin-top: 6px; }
.doc details summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.doc-edit .form { margin-top: 10px; }
@media (max-width: 640px) {
  .doc { grid-template-columns: auto 1fr; }
  .doc-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
}

.ticket-new { border-left-color: var(--accent); }
.ticket-in_progress { border-left-color: var(--brand); }
.ticket-closed { border-left-color: var(--ok); opacity: .85; }
.ticket-sensitive .req-type::before { content: "🔒 "; }
.ticket-admin { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.ticket-admin .row { grid-template-columns: 1fr; }
@media (min-width: 700px) { .ticket-admin .row { grid-template-columns: 1fr 220px; } }
.check.small { font-size: .85rem; margin-top: 8px; }

/* ---------- Wersja 1.3: nieobecność nieusprawiedliwiona ---------- */
.t-nn { --tc: #111827; }
.req.req-nn { border-left-color: #111827; background: #fff7f7; }
.nn-excuse h2 { margin-top: 0; }
