/* Bean & Brew: wygląd z projektu B v2 (Paper, Ink, Forest, Copper; Bricolage Grotesque + Instrument Sans) */
:root {
  --paper: #F7F5F1;
  --white: #FFFFFF;
  --ink: #1B1714;
  --stone: #6F655D;
  --forest: #23443A;
  --forest-soft: #DCE6E0;
  --copper: #AE5E28;
  --copper-dark: #8F4C1F;
  --copper-soft: #F3E3D6;
  --mist: #E6E1D9;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55;
  -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.screen { min-height: 100dvh; max-width: 560px; margin: 0 auto; background: var(--paper); }

/* Przyciski */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px;
  border: 0; border-radius: 2px; background: var(--copper); color: var(--white); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--copper-dark); }
.btn.block { width: 100%; }
.btn.line { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.line:hover { background: var(--white); }
.btn.light { background: var(--white); color: var(--forest); }
.btn.light:hover { background: var(--forest-soft); }
.link { background: none; border: 0; padding: 8px 0; color: var(--stone); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Logowanie */
.hero { position: relative; height: min(46dvh, 380px); overflow: hidden; background: var(--forest); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(27,23,20,.15) 0%, rgba(27,23,20,0) 35%, rgba(27,23,20,.8) 100%); }
.hero .over { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 0 20px 22px; color: var(--white); display: grid; gap: 8px; }
.hero .over .tag { font-family: var(--display); font-weight: 760; font-size: clamp(2rem, 9vw, 2.7rem); line-height: .98; letter-spacing: -.03em; }
.hero .mark { position: absolute; top: calc(16px + var(--top)); left: 20px; z-index: 1; }
.login { padding: 28px 20px calc(32px + var(--bottom)); display: grid; gap: 20px; }
.login h1 { font-size: 1.7rem; font-weight: 740; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input { min-height: 50px; padding: 12px 14px; border: 1.5px solid #8C827A; border-radius: 2px; background: var(--white); font-size: 1rem; }
.field input:focus-visible { outline-offset: 0; border-color: var(--copper); }
.error { background: var(--copper-soft); color: var(--ink); padding: 12px 14px; border-left: 4px solid var(--copper); font-size: .95rem; }
.demo { font-size: .9rem; color: var(--stone); background: var(--white); padding: 12px 14px; border-radius: 2px; }
.demo b { color: var(--ink); font-weight: 600; }

/* Pasek górny */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--top)) 20px 10px; background: rgba(247,245,241,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--mist); }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--forest); color: var(--white); font-weight: 700; cursor: pointer; }
.menu { position: absolute; right: 20px; top: calc(56px + var(--top)); background: var(--white); border-radius: 4px; padding: 8px; min-width: 200px;
  box-shadow: 0 10px 30px rgba(27,23,20,.14); display: grid; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--mist); font-size: .9rem; color: var(--stone); }
.menu .who b { display: block; color: var(--ink); }
.menu button { text-align: left; background: none; border: 0; padding: 12px 10px; cursor: pointer; border-radius: 2px; }
.menu button:hover { background: var(--paper); }

/* Ekran główny */
.home { padding: 20px 20px calc(40px + var(--bottom)); display: grid; gap: 28px; }
.greet { font-family: var(--body); font-size: 1.05rem; font-weight: 400; letter-spacing: 0; color: var(--stone); }
.path h2 { font-size: clamp(1.7rem, 7.5vw, 2.2rem); font-weight: 760; line-height: 1.02; }
.path .row { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
.light-link { color: var(--white); font-weight: 600; }
.lesson .kicker { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stone); }
.back-home { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px 0 0; background: none; border: 0; font-weight: 700; cursor: pointer; }
.path { background: var(--forest); color: var(--white); padding: 24px 20px; border-radius: 2px; display: grid; gap: 14px; }
.path .label { color: var(--forest-soft); }
.path h1 { font-size: clamp(1.7rem, 7.5vw, 2.2rem); font-weight: 760; line-height: 1.02; }
.bar { height: 6px; background: rgba(255,255,255,.22); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--copper-soft); border-radius: 3px; transition: width .4s; }
.path .meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .95rem; }
.label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stone); }
.home h2 { font-size: 1.35rem; font-weight: 720; }
.lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lesson { display: grid; grid-template-columns: 96px 1fr; gap: 0; background: var(--white); border-radius: 4px; overflow: hidden; min-height: 96px;
  border: 0; padding: 0; text-align: left; width: 100%; cursor: pointer; position: relative; }
.lesson[disabled] { cursor: default; }
.lesson .thumb { position: relative; background: var(--mist); }
.lesson .thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.lesson .thumb .n { position: absolute; left: 8px; bottom: 4px; z-index: 1; color: var(--white); font-family: var(--display); font-weight: 800; font-size: 1.9rem;
  line-height: 1; text-shadow: 0 1px 8px rgba(27,23,20,.6); }
.lesson[disabled] .thumb img { filter: grayscale(.85); opacity: .55; }
.lesson .txt { padding: 14px 16px; display: grid; gap: 6px; align-content: center; }
.lesson .t { font-family: var(--display); font-weight: 700; font-size: 1.08rem; line-height: 1.15; }
.lesson .m { font-size: .88rem; color: var(--stone); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.pill.done { background: var(--forest-soft); color: var(--forest); }
.pill.prog { background: var(--copper-soft); color: var(--copper-dark); }
.pill.new { background: var(--paper); color: var(--ink); }
.pill.soon { background: var(--paper); color: var(--stone); }
.lesson:not([disabled]):hover .t { text-decoration: underline; text-underline-offset: 3px; }

.install { background: var(--white); border-radius: 4px; padding: 18px; display: grid; gap: 12px; border-left: 4px solid var(--copper); }
.install h2 { font-size: 1.1rem; }
.install ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.install .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.foot { font-size: .8rem; color: var(--stone); text-align: center; }

/* Odtwarzacz */
.player { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr; background: var(--white); z-index: 10; }
.player .bar-top { display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--top)) 12px 6px; border-bottom: 1px solid var(--mist); background: var(--paper); min-height: 52px; }
.player .back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; background: none; border: 0; font-weight: 700; cursor: pointer; border-radius: 2px; }
.player .back:hover { background: var(--white); }
.player .ttl { flex: 1; min-width: 0; font-family: var(--display); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .saved { font-size: .8rem; color: var(--stone); white-space: nowrap; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--paper); }

.net { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--bottom)); z-index: 20; max-width: 536px; margin: 0 auto;
  background: var(--ink); color: var(--white); padding: 12px 16px; border-radius: 4px; font-size: .92rem; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--bottom)); z-index: 20; max-width: 536px; margin: 0 auto;
  background: var(--forest); color: var(--white); padding: 14px 16px; border-radius: 4px; font-weight: 600; }

/* Termin szkolenia */
.due-banner { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; border: 0; border-left: 4px solid var(--copper);
  background: var(--copper-soft); padding: 14px 16px; border-radius: 4px; cursor: pointer; font: inherit; color: var(--ink); }
.due-banner.late { background: #F6DCCB; border-left-color: var(--copper-dark); }
.due-banner .db-icon { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--copper-dark); color: var(--white);
  display: grid; place-items: center; font-weight: 800; font-size: .95rem; }
.due-banner .db-sub { display: block; font-size: .88rem; color: #4F4640; margin-top: 2px; }
.path .meta .late { background: var(--copper-soft); color: var(--copper-dark); padding: 0 8px; border-radius: 999px; font-weight: 700; }

/* Wspólne drobne elementy */
.hint { font-size: .88rem; color: var(--stone); }
.empty { color: var(--stone); background: var(--white); padding: 16px; border-radius: 4px; }
.pill.warn { background: var(--copper-soft); color: var(--copper-dark); }
.hero.short { height: 180px; }
.admin-entry { background: var(--white); border-radius: 4px; padding: 18px; display: grid; gap: 12px; border-left: 4px solid var(--forest); }
.admin-entry h2 { font-size: 1.15rem; }
.admin-entry p { color: var(--stone); font-size: .95rem; }
.field select { min-height: 50px; padding: 12px 14px; border: 1.5px solid #8C827A; border-radius: 2px; background: var(--white); font: inherit; }
.field input[readonly] { background: var(--paper); color: var(--stone); }

/* Okno dialogowe */
.dlg { border: 0; border-radius: 6px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--white); color: var(--ink);
  box-shadow: 0 20px 60px rgba(27,23,20,.3); }
.dlg.wide { width: min(680px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(27,23,20,.5); }
.dlg-body { padding: 24px; display: grid; gap: 16px; }
.dlg-body h2 { font-size: 1.4rem; }
.dlg .err, .dlg .error { background: var(--copper-soft); padding: 10px 12px; border-left: 4px solid var(--copper); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; gap: 16px 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.grid2 .field { align-content: start; }
.field select:disabled { background: var(--paper); color: var(--stone); }
.grid2 .span2 { grid-column: 1 / -1; }

/* Wybór szkoleń */
.pick { border: 1px solid var(--mist); border-radius: 4px; padding: 12px 16px; margin: 0; display: grid; gap: 4px; }
.pick legend { font-weight: 700; padding: 0 6px; }
.pick-row { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--mist); }
.pick-row:first-of-type { border-top: 0; }
.chk { display: flex; gap: 10px; align-items: center; cursor: pointer; min-height: 44px; }
.chk input, .tr-table input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--forest); margin: 0; }
.days { font-size: .9rem; color: var(--stone); display: flex; align-items: center; gap: 6px; }
.days input { width: 70px; min-height: 40px; padding: 6px 8px; border: 1.5px solid #8C827A; border-radius: 2px; font: inherit; }

/* Panel administratora */
.screen.wide { max-width: 1120px; }
.adm-tag { font-family: var(--display); font-weight: 700; color: var(--forest); margin-right: auto; padding-left: 12px; border-left: 1px solid var(--mist); white-space: nowrap; }
.back-home { white-space: nowrap; }
@media (max-width: 400px) { .adm-tag { display: none; } }
.admin { padding: 24px 20px calc(48px + var(--bottom)); display: grid; gap: 24px; }
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.adm-head h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 760; }
.back-link { color: var(--stone); font-weight: 600; text-underline-offset: 3px; }
.search { max-width: 420px; }
.panel { background: var(--white); border-radius: 4px; padding: 20px; display: grid; gap: 16px; }
.panel h2 { font-size: 1.25rem; }
.panel.danger { border-left: 4px solid var(--copper); }
.danger-btn { border-color: var(--copper-dark); color: var(--copper-dark); }
.danger-fill { background: var(--copper-dark); }
.file-btn { cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--copper); outline-offset: 3px; }

table.people, table.tr-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 4px; overflow: hidden; font-size: .95rem; }
.panel table { background: transparent; }
table.people th, table.people td, table.tr-table th, table.tr-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--mist); vertical-align: top; }
table.people th, table.tr-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--stone); font-weight: 700; background: var(--paper); }
table.people .pname { font-weight: 700; color: var(--ink); display: block; text-underline-offset: 3px; }
table.people td .note { display: block; font-size: .85rem; }
.tr-table input[type=date] { min-height: 40px; padding: 6px 8px; border: 1.5px solid #8C827A; border-radius: 2px; font: inherit; background: var(--white); }
@media (max-width: 720px) {
  table.people thead, table.tr-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.people tr, table.tr-table tr { display: grid; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--mist); }
  table.people td, table.tr-table td { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 2px 0; border: 0; }
  table.people td .pill, table.tr-table td .pill { justify-self: start; }
  .cv { min-width: 0; overflow-wrap: anywhere; }
  table.people td::before, table.tr-table td::before { content: attr(data-label); font-size: .78rem; font-weight: 700; color: var(--stone); text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
}

/* Nawigacja panelu i szkolenia */
.adm-nav { display: flex; gap: 4px; border-bottom: 1.5px solid var(--mist); }
.adm-nav a { padding: 10px 16px; font-weight: 700; color: var(--stone); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1.5px; min-height: 44px; display: inline-flex; align-items: center; }
.adm-nav a[aria-current="page"] { color: var(--ink); border-color: var(--copper); }
.adm-nav a:hover { color: var(--ink); }
.kicker { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stone); }
.tcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tcard { display: grid; background: var(--white); border-radius: 4px; overflow: hidden; color: var(--ink); text-decoration: none; height: 100%; }
.tcard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--mist); }
.tc-body { padding: 14px 16px 18px; display: grid; gap: 6px; align-content: start; }
.tc-body .pill { justify-self: start; }
.tc-title { font-family: var(--display); font-weight: 700; font-size: 1.15rem; line-height: 1.15; }
.tcard:hover .tc-title { text-decoration: underline; text-underline-offset: 3px; }
.t-head { display: grid; grid-template-columns: minmax(0, 240px) 1fr; gap: 20px; align-items: center; }
.t-head img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--mist); }
.t-head > div { display: grid; gap: 6px; }
.t-head h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); font-weight: 760; }
@media (max-width: 560px) { .t-head { grid-template-columns: 1fr; } }
.lrows { list-style: none; margin: 0; padding: 0; display: grid; }
.lrow { display: grid; grid-template-columns: 32px 72px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--mist); }
.lrow:first-child { border-top: 0; }
.lrow .ln { font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--copper); text-align: center; }
.lrow img { width: 72px; height: 54px; object-fit: cover; border-radius: 2px; background: var(--mist); }
.lmain { display: grid; gap: 4px; min-width: 0; }
.lmain .pill { justify-self: start; }
.lact { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: .88rem; }
.btn[disabled] { opacity: .45; cursor: default; }
@media (max-width: 760px) { .lrow { grid-template-columns: 28px 64px 1fr; } .lact { grid-column: 1 / -1; justify-content: flex-start; } }
.bar.dark { background: var(--mist); }
.bar.dark > span { background: var(--forest); width: 0; }
.pkg-info:empty { display: none; }
.pkg-info { color: var(--forest); font-weight: 600; font-size: .92rem; }

/* Raporty */
.filters { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.filters .field { align-content: start; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tiles li { background: var(--white); border-radius: 4px; padding: 16px 18px; display: grid; gap: 2px; border-top: 3px solid var(--mist); }
.tiles li.warn { border-top-color: var(--copper); }
.tiles .tv { font-family: var(--display); font-weight: 760; font-size: 2.2rem; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--ink); }
.tiles .tl { font-size: .9rem; color: var(--stone); font-weight: 600; }
#rep { display: grid; gap: 20px; }
.attention { border-left: 4px solid var(--copper); }
.att .pname { font-weight: 700; color: var(--ink); text-underline-offset: 3px; }
.att { list-style: none; margin: 0; padding: 0; display: grid; }
.att li { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--mist); }
.att li:first-child { border-top: 0; }
.att .note { display: block; font-size: .88rem; }
.mini { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--mist); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.mini > span { display: block; height: 100%; background: var(--forest); border-radius: 3px; }

/* Karta zaproszenia */
.invite { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 8px 0; }
.invite h2 { font-size: 1.35rem; }
.invite p { max-width: 42ch; }
.invite .qr { width: 220px; max-width: 70vw; background: var(--white); padding: 6px; border: 1px solid var(--mist); }
.invite .qr svg { width: 100%; height: auto; display: block; }
.inv-link { font-size: .9rem; word-break: break-all; }
.inv-link a { color: var(--forest); font-weight: 600; }
.inv-steps { text-align: left; margin: 4px 0; padding-left: 22px; font-size: .95rem; }
#print { display: none; }
@media print {
  body > *:not(#print) { display: none !important; }
  #print { display: block; }
  #print .invite { page-break-after: always; break-after: page; padding-top: 40px; }
  #print .no-print { display: none; }
  #print .qr { width: 260px; }
}

@media (min-width: 600px) {
  body { background: var(--mist); }
  .screen { box-shadow: 0 0 0 1px var(--mist); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
