/* HotelOps — Baltic ops palette: fog / ink / baltic teal / buoy amber / signal red */
:root {
  --fog: #EDF1F2; --surface: #FFFFFF; --ink: #17262E; --ink-2: #4A5B64; --line: #D3DCDF;
  --baltic: #17606B; --baltic-d: #0F4750; --baltic-t: #E1EFF0;
  --buoy: #E8A317; --buoy-t: #FDF3D9; --signal: #B42318; --signal-t: #FBE7E4; --ok: #2F7D4F; --ok-t: #E2F3E9;
  --r: 10px; --nav-h: 64px;
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fog); color: var(--ink); font: 400 16px/1.5 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--baltic); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
:focus-visible { outline: 3px solid var(--buoy); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── shell ── */
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--baltic); color: #fff; padding-top: calc(12px + env(safe-area-inset-top)); }
.top .brand { font-weight: 700; letter-spacing: .01em; }
.top form { margin: 0; } .top button { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .9rem; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h); text-decoration: none; color: var(--ink-2); font-size: .78rem; font-weight: 600; position: relative; }
.nav a svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a[aria-current="page"] { color: var(--baltic); box-shadow: inset 0 3px 0 var(--baltic); }
.badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--signal); color: #fff; font-size: .72rem; line-height: 18px; text-align: center; }
main.page { max-width: 880px; margin: 0 auto; padding: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.crumb { font-size: .9rem; margin-bottom: 4px; }
.toast { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r); background: var(--ok-t); border-left: 4px solid var(--ok); }
.toast.err { background: var(--signal-t); border-left-color: var(--signal); }

@media (min-width: 960px) {
  .shell { padding: 0 0 0 232px; }
  .top { position: fixed; inset: 0 auto 0 0; width: 232px; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 20px 14px; gap: 6px; z-index: 30; }
  .top .brand { font-size: 1.15rem; margin-bottom: 8px; padding: 0 8px; }
  .top .who { font-size: .85rem; opacity: .85; padding: 0 8px; }
  .top form { margin-top: auto; }
  .nav { position: fixed; inset: 92px auto auto 0; width: 232px; flex-direction: column; background: transparent; border: 0; z-index: 31; padding: 0 14px; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 10px; color: #D9EBED; border-radius: 8px; font-size: 1rem; }
  .nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
  .badge { position: static; margin-left: auto; }
  main.page { padding: 28px 32px; max-width: 1100px; }
}

/* ── controls ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--baltic); background: var(--baltic); color: #fff; font: 600 1rem var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--baltic-d); }
.btn.ghost { background: var(--surface); color: var(--baltic); }
.btn.ghost:hover { background: var(--baltic-t); }
.btn.warn { background: var(--buoy); border-color: var(--buoy); color: #2B1F00; } .btn.warn:hover { background: #D19310; }
.btn.danger { background: var(--surface); color: var(--signal); border-color: var(--signal); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; margin: 0; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #A9B7BC; border-radius: 8px; background: #fff; font: inherit; color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; } @media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; } }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 500; min-height: 40px; cursor: pointer; }
.checks input { width: 18px; height: 18px; margin: 0; accent-color: var(--baltic); }
.hint { font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.card > h2 { margin-bottom: 10px; }

/* ── chips ── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--fog); color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-2)); display: inline-block; }
.chip.client { background: var(--baltic-t); border-color: #B7D6D9; color: var(--baltic-d); }
.chip.wx { background: var(--buoy-t); border-color: #F0D58A; color: #6B4A00; }
.chip.off { background: #fff; color: var(--ink-2); border-style: dashed; }

/* ── rail: chronologiczna lista zadań (charakterystyczny element) ── */
.rail { list-style: none; margin: 0; padding: 0; position: relative; }
.rail::before { content: ""; position: absolute; left: 62px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.rail li { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 0 22px; margin-bottom: 10px; }
.rail .time { text-align: right; font-weight: 700; font-size: .98rem; padding-top: 12px; color: var(--ink); line-height: 1.15; }
.rail .time small { display: block; font-weight: 400; color: var(--ink-2); font-size: .78rem; }
.rail li::after { content: ""; position: absolute; left: 57px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--dc, var(--baltic)); }
.rail li.done::after { background: var(--ok); border-color: var(--ok); }
.rail li.doing::after { background: var(--buoy); border-color: var(--buoy); }
.rail li.now-line { display: block; margin: 2px 0 12px 62px; height: 0; border-top: 2px solid var(--signal); }
.rail li.now-line::before, .rail li.now-line::after { content: none; }
.rail li.now-line span { position: absolute; left: -62px; top: -11px; background: var(--signal); color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.tcard { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--dc, var(--baltic)); border-radius: var(--r); padding: 10px 12px; text-decoration: none; color: inherit; }
li.done .tcard { background: #F5FAF7; } li.done .tcard .ttl { text-decoration: line-through; color: var(--ink-2); }
.tcard .ttl { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.tcard .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; font-size: .88rem; color: var(--ink-2); }
.tcard p { margin: 6px 0 0; font-size: .92rem; color: var(--ink-2); white-space: pre-line; }
.actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dayhead { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.dayhead:first-child { margin-top: 0; }
.empty { text-align: center; padding: 32px 16px; color: var(--ink-2); background: var(--surface); border: 1px dashed #A9B7BC; border-radius: var(--r); }

/* ── banners ── */
.banner { border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px; border-left: 5px solid var(--buoy); background: var(--buoy-t); }
.banner.conflict { border-left-color: var(--signal); background: var(--signal-t); }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
.banner.ok { border-left-color: var(--ok); background: var(--ok-t); }
.seg { display: inline-flex; border: 1px solid var(--baltic); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: #fff; color: var(--baltic); min-height: 40px; padding: 0 14px; font: 600 .95rem var(--font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--baltic); color: #fff; }
table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th, table.t td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tablewrap { overflow-x: auto; }
.notice { white-space: pre-line; }
.notice.unread { border-left: 5px solid var(--buoy); }
.comment { border-top: 1px solid var(--line); padding: 8px 0; } .comment b { font-size: .9rem; }
.checkrow { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.checkrow input { width: 24px; height: 24px; accent-color: var(--baltic); }

/* ── timeline (plan zasobów) ── */
.tl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.tl { min-width: 980px; position: relative; }
.tl-head, .tl-row { display: grid; grid-template-columns: 170px 1fr; }
.tl-head > div:last-child { display: grid; grid-template-columns: repeat(18, 1fr); font-size: .78rem; color: var(--ink-2); }
.tl-head span { border-left: 1px solid var(--line); padding: 6px 4px; }
.tl-row { border-top: 1px solid var(--line); min-height: 56px; }
.tl-row .lab { padding: 8px 12px; font-weight: 600; font-size: .92rem; border-right: 1px solid var(--line); }
.tl-row .lab small { display: block; font-weight: 400; color: var(--ink-2); }
.tl-row .lane { position: relative; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100%/18 - 1px), var(--line) calc(100%/18 - 1px), var(--line) calc(100%/18)); }
.blk { position: absolute; top: 6px; bottom: 6px; border-radius: 6px; padding: 3px 7px; font-size: .78rem; line-height: 1.2; overflow: hidden; color: #fff; background: var(--g); border: 2px solid transparent; text-decoration: none; }
.blk.conf { border-color: var(--signal); box-shadow: 0 0 0 2px var(--signal-t), inset 0 0 0 2px #fff; }
.blk b { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

/* ── login ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; }

/* ═════════ DOKUMENT AGENDY (ekran / druk / PDF) ═════════ */
body.doc { background: #DDE4E6; }
.doc-tools { position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.doc-tools a, .doc-tools button { color: #fff; }
.doc-tools .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); min-height: 38px; }
.doc-tools .btn.ghost[aria-current] { background: #fff; color: var(--ink); }
.doc-tools select { width: auto; min-height: 38px; }
.paper { background: #fff; max-width: 820px; margin: 16px auto; padding: 44px 48px 36px; box-shadow: 0 1px 6px rgba(0,0,0,.15); }
.paper h1 { font-size: 2.3rem; margin-bottom: 4px; }
.paper .sub { color: var(--ink-2); margin-bottom: 18px; }
.meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; padding: 14px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.meta dt { font-size: .8rem; color: var(--ink-2); font-weight: 600; } .meta dd { margin: 0; font-weight: 600; white-space: pre-line; }
.docday { margin-top: 26px; }
.docday h2 { font-size: 1.25rem; padding-bottom: 6px; border-bottom: 2px solid var(--ink); margin-bottom: 4px; }
.di { display: grid; grid-template-columns: 112px 1fr; gap: 0 16px; padding: 10px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.di .tm { font-weight: 700; white-space: nowrap; } .di .ti { font-weight: 700; } .di .lo { color: var(--ink-2); font-size: .9rem; }
.di .de { margin-top: 3px; white-space: pre-line; font-size: .95rem; }
.di.inactive { opacity: .5; }
.di .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.docbox { border: 1px solid var(--line); border-left: 5px solid var(--buoy); background: var(--buoy-t); border-radius: 6px; padding: 10px 14px; margin: 14px 0; break-inside: avoid; }
.docbox h3 { font-size: .95rem; margin-bottom: 4px; } .docbox ul { margin: 0; padding-left: 18px; }
.docfoot { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--ink); display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: .9rem; color: var(--ink-2); }
.draftmark { background: var(--buoy); color: #2B1F00; font-weight: 700; padding: 6px 12px; border-radius: 6px; display: inline-block; margin-bottom: 10px; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body.doc { background: #fff; } .doc-tools, .noprint { display: none !important; }
  .paper { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .docday h2 { break-after: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 640px) { .paper { padding: 22px 16px; margin: 0; } .meta { grid-template-columns: 1fr; } .di { grid-template-columns: 78px 1fr; gap: 0 10px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── podzadania i asortyment ── */
@media (max-width: 420px) { .nav a { font-size: .68rem; } }
.subs { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.subrow { display: grid; grid-template-columns: 46px 1fr; gap: 0 10px; padding: 6px 0; border-bottom: 1px solid var(--line); align-items: start; }
.subrow:last-of-type { border-bottom: 0; }
.subrow .stm { font-weight: 700; font-size: .9rem; }
.subrow a { font-weight: 600; text-decoration: none; color: var(--ink); }
.subrow .meta { margin-top: 2px; }
.subrow.done a { text-decoration: line-through; color: var(--ink-2); }
.parentline { font-size: .85rem; color: var(--ink-2); margin: 2px 0 0; }
.di.sub { margin-left: 22px; padding: 6px 0; border-left: 3px solid var(--line); padding-left: 12px; grid-template-columns: 90px 1fr; }
.di.sub .ti { font-weight: 600; font-size: .95rem; }
.ass-row { display: grid; grid-template-columns: 1fr 84px; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.ass-row .nt { grid-column: 1 / -1; }
.ass-row:last-child { border-bottom: 0; }
.kindhead { margin: 16px 0 6px; font-size: .95rem; color: var(--ink-2); font-weight: 700; }
