:root {
  --green: #2F8F4E;
  --bg: #F4F6F3;
  --text: #17211B;
  --muted: #5d6b62;
  --line: #dfe5dd;
  --card: #ffffff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5;
}
a { color: var(--green); }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-in {
  max-width: 1100px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-height: 44px; }
.brand-icon { width: 20px; height: 20px; border-radius: 5px; background: var(--green); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; letter-spacing: .06em; font-size: 18px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav { display: flex; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 500;
}
.nav a:hover { background: var(--bg); }
.nav a.on { background: #e6f2ea; color: var(--green); font-weight: 600; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
button, .btn, input, select, textarea { font: inherit; }
button, .btn { min-height: 44px; min-width: 44px; padding: 0 18px; border-radius: 8px; cursor: pointer; }

/* logowanie i zaproszenia */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.auth-card { max-width: 420px; margin: 32px auto; }
.auth-card h1 { margin: 0 0 12px; font-size: 22px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.btn.primary { background: var(--green); color: #fff; border: 0; font-weight: 600; }
.alert { background: #fdecec; color: #8a1f1f; border-radius: 8px; padding: 10px 12px; }
.muted { color: var(--muted); }
.invite-link { width: 100%; }

/* lista zleceń i formularz */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 4px 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border: 1px solid var(--line); background: #fff; color: var(--text); }
.btn.primary { border: 0; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.toolbar input[type=search] { flex: 1; min-width: 0; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pills a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none; font-weight: 500; }
.pills a.on { background: #e6f2ea; color: var(--green); border-color: var(--green); font-weight: 600; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
table.jobs { width: 100%; border-collapse: collapse; min-width: 720px; }
table.jobs th, table.jobs td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.jobs th { font-size: 13px; color: var(--muted); font-weight: 600; }
table.jobs tr:last-child td { border-bottom: 0; }
.job-link { font-weight: 600; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; background: #eef1ed; color: var(--text); white-space: nowrap; }
.badge.s-do_sprawdzenia { background: #fff3cd; color: #7a5b00; }
.badge.s-gotowe { background: #e6f2ea; color: var(--green); }
.badge.s-dla_szefa, .badge.s-czeka_na_zgode { background: #e8e4f8; color: #4a3a96; }
.badge.s-blad { background: #fdecec; color: #8a1f1f; }
.badge.s-pracuje, .badge.s-w_kolejce { background: #e3eefb; color: #1f4f8a; }
.form-card { max-width: 640px; }
textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; resize: vertical; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ekran zlecenia */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.job-head { margin-bottom: 16px; }
.back { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 500; }
.job-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.job-title-row h1 { margin: 0; font-size: 24px; overflow-wrap: anywhere; }
.job-title-row p { margin: 4px 0 0; }
.job-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .job-grid { grid-template-columns: minmax(0, 1fr); } }
.job-grid .card { padding: 16px; }
.job-grid h2 { margin: 0 0 12px; font-size: 18px; }
.messages { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 88%; padding: 10px 12px; border-radius: 12px; }
.msg.pracownik { align-self: flex-end; background: #E7F2EA; border-bottom-right-radius: 4px; }
.msg.grafik { align-self: flex-start; background: #f0f1ef; border-bottom-left-radius: 4px; }
.msg.system { align-self: center; max-width: 100%; padding: 2px 8px; background: none; font-size: 13px; font-style: italic; color: var(--muted); text-align: center; }
.msg-who { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips:empty { display: none; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.czynnosc { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.czynnosc[hidden] { display: none; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; flex: none; }
.czynnosc.idle .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.composer { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.composer textarea { width: 100%; }
.composer-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.vbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.vbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none; font-weight: 600; }
.vbtn.on { background: var(--green); border-color: var(--green); color: #fff; }
.previews img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.previews.many { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.checklist h3 { font-size: 15px; margin: 16px 0 8px; }
.checklist ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.checklist label { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 4px; cursor: pointer; }
.checklist input[type=checkbox] { width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; flex: none; accent-color: var(--green); }
.counter { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.download { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.download .btn { width: 100%; }
.btn.disabled { background: #c9d3cc; color: #fff; cursor: not-allowed; pointer-events: none; }
.reason { margin: 0; font-size: 14px; color: #8a1f1f; }
.reason[hidden] { display: none; }
.links { display: flex; flex-wrap: wrap; gap: 16px; }
.links a { display: inline-flex; align-items: center; min-height: 44px; }

/* Task 6: zgody szefa, powiadomienia */
.notice { background: #e8e4f8; color: #4a3a96; border-radius: 8px; padding: 10px 12px; margin: 0 0 16px; }
.approvals { list-style: none; margin: 0; padding: 0; }
.approval { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.approval:first-child { border-top: 0; }
.approval p { margin: 4px 0 0; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.push-btn { margin-left: auto; min-height: 36px; font-size: 13px; }
.push-hint { margin: 0 0 0 auto; font-size: 13px; max-width: 320px; }

/* panel szefa */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tile p { margin: 0; }
.tile-label { color: var(--muted); font-size: 14px; }
.tile-value { font-size: 26px; font-weight: 700; }
.warn { color: #8a1f1f; font-weight: 600; }
.small { font-size: 13px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.inline-form input, .inline-form select, .font-panel input { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.font-panel { margin-top: 8px; }
.font-panel input { width: 100%; }
.font-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.font-list:empty { display: none; }
.font-list button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 8px 12px; }
