:root {
  /* Ciepły papier colours, Wypełniony shapes: tinted surfaces instead of borders. */
  --bg: #f7f3ec;
  --surface: #efe8dc;
  --raised: #fffdf8;
  --field: #fffdf8;
  --text: #2b2620;
  --muted: #625b51;
  --border: #dcd2c2;
  --field-border: #8f8474;
  --accent: #a84a23;
  --accent-text: #ffffff;
  --danger: #a42727;
  --on-danger: #ffffff;
  --ok-bg: #e3f1e2;  --ok-text: #1f5f35;
  --err-bg: #f7dcd8;  --err-text: #8f2020;
  --info-bg: #e6ecf2;  --info-text: #2d4f73;
  --code-bg: #f8e9c4;  --code-text: #5f4300;
  --btn-bg: var(--surface);  /* a quiet button: re-pointed where its surroundings are that colour */
  --req-accepted: #2e9d57;  /* calendar: accepted requests */
  --req-pending: #e0a100;   /* calendar: pending requests */
  --radius: 12px;
  --radius-sm: 8px;  /* buttons, fields */
  color-scheme: light;
}
/* Dark colours: automatic when the system is dark (unless Light was picked in the theme
   switcher), or forced with Dark. theme.js sets data-theme. Keep the two blocks the same. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1815;
    --surface: #26211c;
    --raised: #302a24;
    --field: #1c1815;
    --text: #eee8df;
    --muted: #b3aa9d;
    --border: #3f382f;
    --field-border: #7f7566;
    --accent: #e08a5f;
    --accent-text: #2b1408;
    --danger: #e8776a;
    --on-danger: #2b0d09;
    --ok-bg: #1e3323;  --ok-text: #9ad9ae;
    --err-bg: #4a231e;  --err-text: #f4b3aa;
    --info-bg: #24303a;  --info-text: #b4cde3;
    --code-bg: #3d3116;  --code-text: #f1d58a;
    color-scheme: dark;
    --req-accepted: #4cc47a;
    --req-pending: #f0bd3a;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1815;
  --surface: #26211c;
  --raised: #302a24;
  --field: #1c1815;
  --text: #eee8df;
  --muted: #b3aa9d;
  --border: #3f382f;
  --field-border: #7f7566;
  --accent: #e08a5f;
  --accent-text: #2b1408;
  --danger: #e8776a;
  --on-danger: #2b0d09;
  --ok-bg: #1e3323;  --ok-text: #9ad9ae;
  --err-bg: #4a231e;  --err-text: #f4b3aa;
  --info-bg: #24303a;  --info-text: #b4cde3;
  --code-bg: #3d3116;  --code-text: #f1d58a;
  color-scheme: dark;
  --req-accepted: #4cc47a;
  --req-pending: #f0bd3a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* even where a class sets display */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 .3em; }

/* layout: logged out, a slim top bar over a centred page */
.topbar {
  display: flex; align-items: center; gap: 1.25rem;
  padding: .75rem 1rem; background: var(--surface); border-bottom: 1px solid transparent;
}
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); }
.logo { flex: none; }
.brand:hover { text-decoration: none; }
main { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

/* layout: logged in, main menu on the left, operational pane on the right */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1.25rem;
  padding: 1rem .75rem; background: var(--surface); border-right: 1px solid transparent; --btn-bg: var(--raised);
}
.sidebar .brand { font-size: 1.15rem; padding: .25rem .6rem; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a, .menu summary { color: var(--muted); padding: .5rem .6rem; border-radius: var(--radius-sm); cursor: pointer; }
.menu a:hover, .menu summary:hover { text-decoration: none; color: var(--text); background: var(--bg); }
.menu a.active { color: var(--accent); background: var(--raised); font-weight: 600; }
/* A group such as Configuration: a heading that opens to show its pages, indented. */
.menu-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 0 .75rem; }
.menu summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; user-select: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: "›"; display: inline-block; font-size: 1.1rem; line-height: 1; transition: transform .15s; }
.menu-group[open] > summary::after { transform: rotate(90deg); }
.menu summary.active { color: var(--text); font-weight: 600; }
.menu-count { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .3rem; border-radius: 999px;
  background: var(--req-pending); color: #1c2024; font-size: .75rem; font-weight: 700; text-align: center; }
form.inline { display: inline; margin: 0; }

.sidebar-foot {
  margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: .75rem;
  padding: .75rem .6rem 0; border-top: 1px solid var(--border);
}
.profile-link {
  display: flex; align-items: center; gap: .6rem; width: 100%; max-width: 100%;
  padding: .4rem .5rem; margin: 0 -.5rem; border-radius: var(--radius-sm); color: var(--text);
}
.profile-link:hover { text-decoration: none; background: var(--bg); }
.profile-link.active { background: var(--raised); }
.avatar { flex: none; color: var(--accent); }
.profile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.profile-label { font-weight: 600; }
.who-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--muted); }
.workspace { min-width: 0; max-width: none; margin: 0; padding: 0; }  /* the right pane: bar + page, edge to edge */
.workbar {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .55rem 1.75rem; background: var(--surface); border-bottom: 1px solid transparent;
}
.workbar-title { font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workbar-tools { display: flex; align-items: center; gap: .75rem; }
.workspace-body { max-width: 1100px; padding: 1.5rem 1.75rem 3rem; }

/* calendar: month view */
.cal-head { align-items: flex-end; }
.cal-nav { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.cal-nav a[aria-disabled] { pointer-events: none; opacity: .55; }
.cal-jump { display: flex; gap: .4rem; margin: 0 0 0 .4rem; }
.cal-jump input { font: inherit; padding: .25rem .5rem; border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  background: var(--field); color: var(--text); }
table.cal { table-layout: fixed; }
table.cal th { text-align: center; }
table.cal th.cal-week, table.cal td.cal-week { width: 3rem; text-align: center; color: var(--muted); font-size: .8rem; }
.cal-day { height: 5.5rem; padding: 0; vertical-align: top; border-left: 1px solid var(--border); }
/* the whole day is the click target for picking a period */
.cal-pick { display: block; height: 100%; min-height: 5.5rem; padding: .5rem .6rem; color: inherit; }
.cal-pick:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cal-pick:focus-visible { outline-offset: -2px; }
.cal-num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9rem; height: 1.9rem;
  border-radius: 999px; font-weight: 600; }
.cal-weekend { background: color-mix(in srgb, var(--bg) 60%, transparent); }
th.cal-weekend { background: none; }
.cal-other .cal-num { color: var(--muted); font-weight: 400; opacity: .6; }
.cal-today .cal-num { background: var(--accent); color: var(--accent-text); }
/* the selected period (and its preview while picking the end) */
.cal-in-range, .cal-preview { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.cal-range-start, .cal-range-end { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-pick { position: relative; }
/* requests: lines through their days, one lane per request where they overlap, in the
   request type's colour; names (approvers only) at the start of each week row */
.cal-lanes { display: flex; flex-direction: column; gap: 2px; margin: .3rem -.6rem .4rem; }
/* 1px past each cell edge, over the day borders (positioned, so drawn above them): one
   unbroken line from day to day */
.cal-lane { position: relative; display: block; height: 1.15rem; margin: 0 -1px; --tc: #7a8590; }
/* accepted: solid in the type's colour; pending: striped, with a dashed underline */
.cal-lane-accepted { background: color-mix(in srgb, var(--tc) 30%, var(--surface)); border-bottom: 3px solid var(--tc); }
.cal-lane-pending {
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--tc) 30%, var(--surface)) 0 5px,
                                         color-mix(in srgb, var(--tc) 8%, var(--surface)) 5px 10px);
  background-attachment: fixed;  /* stripes line up from day to day */
  border-bottom: 3px dashed var(--tc);
}
.cal-lane.lane-first { margin-left: 0; border-top-left-radius: 4px; border-bottom-left-radius: 4px; }  /* flush with the day's edge */
.cal-lane.lane-last { margin-right: 0; border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.cal-lane-name {
  position: absolute; z-index: 1; left: .3rem; top: 0; line-height: 1.05rem; font-size: .7rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.cal-lane-name { color: var(--text); text-shadow: 0 0 2px var(--surface); }
/* how far the name may run along its line within the week row (no inline styles: CSP) */
.span-1 { max-width: calc(100% - .4rem); } .span-2 { max-width: calc(200% - .4rem); }
.span-3 { max-width: calc(300% - .4rem); } .span-4 { max-width: calc(400% - .4rem); }
.span-5 { max-width: calc(500% - .4rem); } .span-6 { max-width: calc(600% - .4rem); }
.span-7 { max-width: calc(700% - .4rem); }
/* request type colours: a fixed set, as the page's security policy forbids inline colours */
.tc-red { --tc: #d64545; } .tc-green { --tc: #2e9d57; } .tc-blue { --tc: #3a6fe0; } .tc-orange { --tc: #e07b2e; }
.tc-purple { --tc: #9a4fd1; } .tc-teal { --tc: #1a9e94; } .tc-pink { --tc: #d6458f; } .tc-amber { --tc: #d9a400; }
.tc-indigo { --tc: #5b5bd6; } .tc-lime { --tc: #7fb82e; } .tc-cyan { --tc: #1f9fcf; } .tc-brown { --tc: #9a6b3c; }
.tc-gray { --tc: #7a8590; }
.type-dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; background: var(--tc);
  vertical-align: -1px; margin-right: .35rem; }
.cal-legend { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; color: var(--muted); margin: .25rem 0 0; }
.cal-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.cal-key { display: inline-block; width: 1.4rem; height: .8rem; border-radius: 3px; border: 1px solid var(--border); }
.cal-key-type { background: color-mix(in srgb, var(--tc) 30%, var(--surface)); border: 0; border-bottom: 3px solid var(--tc); }
.cal-key-pending-pattern { --tc: var(--muted); border-bottom-style: dashed;
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--tc) 35%, var(--surface)) 0 3px, var(--surface) 3px 6px); }
.cal-key-holiday { background: var(--err-bg); border-color: var(--danger); }
/* public holidays: red day number, a light red wash and the holiday's name */
.cal-holiday:not(.cal-in-range) { background: color-mix(in srgb, var(--err-bg) 70%, transparent); }
.cal-holiday .cal-num { color: var(--danger); }
.cal-holiday.cal-today .cal-num { color: var(--accent-text); }  /* today's circle stays readable */
/* the name sits beside the day number, out of the flow, so request lines below stay level */
.cal-holiday-name { position: absolute; top: .9rem; left: 2.7rem; right: .3rem;
  font-size: .7rem; line-height: 1.2; color: var(--err-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-key-selected { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: var(--accent); }
.cal-period { display: flex; gap: .5rem 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: .75rem; }
.cal-period label { margin: 0; display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.cal-period input { font: inherit; padding: .3rem .5rem; border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  background: var(--field); color: var(--text); }
.cal-period input:invalid { border-color: var(--danger); }
.cal-selection {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap;
  padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--surface); --btn-bg: var(--raised);
}
.cal-selection.has-range { border-color: var(--accent); }
.cal-selection > div:first-child { display: flex; flex-direction: column; gap: .2rem; }
.cal-stats { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; }
.cal-sel-actions { display: flex; gap: 1rem; align-items: center; white-space: nowrap; }
.cal-request { margin: 0; display: inline-flex; gap: .4rem; align-items: center; }
.cal-request select { font: inherit; padding: .25rem .5rem; border: 1px solid var(--field-border);
  border-radius: var(--radius-sm); background: var(--field); color: var(--text); }
.cal-request button[disabled] { background: var(--border); border-color: var(--border); color: var(--muted); cursor: not-allowed; opacity: 1; }
.cal-overlap { margin-top: .3rem; padding: .35rem .6rem; border-radius: var(--radius-sm); background: var(--code-bg); color: var(--code-text); font-size: .9rem; }
.cal-overlap a { color: inherit; text-decoration: underline; }
.cal-overlap-accepted { color: var(--ok-text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* home screen */
.home-hero { text-align: center; padding: 2.5rem 1rem 1.5rem; }
.home-hero h1 { font-size: 2.2rem; margin: 1rem 0 .25rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; max-width: 760px; margin: 0 auto; }
.tile {
  display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.25rem;
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius); color: var(--text);
}
.tile:hover { text-decoration: none; border-color: var(--accent); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.card {
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem; --btn-bg: var(--raised);
}
.grid .card { margin-bottom: 0; }
.grid .wide { grid-column: 1 / -1; }
.card.narrow { max-width: 420px; margin: 2rem auto; }
.card.danger { background: color-mix(in srgb, var(--err-bg) 60%, var(--surface)); }
.crumbs { margin: 0 0 .25rem; color: var(--muted); font-size: .9rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 200px; }

/* forms */
form label { display: block; margin-bottom: .85rem; font-weight: 500; }
form label input:not([type=checkbox]):not([type=radio]) { display: block; width: 100%; margin-top: .25rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input:not([type=checkbox]):not([type=radio]) {
  font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--field-border); border-radius: var(--radius-sm); padding: .5rem .6rem;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:disabled { opacity: .65; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.field-error { color: var(--err-text); font-size: .85rem; margin: -.6rem 0 .85rem; }
form label:has(+ .field-error:not([hidden])) input { border-color: var(--danger); }
label.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: .3rem; }
button, .button {
  font: inherit; cursor: pointer; display: inline-block;
  padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--btn-bg); color: var(--text);
}
button:hover, .button:hover { text-decoration: none; filter: brightness(.97); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.small, .button.small { padding: .3rem .75rem; font-size: .875rem; }
button.danger { background: var(--err-bg); color: var(--err-text); }
.card.danger button.danger { background: var(--danger); color: var(--on-danger); }
button.link { background: none; border: 0; padding: 0; color: var(--muted); }
button.link:hover { color: var(--text); }
button[disabled] { opacity: .6; cursor: progress; }
.logout { margin: 0; }
.topbar .theme-switch { margin-left: auto; }
.theme-switch {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--bg);
}
.theme-switch button {
  border: 0; border-radius: 6px; padding: .2rem .7rem; font-size: .85rem;
  background: none; color: var(--muted);
}
.theme-switch button:hover { color: var(--text); filter: none; }
.theme-switch button[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.filters { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.filters input[type="search"] { flex: 1; min-width: 200px; }
.filters .inline-label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 600; }
.filters input[type="date"] { font: inherit; padding: .4rem .5rem; border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  background: var(--field); color: var(--text); }
.filters .presets { display: inline-flex; gap: .8rem; margin-left: .3rem; }
.filters select {
  font: inherit; padding: .45rem .6rem; border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  background: var(--field); color: var(--text);
}
/* sortable column headers */
th a.sort { color: inherit; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
th a.sort:hover { color: var(--text); text-decoration: none; }
th a.sort.active { color: var(--text); }
.sort-arrow { font-size: .7rem; opacity: .45; }
th a.sort.active .sort-arrow { opacity: 1; color: var(--accent); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--raised); border: 1px solid transparent; border-radius: var(--radius); margin-bottom: 1rem; --btn-bg: var(--surface); }
.table-wrap th { background: var(--surface); }
.card .table-wrap th { background: none; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.perm-table { margin: .5rem 0; }
.perm-table td, .perm-table th { padding: .5rem .6rem; }
.center { text-align: center; }

/* bits */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.badge {
  white-space: nowrap;
  display: inline-block; font-size: .8rem; padding: .05rem .5rem; margin: 0 .25rem .2rem 0;
  border-radius: 6px; background: var(--info-bg); color: var(--info-text);
}
.badge.admin { background: var(--code-bg); color: var(--code-text); }
.status { font-size: .8rem; padding: .05rem .5rem; border-radius: 6px; white-space: nowrap; }
.status.on { background: var(--ok-bg); color: var(--ok-text); }
.status.off { background: var(--err-bg); color: var(--err-text); }
.status.pending { background: var(--code-bg); color: var(--code-text); }
.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok-text); }
.flash.error { background: var(--err-bg); color: var(--err-text); }
.flash.info { background: var(--info-bg); color: var(--info-text); }
.flash.code { background: var(--code-bg); color: var(--code-text); }
.flash.code strong { font-size: 1.25rem; letter-spacing: .08em; margin: 0 .5rem; }
.flash .muted { color: inherit; opacity: .8; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .35rem 0; border-bottom: 1px solid var(--border); }
ul.plain li:last-child { border-bottom: 0; }
.member-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.member-add { margin: .75rem 0; }
.member-add select { flex: 1; min-width: 200px; }
.team-page { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1rem; align-items: start; }
.team-page .card { margin-bottom: 0; }
.team-side { display: grid; gap: 1rem; }
@media (max-width: 900px) { .team-page { grid-template-columns: minmax(0, 1fr); } }

/* medium widths: drop columns that are nice to have */
@media (max-width: 1100px) {
  .hide-md { display: none; }
}
/* phones and narrow windows: the menu pane becomes a bar above the page */
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: .5rem 1rem; padding: .6rem 1rem; border-right: 0; border-bottom: 1px solid var(--border);
  }
  .sidebar .brand { padding: 0; }
  .menu { flex-direction: row; flex-wrap: wrap; order: 3; flex-basis: 100%; }
  .menu a.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .menu-group[open] { display: flex; flex-wrap: wrap; align-items: center; }
  .menu-sub { flex-direction: row; flex-wrap: wrap; margin: 0; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; }
  .profile-link { width: auto; margin: 0; padding: .2rem; }
  .profile-link.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .profile-text { display: none; }
  .avatar { width: 28px; height: 28px; }
  .workbar { padding: .5rem 1rem; }
  .workspace-body { padding: 1rem 1rem 2rem; }
  .cal-day { height: 3.5rem; }
  .cal-pick { min-height: 3.5rem; padding: .3rem; }
  .cal-holiday-name { display: none; }  /* the red number and wash say it; the name is in the title */
  .cal-lanes { margin: .2rem -.3rem .3rem; }
  .cal-lane { height: .45rem; }  /* thin lines on phones; names are in the tooltip */
  .cal-lane-name { display: none; }
  .cal-num { min-width: 1.6rem; height: 1.6rem; font-size: .9rem; }
  .cal-jump { margin: 0; }
}
@media (max-width: 600px) {
  main { padding: 1rem 1rem 2rem; }
  .card.narrow { margin: 1rem auto; }
  th, td { padding: .5rem; }
  .hide-sm { display: none; }
}

/* "Zaloguj przez Microsoft" under the login form, and the import list's checkbox column. */
.login-or { text-align: center; margin: 1rem 0 .5rem; }
a.button.ms-login { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; }
.check-col { width: 2.5rem; text-align: center; }

/* Archived users: a neutral badge, and the "Pokaż zarchiwizowanych" box in the filter bar. */
.status.archived { background: var(--code-bg); color: var(--muted); }
.filters .check-inline { font-weight: 400; }

/* request type limits */
.limit-table { margin-bottom: 1rem; }
.limit-add { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.limit-add label { flex: 1; min-width: 8rem; margin: 0; }
.type-dot + .status, h2 .status { margin-left: .5rem; vertical-align: middle; }
.card form label select { display: block; width: 100%; margin-top: .25rem; font: inherit; padding: .5rem .6rem;
  border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: var(--field); color: var(--text); }
.rule-types { margin: .5rem 0 1rem; }
.rule-types legend { font-weight: 600; margin-bottom: .4rem; }
.rule-types label.check { margin: .2rem 0; }
.notice-input { display: flex; gap: .5rem; margin-top: .25rem; }
.notice-input input[name="notice_amount"]:not([type=checkbox]) { width: 6rem; margin-top: 0; }
.notice-input select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  background: var(--field); color: var(--text); }
.current td { font-weight: 600; }
.warn-note { color: var(--info-text); margin-top: .2rem; }
.bulk-actions { display: flex; gap: .5rem; margin: 0 0 .75rem; flex-wrap: wrap; }
.row-actions { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
/* select elements outside the forms styled above look like every other field */
select { font: inherit; color: var(--text); background: var(--field); padding: .45rem .6rem;
  border: 1px solid var(--field-border); border-radius: var(--radius-sm); }

/* the request type page: aligned fields, hints under them, one setting per card */
.type-page { max-width: 900px; }
.type-page .limit-table { margin-bottom: 0; }
.type-page .limit-table td { vertical-align: middle; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 1rem; align-items: start; }
.card form label :is(input:not([type=checkbox]):not([type=radio]), select) { height: 2.5rem; }  /* same height, so rows line up */
.field-grid.compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.field-grid .span-all { grid-column: 1 / -1; }
.hint { display: block; margin-top: .25rem; color: var(--muted); font-size: .85rem; font-weight: 400; }
.hint-after { margin: .6rem 0 0; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem 2rem; align-items: start; margin-bottom: 1rem; }
.split:last-child { margin-bottom: 0; }
.card-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 1rem; }
.card-pair .card { display: flex; flex-direction: column; }
.card-form { display: flex; flex-direction: column; align-items: flex-start; flex: 1; margin: 0; }
.card-form label { width: 100%; }
.card-form button { margin-top: auto; }  /* side by side, both buttons sit on the same line */
.explain { margin-top: .25rem; }
.explain summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.explain p { margin: .5rem 0 0; }
.delete-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.delete-card p { margin: 0; }
.delete-card form { margin: 0; }

/* absence report: employees by days of the month */
.report-table { width: auto; min-width: 100%; }
.report-table th, .report-table td { padding: .35rem .2rem; text-align: center; vertical-align: middle; font-size: .75rem;
  border-left: 1px solid var(--border); min-width: 1.75rem; }
.report-table th { text-transform: none; letter-spacing: 0; line-height: 1.2; }
.report-table .rep-weekday { display: block; font-weight: 400; font-size: .65rem; }
.report-table .rep-name { position: sticky; left: 0; z-index: 1; text-align: left; border-left: 0; padding: .35rem .6rem;
  background: var(--raised); font-size: .85rem; font-weight: 400; color: var(--text); white-space: nowrap;
  max-width: 13rem; overflow: hidden; text-overflow: ellipsis; }
.report-table thead .rep-name { background: var(--surface); color: var(--muted); font-size: .8rem; font-weight: 600; }
.report-table .rep-off { background: color-mix(in srgb, var(--muted) 16%, var(--raised)); }
.report-table thead .rep-off { background: color-mix(in srgb, var(--muted) 16%, var(--surface)); }
.report-table td.rep-abs { background: color-mix(in srgb, var(--tc) 38%, var(--raised)); color: var(--text); font-weight: 700; }
.report-table td.rep-abs.rep-off { background: color-mix(in srgb, var(--tc) 14%, var(--raised)); }
.report-table .rep-total { font-size: .85rem; font-weight: 700; padding: .35rem .6rem; }
.report-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: .75rem; font-size: .85rem; }
.report-legend .rep-code { display: inline-block; min-width: 1.75rem; margin-right: .35rem; padding: .05rem .2rem; border-radius: 4px; text-align: center;
  font-size: .75rem; font-weight: 700; background: color-mix(in srgb, var(--tc) 38%, var(--raised)); }
@media (max-width: 600px) { .report-table .rep-name { max-width: 8rem; } }

/* the page behind the buttons in the email to admins */
.decision-buttons { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Attachments on a request (Moje wnioski, Akceptacja). */
.attachment { margin-top: .2rem; overflow-wrap: anywhere; }
.attachment form.inline { margin-left: .3rem; }
.attach-form { margin-top: .3rem; }
.attach-form summary { cursor: pointer; color: var(--muted); }
.attach-form form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .3rem; }
.attach-form input[type=file] { max-width: 16rem; font-size: .85rem; }

/* Kalendarz (view only): the month beside a navigation pane; the pane goes on top on narrow screens. */
.cal-cell { display: block; position: relative; min-height: 5.5rem; padding: .5rem .6rem; }
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1rem; align-items: start; }
.overview-pane { position: sticky; top: 1rem; margin-bottom: 0; padding: 1rem; }
.pane-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.pane-year strong { font-size: 1.1rem; }
.pane-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; margin-bottom: 1rem; }
.pane-months a { text-align: center; padding: .35rem 0; border-radius: var(--radius-sm); color: var(--text); text-transform: capitalize; }
.pane-months a:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pane-months a.this-month { box-shadow: inset 0 0 0 1px var(--accent); }
.pane-months a.current { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.pane-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 .4rem; }
.pane-types { list-style: none; margin: 0 0 1rem; padding: 0; }
.pane-types a { display: block; padding: .3rem .4rem; border-radius: var(--radius-sm); color: var(--text); }
.pane-types a:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pane-types a.current { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 600; }
.pane-legend { display: flex; flex-direction: column; gap: .4rem; margin: 0; }
@media (max-width: 1000px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .overview-pane { position: static; order: -1; }
  .pane-months { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 760px) {
  .cal-cell { min-height: 3.5rem; padding: .3rem; }
  .pane-months { grid-template-columns: repeat(4, 1fr); }
}
