@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 { font-family: var(--serif); font-weight: 600; 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 { 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: 600 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: #8A6512; }
.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, input:focus, select:focus { outline: 2px solid rgba(27,58,92,.25); 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: 600 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); }
.ld-paint { stroke-dasharray: 100 100; animation: ld-paint 2.6s cubic-bezier(.55,.1,.35,1) infinite; }
@keyframes ld-paint { 0% { stroke-dashoffset: 100; } 50% { stroke-dashoffset: 0; } 62% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) { .ld-paint { animation: none; stroke-dashoffset: 0; } }
@keyframes aori-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .working-logo { animation: none; } }
.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: #8A6512; }

.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: 600 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; } }
