@import url("/static/fonts.css");

:root {
  --cream: #FAF7F0;
  --beige: #F0EBDD;
  --beige-2: #E6DFCC;
  --prussian: #1B3A5C;
  --prussian-l: #2C5478;
  --ink: #0D2238;
  --muted: #5A6B7D;
  --line: #DED6C3;
  --burgundy: #7C1E2E;
  --missing: #F6E3E5;
  --ok: #2F6B4F;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--prussian); }
h1, h2, h3, .h3 { font-family: var(--serif); font-weight: 400; color: var(--prussian); margin: 0; letter-spacing: .005em; }
h1 { font-size: 40px; line-height: 1.05; }
h2 { font-size: 26px; line-height: 1.15; }
h3, .h3 { font-size: 19px; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--ink);
  color: var(--cream);
  position: sticky; top: 0; z-index: 10;
}
.topbar-in {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); }
.brand img { width: 34px; height: 34px; }
.brand b { font: 300 22px/1 var(--serif); letter-spacing: .08em; }
.brand span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #9FB3C8; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: #C9D5E2; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500;
}
.nav a:hover, .nav a.on { color: var(--cream); background: rgba(250,247,240,.08); }
.topbar .hotel { margin-left: auto; text-align: right; font-size: 12px; color: #9FB3C8; line-height: 1.3; }
.topbar .hotel b { display: block; color: var(--cream); font-weight: 500; font-size: 13px; }
.pill-demo { background: var(--burgundy); color: var(--cream); font-size: 10px; letter-spacing: .12em; padding: 2px 7px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; }

main { max-width: 1240px; margin: 0 auto; padding: 36px 24px 80px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.lead { color: var(--muted); max-width: 640px; margin: 10px 0 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 500 14px/1 var(--sans); padding: 11px 18px; border-radius: 8px; border: 1px solid transparent;
  text-decoration: none; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--prussian); color: var(--cream); }
.btn-primary:hover { background: var(--prussian-l); }
.btn-ghost { background: transparent; color: var(--prussian); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--prussian); }
.btn-quiet { background: none; border: 0; color: var(--muted); padding: 6px 8px; font-size: 13px; cursor: pointer; }
.btn-quiet:hover { color: var(--burgundy); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- cards / lists ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 22px 24px; }
.beige { background: var(--beige); border-color: var(--beige-2); }

.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list td { padding: 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list tr.row-link { cursor: pointer; }
.list tr.row-link:hover td { background: #FCFBF7; }
.list .name { font-weight: 600; color: var(--ink); text-decoration: none; }
.list .sub { color: var(--muted); font-size: 12.5px; }
.num { text-align: right; white-space: nowrap; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-do_sprawdzenia { background: #F3EBD6; color: #765410; }
.st-zatwierdzone { background: #E3EFE8; color: var(--ok); }
.tag-missing { background: var(--missing); color: var(--burgundy); font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }

.empty { text-align: center; padding: 70px 20px; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--muted); margin: 0 auto 22px; max-width: 460px; }

/* ---------- new inquiry ---------- */
.grid-new { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
textarea {
  width: 100%; min-height: 440px; resize: vertical; border: 1px solid var(--line); border-radius: 8px;
  padding: 16px; font: 13px/1.55 ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink); background: #fff;
}
textarea:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--prussian); outline-offset: 1px; border-color: var(--prussian); }
.sample { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; font: inherit; color: inherit; }
.sample:hover { border-color: var(--prussian); }
.sample b { display: block; font-weight: 600; margin-bottom: 2px; }
.sample small { color: var(--muted); display: block; }
.alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; }
.alert-err { background: var(--missing); color: var(--burgundy); }
.alert-info { background: var(--beige); color: var(--ink); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0 0; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin-bottom: 12px; color: var(--muted); font-size: 13.5px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 22px; height: 22px; border-radius: 50%; background: var(--prussian); color: var(--cream); font-size: 12px; display: grid; place-items: center; font-weight: 600; }
.steps b { color: var(--ink); font-weight: 600; }

/* ---------- BEO view ---------- */
.beo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.facts div { padding: 16px 20px; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.day { margin-top: 26px; }
.day-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.day-meta { color: var(--muted); font-size: 13px; }
.lines { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lines th { text-align: left; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 10px 12px; background: #FCFBF7; border-bottom: 1px solid var(--line); }
.lines td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines tr:last-child td { border-bottom: 0; }
.lines .t { color: var(--muted); width: 58px; white-space: nowrap; }
.lines .pos b { font-weight: 600; display: block; }
.lines .pos small { color: var(--muted); display: block; font-size: 12.5px; line-height: 1.4; }
.lines tr.missing td { background: var(--missing); }
.lines input { font: inherit; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 5px 7px; width: 100%; text-align: right; color: var(--ink); }
.lines tr:hover input { border-color: var(--line); background: #fff; }
.lines input:focus { background: #fff; }
.lines .q { width: 78px; }
.lines .p { width: 120px; }
.lines .v { width: 120px; text-align: right; font-weight: 500; white-space: nowrap; padding-top: 15px; }
.lines .src { width: 88px; padding-top: 15px; }
.lines .act { width: 86px; padding-top: 10px; white-space: nowrap; text-align: right; }
.src-tag { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--beige); color: var(--muted); }
.src-mail { background: #E1EAF3; color: var(--prussian); }
.src-ręcznie { background: #EFE6F0; color: #5B3263; }
.src-brak { background: var(--burgundy); color: var(--cream); }
.vat-chip { font-size: 11px; color: var(--muted); }
.missing-label { color: var(--burgundy); font-weight: 600; font-size: 11.5px; letter-spacing: .04em; display: block; margin-top: 4px; text-align: right; }
.save-hint { display: none; }
.lines tr:focus-within .save-hint { display: inline-flex; }

.side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.totals { padding: 22px 24px; }
.totals .big { font: 400 36px/1 var(--serif); color: var(--prussian); margin: 6px 0 2px; }
.totals table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.totals td { padding: 6px 0; border-top: 1px solid var(--line); }
.totals td:last-child { text-align: right; }
.totals .lbl { color: var(--muted); }
.side ul { margin: 10px 0 0; padding-left: 18px; }
.side li { margin-bottom: 6px; font-size: 13.5px; }
.side .warn h3 { color: var(--burgundy); }
.side .q li::marker { color: var(--prussian); }
.side-actions { display: flex; flex-direction: column; gap: 10px; }
.side-actions .btn { justify-content: center; }

details.thread { margin-top: 32px; }
details.thread summary { cursor: pointer; color: var(--prussian); font-weight: 500; }
details.thread pre { white-space: pre-wrap; font: 12.5px/1.55 ui-monospace, Menlo, monospace; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; max-height: 520px; overflow: auto; }

.add-form { display: grid; grid-template-columns: 110px 1.4fr 1.4fr 80px 110px 80px auto; gap: 8px; align-items: end; padding: 16px; }
.add-form label { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.add-form input, .add-form select { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }

/* ---------- hotel config ---------- */
.cfg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cfg .list td, .cfg .list th { padding: 10px 16px; }
code.k { font-size: 12px; background: var(--beige); padding: 2px 6px; border-radius: 4px; color: var(--prussian); }

footer.foot { max-width: 1240px; margin: 0 auto; padding: 0 24px 40px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }

@media (max-width: 980px) {
  .beo-grid, .grid-new, .cfg { grid-template-columns: 1fr; }
  .side { position: static; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts div:nth-child(2) { border-right: 0; }
  .facts div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .add-form { grid-template-columns: 1fr 1fr; }
  .topbar .hotel { display: none; }
}
@media (max-width: 640px) {
  main { padding: 24px 16px 60px; }
  .topbar-in { padding: 0 16px; gap: 12px; }
  .brand span { display: none; }
  h1 { font-size: 32px; }
  .lines .src, .lines th.src, .lines .t, .lines th.t { display: none; }
  .table-wrap { overflow-x: auto; }
}
@media print {
  .topbar, .side-actions, .add-form, .act, details.thread, footer.foot { display: none !important; }
  .beo-grid { grid-template-columns: 1fr; }
  body { background: #fff; }
}

/* ---------- poprawki po przeglądzie ---------- */
h1, h2, h3, .totals .big, .brand b { font-variant-numeric: lining-nums tabular-nums; }
.lines th.num { text-align: right; }
@media (max-width: 640px) {
  .brand b { display: none; }
  .nav { gap: 0; }
  .nav a { padding: 6px 8px; font-size: 13px; white-space: nowrap; }
  .lines .q { width: 62px; }
  .lines .p { width: 92px; }
  .lines .v { width: 96px; }
  .lines .act { width: 34px; }
}
.beo-grid > *, .grid-new > *, .cfg > * { min-width: 0; }
.table-wrap { overflow-x: auto; }
.src-tag { white-space: nowrap; }
.list th.num { text-align: right; }

/* ---------- publiczne demo ---------- */
.demo-bar { background: var(--beige); border-bottom: 1px solid var(--beige-2); color: var(--ink); font-size: 13px; text-align: center; padding: 9px 16px; }
.demo-bar a { color: var(--prussian); font-weight: 500; }
.code-input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); min-width: 0; flex: 1; max-width: 320px; }

/* ---------- UI v0.2: ekran oczekiwania, toast, pasek podsumowania, strona startowa ---------- */
.working { position: fixed; inset: 0; z-index: 50; background: rgba(13, 34, 56, .55); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); }
.working[hidden] { display: none; }
.working-card { background: var(--cream); border-radius: 14px; padding: 32px 36px; width: min(420px, 100%); box-shadow: 0 20px 60px rgba(13,34,56,.3); text-align: left; }
.working-ring { width: 96px; height: 96px; display: block; margin: 0 auto 20px; color: var(--prussian); }
/* pętla 3,4 s: okrąg się maluje, potem Ā kreska po kresce, chwila pełnego logo, okrąg znika, Ā gaśnie */
.ld-paint, .ld-legs, .ld-feet, .ld-bar, .ld-macron { stroke-dasharray: 100 100; }
.ld-paint { animation: ld-ring 3.4s cubic-bezier(.55,.1,.35,1) infinite; }
@keyframes ld-ring { 0% { stroke-dashoffset: 100; } 36% { stroke-dashoffset: 0; } 78% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -100; } }
.ld-legs { animation: ld-legs 3.4s infinite; }
@keyframes ld-legs { 0%, 30% { stroke-dashoffset: 100; } 46%, 100% { stroke-dashoffset: 0; } }
.ld-feet { animation: ld-feet 3.4s infinite; }
@keyframes ld-feet { 0%, 46% { stroke-dashoffset: 100; } 50%, 100% { stroke-dashoffset: 0; } }
.ld-bar { animation: ld-bar 3.4s infinite; }
@keyframes ld-bar { 0%, 50% { stroke-dashoffset: 100; } 55%, 100% { stroke-dashoffset: 0; } }
.ld-macron { animation: ld-macron 3.4s infinite; }
@keyframes ld-macron { 0%, 55% { stroke-dashoffset: 100; } 62%, 100% { stroke-dashoffset: 0; } }
.ld-a { animation: ld-afade 3.4s infinite; }
@keyframes ld-afade { 0%, 78% { opacity: 1; } 92%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ld-paint, .ld-legs, .ld-feet, .ld-bar, .ld-macron, .ld-a { animation: none; stroke-dashoffset: 0; opacity: 1; }
}
@keyframes aori-spin { to { transform: rotate(360deg); } }
.working-steps { list-style: none; margin: 0; padding: 0; }
.working-steps li { position: relative; padding: 7px 0 7px 30px; color: var(--muted); font-weight: 500; transition: color .3s; }
.working-steps li::before { content: ""; position: absolute; left: 0; top: 10px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box; }
.working-steps li.now { color: var(--ink); }
.working-steps li.now::before { border-color: var(--prussian); border-right-color: transparent; animation: aori-spin .8s linear infinite; }
.working-steps li.done { color: var(--prussian); }
.working-steps li.done::before { background: var(--prussian); border-color: var(--prussian); }
.working-steps li.done::after { content: ""; position: absolute; left: 5px; top: 13px; width: 4px; height: 7px; border: solid var(--cream); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.working-note { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: var(--cream); padding: 11px 18px; border-radius: 99px; font-weight: 500; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
body.saving main { opacity: .7; transition: opacity .15s; }

.did { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.did-lead { font-weight: 600; margin-right: 4px; }
.did-chip { font-size: 12.5px; padding: 5px 11px; border-radius: 99px; background: var(--beige); color: var(--ink); text-decoration: none; font-weight: 500; }
.did-chip.src-mail { background: #E1EAF3; color: var(--prussian); }
.did-chip.src-ręcznie { background: #EFE6F0; color: #5B3263; }
.did-chip.src-brak { background: var(--burgundy); color: var(--cream); }
.did-chip.did-warn { background: #F3EBD6; color: #765410; }

.welcome { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.welcome > * { min-width: 0; }
.welcome-main { padding: 30px 32px; }
.welcome-main h2 { font-size: 30px; margin-bottom: 22px; }
.welcome-steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 18px; }
.welcome-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; color: var(--muted); }
.welcome-steps span { width: 34px; height: 34px; border-radius: 50%; background: var(--prussian); color: var(--cream); display: grid; place-items: center; font: 500 18px/1 var(--serif); }
.welcome-steps b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.welcome-side .eyebrow { margin-bottom: 12px; }
.sample-go em { display: block; font-style: normal; color: var(--prussian); font-weight: 600; font-size: 13px; margin-top: 10px; }
.sample-go:hover em { text-decoration: underline; }
@media (max-width: 980px) { .welcome { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .welcome-main { padding: 22px 20px; } .welcome-main h2 { font-size: 25px; } }

/* ---------- v0.2: kartoteka, statusy, moduły, pomiar ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-n { font: 400 26px/1.1 var(--serif); color: var(--prussian); font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.stat-n.stat-warn { color: #765410; }
.stat-l { font-size: 12.5px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--beige); border-radius: 8px; padding: 3px; }
.seg a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 13px; padding: 6px 12px; border-radius: 6px; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(13,34,56,.08); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { text-decoration: none; font-size: 12.5px; font-weight: 500; color: var(--ink); background: #fff; border: 1px solid var(--line); padding: 5px 10px; border-radius: 99px; }
.chip b { font-weight: 600; color: var(--muted); margin-left: 2px; }
.chip.on { background: var(--prussian); border-color: var(--prussian); color: var(--cream); }
.chip.on b { color: #C9D5E2; }
.search { margin-left: auto; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 220px; color: var(--ink); }
.list td.when b { font-weight: 600; white-space: nowrap; }
.empty-sm { padding: 40px 20px; }

.ev { display: inline-block; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 99px; white-space: nowrap; background: var(--beige); color: var(--ink); }
.ev-oferta { background: #E1EAF3; color: var(--prussian); }
.ev-potwierdzone { background: #E3EFE8; color: #2F6B4F; }
.ev-zrealizowane { background: #DDE3EA; color: #3B4A5A; }
.ev-anulowane { background: #F1E4E6; color: var(--burgundy); text-decoration: line-through; }

.ev-flow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -12px 0 22px; }
.ev-flow-l { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.ev-steps { display: inline-flex; flex-wrap: wrap; background: var(--beige); border-radius: 10px; padding: 3px; gap: 2px; }
.ev-step { font: 500 13px/1 var(--sans); border: 0; background: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.ev-step:hover { color: var(--ink); }
.ev-step.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(13,34,56,.1); }
.ev-step.on.ev-potwierdzone { color: #2F6B4F; }
.ev-step.on.ev-anulowane { color: var(--burgundy); }

.metric h3 { margin-bottom: 4px; }
.metric-big { font: 400 30px/1.1 var(--serif); color: var(--prussian); margin: 6px 0 2px; }
.hist { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.hist summary { cursor: pointer; color: var(--prussian); font-weight: 500; font-size: 13.5px; }
.hist ol { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.hist li { display: grid; grid-template-columns: 74px 1fr; column-gap: 8px; font-size: 12.5px; }
.hist time { color: var(--muted); grid-row: span 2; }
.hist li span { color: var(--muted); grid-column: 2; }

.mod-core { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 26px; margin-bottom: 20px; border-color: var(--prussian); }
.mod-core h2 { margin: 2px 0 6px; }
.mod-core p { margin: 0; color: var(--muted); max-width: 640px; }
.mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mod { padding: 20px 22px; display: flex; flex-direction: column; }
.mod-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mod p { color: var(--muted); font-size: 13.5px; margin: 8px 0 14px; flex: 1; }
.mod-active { border-color: #2F6B4F; }
.mod-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--beige); color: var(--ink); white-space: nowrap; }
.mod-on { background: #E3EFE8; color: #2F6B4F; }
.mod-soon { background: #F3EBD6; color: #765410; }
.mod-link { font-size: 13px; font-weight: 600; text-decoration: none; }
.mod-link:hover { text-decoration: underline; }

@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { margin-left: 0; flex: 1; }
}
@media (max-width: 640px) {
  .mod-grid { grid-template-columns: 1fr; }
  .stat-n { font-size: 22px; }
  .search { min-width: 0; width: 100%; }
  .mod-core { flex-direction: column; }
}
@media (max-width: 640px) {
  .topbar-in { min-width: 0; }
  .nav { overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
  .nav::-webkit-scrollbar { display: none; }
  .ev-steps { width: 100%; }
  .ev-step { padding: 7px 9px; font-size: 12.5px; }
}
@media (max-width: 640px) {
  .list-events thead { display: none; }
  .list-events, .list-events tbody { display: block; }
  .list-events tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .list-events tr:last-child { border-bottom: 0; }
  .list-events td { display: block; padding: 0; border: 0; }
  .list-events td.when { grid-column: 1; }
  .list-events td.guests { grid-column: 2; grid-row: 1; text-align: right; color: var(--muted); }
  .list-events td:nth-child(2) { grid-column: 1 / -1; }
  .list-events td.num { grid-column: 1; text-align: left; font-weight: 600; }
  .list-events td:nth-child(5) { grid-column: 2; grid-row: 3; text-align: right; }
  .list-events td:nth-child(6) { grid-column: 1 / -1; }
}

/* ---------- BEO na węższym ekranie (laptop 13-14") ---------- */
.src-inline { display: none; margin-top: 6px; }
.vat-chip[title] { text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
@media (max-width: 1280px) {
  .beo-grid { grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; }
  .lines th.src, .lines td.src { display: none; }
  .src-inline { display: inline-block; }
  .lines .q { width: 64px; }
  .lines .p { width: 96px; }
  .lines .v { width: 104px; }
  .lines .act { width: 40px; }
  .lines .t { width: 48px; }
  .save-hint { position: absolute; right: 8px; margin-top: 30px; }
  .lines td.act { position: relative; }
}
@media (max-width: 1100px) {
  .beo-grid { grid-template-columns: 1fr; }
  .side { position: static; }
}

/* ---------- pulpit z kalendarzem ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; margin-bottom: 36px; }
.dash > * { min-width: 0; }
.cal { padding: 18px 20px 16px; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-head h2 { font-size: 26px; min-width: 190px; text-align: center; }
.cal-nav { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; text-decoration: none; color: var(--prussian); font-size: 22px; line-height: 1; border: 1px solid var(--line); }
.cal-nav:hover { border-color: var(--prussian); }
.cal-today { font-size: 12.5px; font-weight: 500; text-decoration: none; padding: 6px 10px; border-radius: 8px; background: var(--beige); color: var(--ink); }
.cal-count { margin-left: auto; color: var(--muted); font-size: 13px; }
.cal-note { margin: -4px 0 10px; font-size: 12.5px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-wd { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 7px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #FCFBF7; }
.cal-day { min-height: 96px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.out { background: #FBF9F4; }
.cal-day.out .cal-n { color: #756C5C; }
.cal-n { font-size: 12.5px; font-weight: 600; color: var(--ink); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-n { background: var(--prussian); color: var(--cream); }
.cal-ev { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 11.5px; font-weight: 500; line-height: 1.25; padding: 4px 6px; border-radius: 5px; text-decoration: none; color: var(--ink); background: var(--beige); overflow: hidden; overflow-wrap: anywhere; border-left: 3px solid #B8A877; }
.cal-ev:hover { filter: brightness(.96); }
.cal-ev.ev-oferta { background: #E1EAF3; border-left-color: var(--prussian-l); color: var(--prussian); }
.cal-ev.ev-potwierdzone { background: #E3EFE8; border-left-color: #2F6B4F; color: #234F3B; }
.cal-ev.ev-zrealizowane { background: #E6EAEE; border-left-color: #6B7A8A; color: #3B4A5A; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cal-legend .ev { font-size: 11px; padding: 3px 8px; }
.dash-side { display: flex; flex-direction: column; gap: 16px; }
.dash-side h3 { margin-bottom: 8px; }
.todo, .soon { list-style: none; margin: 0; padding: 0; }
.todo li, .soon li { border-top: 1px solid var(--line); }
.todo li:first-child, .soon li:first-child { border-top: 0; }
.todo a, .soon a { display: block; padding: 9px 0; text-decoration: none; color: var(--ink); }
.todo a:hover b, .soon a:hover b { color: var(--prussian); text-decoration: underline; }
.todo b, .soon b { display: block; font-weight: 600; font-size: 13.5px; }
.todo span, .soon span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.todo em { font-style: normal; }
.soon time { display: block; font-size: 11.5px; letter-spacing: .04em; color: var(--prussian); font-weight: 600; text-transform: uppercase; }
.dash-empty { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
.list-title { font-size: 26px; margin: 0 0 14px; }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .cal { padding: 14px 12px; }
  .cal-head h2 { font-size: 21px; min-width: 0; flex: 1; }
  .cal-day { min-height: 54px; padding: 4px 3px; }
  .cal-ev { display: block; font-size: 0; padding: 0; height: 7px; border-left-width: 0; border-radius: 4px; }
  .cal-wd { padding: 6px 2px; text-align: center; letter-spacing: 0; }
  .cal-n { font-size: 11.5px; width: 20px; height: 20px; }
  .cal-count { width: 100%; margin-left: 0; }
}

/* ---------- oferta hotelu: import i edytor ---------- */
.alert-ok { background: #E3EFE8; color: #234F3B; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.import-card { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; padding: 24px 26px; margin-bottom: 24px; align-items: center; border-color: var(--prussian); }
.import-text h3 { font-size: 22px; margin: 2px 0 6px; }
.import-text p { color: var(--muted); margin: 0 0 6px; font-size: 13.5px; }
.import-form { display: flex; flex-direction: column; gap: 10px; }
.import-form .code-input { max-width: none; }
.file-drop { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1.5px dashed var(--line); border-radius: 10px; padding: 18px; cursor: pointer; background: #FCFBF7; text-align: center; }
.file-drop:hover { border-color: var(--prussian); }
.file-drop input { font: inherit; font-size: 13px; max-width: 100%; }
.file-drop span { font-weight: 600; color: var(--prussian); margin-top: 6px; }
.file-drop small { color: var(--muted); }
.reset-form { margin-top: 18px; text-align: right; }
.head-actions { display: flex; gap: 10px; }
.cfg-hotel { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 14px; margin-bottom: 8px; }
.cfg-hotel label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.cfg-hotel input { font: inherit; text-transform: none; letter-spacing: 0; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.cfg-h { font-size: 24px; margin: 26px 0 10px; }
table.edit { width: 100%; border-collapse: collapse; }
table.edit th { text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 10px; border-bottom: 1px solid var(--line); background: #FCFBF7; }
table.edit th.num { text-align: right; }
table.edit td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.edit tr:last-child td { border-bottom: 0; }
table.edit input, table.edit select { font: inherit; font-size: 13.5px; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
table.edit input.desc { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
table.edit td.n { width: 78px; } table.edit td.n input { text-align: right; }
table.edit td.p { width: 120px; } table.edit td.p input { text-align: right; }
table.edit td.x { width: 64px; font-size: 12px; color: var(--muted); white-space: nowrap; padding-top: 14px; }
table.edit td.x input { width: auto; }
table.edit tr.row-warn td { background: #FBF4E2; }
.warn-note { display: block; color: #8A6512; font-weight: 600; font-size: 11.5px; margin-top: 4px; }
.add-row { margin-top: 10px; }
.cfg-save { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
@media (max-width: 980px) {
  .import-card, .cfg-hotel { grid-template-columns: 1fr; }
  table.edit { min-width: 760px; }
}
.file-drop { position: relative; }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-drop span { margin-top: 0; overflow-wrap: anywhere; }

/* ---------- poprawki po przeglądzie interfejsu (31.10.2026) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.unit { display: block; text-align: right; color: var(--muted); font-size: 12px; padding-inline-end: 8px; margin-top: 2px; }
/* opisy w wierszu bez ceny: ciemniejszy szary, żeby był czytelny na różowym tle */
.lines tr.missing .t, .lines tr.missing .pos small, .lines tr.missing .vat-chip, .lines tr.missing .unit { color: #4A5868; }
.working-card:focus { outline: none; }
/* skrócona nazwa w kalendarzu: bez prześwitu trzeciej linii w dolnym marginesie */
.cal-ev { padding-bottom: 0; border-bottom: 4px solid transparent; }
@media (max-width: 640px) { .cal-ev { border-bottom: 0; } }

/* okno potwierdzenia nieodwracalnych akcji */
.confirm { border: 0; border-radius: 14px; padding: 26px 28px 22px; width: min(420px, calc(100% - 32px)); background: var(--cream); color: var(--ink); box-shadow: 0 20px 60px rgba(13,34,56,.3); }
.confirm::backdrop { background: rgba(13, 34, 56, .55); }
.confirm p { margin: 0 0 20px; font-size: 15px; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.btn-danger { background: var(--burgundy); color: var(--cream); }
.btn-danger:hover { background: #64121F; }
html:has(.confirm[open]) { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .working-steps li.now::before { animation: none; border-right-color: var(--prussian); }
  .toast { transform: translate(-50%, 0); transition: opacity .2s; }
}

@media (max-width: 640px) {
  /* menu: łamie się na dwie linie zamiast chować pozycje poza ekranem */
  .topbar-in { height: auto; min-height: 56px; flex-wrap: wrap; padding-block: 8px; row-gap: 4px; }
  .nav { overflow: visible; flex-wrap: wrap; flex: 1 1 auto; }
  /* pola co najmniej 16 px: Safari na iPhonie nie powiększa wtedy strony */
  textarea, input, select, .search, .code-input, .lines input, .add-form input, .add-form select, table.edit input, table.edit select, .cfg-hotel input { font-size: 16px; }
  /* kalendarz: wydarzenie jako blok 24 px, łatwy do trafienia palcem */
  .cal-day { min-height: 54px; }
  .cal-ev { height: 24px; border-radius: 5px; }
  /* tabela pozycji jako karty: nazwa, potem ilość, cena i wartość obok siebie */
  .lines, .lines tbody { display: block; }
  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "pos pos act" "q p v"; gap: 6px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .lines tr:last-child { border-bottom: 0; }
  .lines td { display: block; padding: 0; border: 0; width: auto !important; }
  .lines tr.missing { background: var(--missing); }
  .lines .pos { grid-area: pos; }
  .lines td.act { grid-area: act; justify-self: end; display: flex; gap: 6px; align-items: flex-start; padding: 0; position: static; }
  .lines .q { grid-area: q; } .lines .p { grid-area: p; } .lines .v { grid-area: v; padding-top: 0; align-self: center; }
  .lines .q::before, .lines .p::before, .lines .v::before { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; text-align: right; font-weight: 500; }
  .lines .q::before { content: "Ilość"; } .lines .p::before { content: "Cena brutto"; } .lines .v::before { content: "Wartość"; }
  .lines input { border-color: var(--line); background: #fff; }
  .save-hint { position: static; margin: 0; }
  .lines .t, .lines td.src { display: none; }
}

/* ---------- konta: logowanie, zespół, panel Āori ---------- */
.topbar .hotel a.me { color: #9FB3C8; text-decoration: none; }
.topbar .hotel a.me:hover { color: var(--cream); text-decoration: underline; }
.logout { margin: 0; }
.btn-out { background: none; border: 1px solid rgba(250,247,240,.25); color: var(--cream); font: inherit; font-size: 12.5px; padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.btn-out:hover { background: rgba(250,247,240,.08); }
.aori-bar form { display: inline; margin: 0; }
.aori-bar button { background: none; border: 0; padding: 0; font: inherit; color: var(--prussian); font-weight: 500; text-decoration: underline; cursor: pointer; }
main.bare { display: flex; justify-content: center; }
.auth { width: 100%; max-width: 420px; margin: 24px auto 40px; padding: 32px; }
.auth h1 { font-size: 34px; margin-bottom: 6px; }
.auth .lead { margin: 0 0 22px; }
.auth .links { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-stack .btn { align-self: flex-start; }
.field input, .field select, .inline-form input, .inline-form select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.inline-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: end; }
.inline-form .btn { white-space: nowrap; }
.link-box { display: flex; gap: 8px; margin-top: 8px; }
.link-box input { flex: 1; min-width: 0; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.row-actions select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.muted-row td { color: var(--muted); }
.badge { display: inline-block; font-size: 11px; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; background: var(--beige); color: var(--ink); white-space: nowrap; }
.badge-off { background: var(--missing); color: var(--burgundy); }
.badge-wait { background: #FFF4D6; color: #6B4E00; }
.section { margin-top: 32px; }
.section h2 { margin-bottom: 12px; }
@media (max-width: 760px) {
  .inline-form { grid-template-columns: 1fr; }
  .auth { padding: 24px 18px; margin-top: 8px; }
  .field input, .field select, .inline-form input, .inline-form select, .link-box input, .row-actions select { font-size: 16px; }
}
.welcome-solo, .grid-solo { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.mail-in { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: center; margin-bottom: 20px; }
.mail-in p { margin: 0; color: var(--ink); }
.mail-addr { display: flex; gap: 8px; }
.mail-addr input { flex: 1; min-width: 0; font: 500 14px/1.4 var(--sans); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); color: var(--prussian); }
.mail-list { margin-bottom: 24px; }
.mail-err { color: var(--burgundy) !important; }
.mail-gotowe { background: #E3EFE8; color: #234F3B; }
.mail-blad, .mail-odrzucony { background: var(--missing); color: var(--burgundy); }
.mail-czeka, .mail-przetwarzanie { background: #FFF4D6; color: #6B4E00; }
.domains-form { grid-template-columns: 1fr auto; }
@media (max-width: 760px) { .mail-in, .domains-form { grid-template-columns: 1fr; } .mail-addr input { font-size: 16px; } }
