/* Panel Pielgrzymki24 — design tokens */
:root {
  --ink: #1e2833; --ink-2: #4b5563; --muted: #7b8794;
  --paper: #f5f4ef; --card: #ffffff; --line: #e3e0d7; --line-2: #eeece5;
  --navy: #143a5c; --navy-2: #0f2b45; --navy-ink: #d9e2ec; --gold: #f2c46b;
  --accent: #b8651a; --accent-2: #9c5313; --accent-soft: #fbeedd;
  --ok: #2f7d4f; --ok-soft: #e3f2e8; --warn: #a8700f; --warn-soft: #fbf0d6; --bad: #b23a3a; --bad-soft: #f9e4e4; --new: #1d5fa5; --new-soft: #e1ecf9;
  --r: 6px; --r-lg: 10px; --side: 232px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.05rem; }
code, .mono { font-family: ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace; font-size: .86em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .sub { color: var(--muted); font-size: .84rem; } .small { font-size: .8rem; }
.strong { font-weight: 600; } .mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }
.ta-r { text-align: right; } .ta-c { text-align: center; }
.inline { display: inline; }
.hidden-form { display: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--navy); color: var(--navy-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 18px 18px 14px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand:hover { text-decoration: none; }
.brand__mark { grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 7px; background: var(--navy-2); position: relative; }
.brand__mark::before, .brand__mark::after { content: ''; position: absolute; background: var(--gold); border-radius: 2px; }
.brand__mark::before { width: 3px; height: 20px; left: 13.5px; top: 5px; } .brand__mark::after { width: 14px; height: 3px; left: 8px; top: 11px; }
.brand__mark--lg { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 10px; }
.brand__mark--lg::before { width: 5px; height: 36px; left: 25.5px; top: 10px; } .brand__mark--lg::after { width: 26px; height: 5px; left: 15px; top: 21px; }
.brand__name { font-weight: 600; font-size: 1rem; line-height: 1.1; } .brand__sub { font-size: .75rem; color: var(--navy-ink); opacity: .7; }
.nav { padding: 10px 10px; flex: 1; }
.nav__group { font-size: .7rem; letter-spacing: .04em; color: rgba(217,226,236,.55); padding: 14px 10px 4px; }
.nav__item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); color: var(--navy-ink); font-size: .92rem; }
.nav__item:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav__item.is-active { background: rgba(255,255,255,.13); color: #fff; }
.nav__item .ico { width: 18px; height: 18px; opacity: .8; }
.nav__badge { margin-left: auto; background: var(--gold); color: var(--navy-2); font-size: .72rem; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.side__foot { padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .84rem; }
.side__user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 22px 30px 60px; max-width: 1280px; width: 100%; min-width: 0; }
.ico { width: 18px; height: 18px; vertical-align: -3px; }

/* ---- topbar ---- */
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar__sub { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.topbar__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { display: inline-block; font-size: .84rem; color: var(--muted); margin-bottom: 4px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.is-active { color: var(--navy); border-color: var(--accent); font-weight: 600; }
.tabs b { font-weight: 500; color: var(--muted); font-size: .8rem; margin-left: 4px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer; line-height: 1.25; white-space: nowrap; }
.btn:hover { background: #fbfaf7; text-decoration: none; border-color: #cfcbbf; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: rgba(0,0,0,.05); border-color: transparent; }
.btn--danger { color: var(--bad); } .btn--danger:hover { background: var(--bad-soft); }
.btn--sm { padding: 4px 10px; font-size: .82rem; }
.btn--block { width: 100%; justify-content: center; }
.btn .ico { width: 15px; height: 15px; }
.link { font-size: .86rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.seg a, .seg button { padding: 6px 12px; font: inherit; font-size: .85rem; color: var(--ink-2); background: none; border: 0; border-right: 1px solid var(--line); cursor: pointer; }
.seg a:last-child, .seg button:last-child { border-right: 0; }
.seg a:hover, .seg button:hover { background: #fbfaf7; text-decoration: none; }
.seg .is-active { background: var(--navy); color: #fff; }

/* ---- cards, stats ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 18px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.card__head.pad { padding: 16px 20px 6px; margin: 0; }
.card__title { margin-bottom: 12px; font-size: .95rem; color: var(--ink-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.stat:hover { text-decoration: none; border-color: #cfcbbf; }
.stat b { font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: .84rem; color: var(--muted); }
.empty { color: var(--muted); margin: 6px 0; } .empty.pad { padding: 8px 20px 16px; }

/* ---- timeline (najbliższe wyjazdy) ---- */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl { display: grid; grid-template-columns: 96px 1fr 150px; gap: 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.tl:first-child { border-top: 0; }
.tl__date { border-left: 3px solid var(--gold); padding-left: 10px; line-height: 1.2; }
.tl__date b { display: block; font-size: 1.05rem; } .tl__date span { font-size: .78rem; color: var(--muted); }
.tl__title { font-weight: 600; } .tl__meta { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.tl__occ { text-align: right; font-size: .88rem; } .tl__occ b { font-size: 1.05rem; }
.bar { height: 5px; background: var(--line-2); border-radius: 3px; margin-top: 5px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--navy); }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 500; font-size: .78rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfaf7; }
.table td { padding: 9px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfbf8; }
.table--compact td { padding: 7px 4px; } .table--compact th { padding: 6px 4px; }
.table .td-img { width: 58px; padding-right: 0; } .table .td-img img { width: 44px; height: 34px; object-fit: cover; border-radius: 4px; display: block; }
.img-ph { display: block; width: 44px; height: 34px; border-radius: 4px; background: var(--line-2); }
.table tr.is-off td { opacity: .55; } .table tr.is-unread td { background: #fff8ea; }
.table tr.is-today td { background: var(--accent-soft); }
.table__group td { background: #f1efe8 !important; font-weight: 600; font-size: .8rem; text-transform: capitalize; padding: 6px 14px; color: var(--ink-2); }
.table select { padding: 3px 24px 3px 8px; font-size: .84rem; }
.select--ok { color: var(--ok); } .select--warn { color: var(--warn); } .select--bad { color: var(--bad); } .select--muted { color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line); } .dot--on { background: var(--ok); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .74rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.badge--ok { background: var(--ok-soft); color: var(--ok); } .badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); } .badge--muted { background: var(--line-2); color: var(--ink-2); } .badge--new { background: var(--new-soft); color: var(--new); }
.switch { width: 34px; height: 20px; border-radius: 10px; background: var(--line); border: 0; position: relative; cursor: pointer; padding: 0; vertical-align: middle; }
.switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.is-on { background: var(--ok); } .switch.is-on i { left: 16px; }
.pager { display: flex; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager span { padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font-size: .85rem; }
.pager a.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.log { list-style: none; padding: 0; margin: 0; font-size: .84rem; } .log li { padding: 4px 0; border-top: 1px solid var(--line-2); } .log li:first-child { border-top: 0; } .log em { font-style: normal; color: var(--ink-2); }
.list { list-style: none; padding: 0; margin: 0; } .list li { padding: 4px 0; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: .88rem; } .dl dt { color: var(--muted); } .dl dd { margin: 0; }

/* ---- filters ---- */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters__search { min-width: 240px; }
.filters select, .filters input { padding: 6px 10px; }

/* ---- forms ---- */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  font: inherit; font-size: .92rem; color: var(--ink); background: #fff; border: 1px solid #cfcbbf; border-radius: var(--r); padding: 7px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 2px solid rgba(20,58,92,.15); }
input[readonly], textarea[readonly] { background: #f7f6f2; color: var(--ink-2); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237b8794' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
textarea { resize: vertical; line-height: 1.45; }
input[type=file] { font-size: .85rem; }
.form__cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.form__side { position: sticky; top: 18px; }
.fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px 14px; }
.fields > * { grid-column: span 6; }
.fields > .half { grid-column: span 3; } .fields > .third { grid-column: span 2; } .fields > .sixth { grid-column: span 1; }
.fields--stack > * { grid-column: span 6 !important; }
.fields--stack > .half { grid-column: span 3 !important; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .lbl { font-size: .82rem; font-weight: 500; color: var(--ink-2); display: block; }
.field em { color: var(--bad); font-style: normal; }
.field small, .lbl small { color: var(--muted); font-size: .78rem; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; padding-top: 4px; }
.check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy); margin: 0; }
.check small { color: var(--muted); font-size: .78rem; }
.check--inline { display: inline-flex; margin-right: 12px; padding: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.row-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.upload__cur { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.upload__cur img { max-width: 160px; max-height: 100px; border-radius: 4px; border: 1px solid var(--line); }
.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 16px; font-size: .9rem; border: 1px solid transparent; }
.flash--ok { background: var(--ok-soft); color: var(--ok); border-color: #c6e4d0; }
.flash--error { background: var(--bad-soft); color: var(--bad); border-color: #efc9c9; }
.flash--info { background: var(--new-soft); color: var(--new); }

/* editor */
.editor { border: 1px solid #cfcbbf; border-radius: var(--r); overflow: hidden; background: #fff; }
.editor__bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line-2); background: #fbfaf7; }
.editor__toggle.is-active { background: var(--line-2); font-weight: 600; }
.editor__source { border: 0; border-radius: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; }
.editor.is-wysiwyg .editor__source { display: none; }
.editor:not(.is-wysiwyg) .editor__wysiwyg { display: none; }
.editor .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line-2); font-family: var(--font); }
.editor .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: .92rem; }
.editor .ql-editor { min-height: 160px; max-height: 520px; overflow: auto; }
.editor[data-editor=short] .ql-editor { min-height: 80px; }
.prose ul, .prose ol { padding-left: 1.2em; } .prose p { margin: .4em 0; }
.import-box { border: 1px dashed var(--line); border-radius: var(--r); padding: 10px 12px; margin: 8px 0; font-size: .88rem; }

/* terminy */
.termin { border-top: 1px solid var(--line-2); }
.termin > summary { display: grid; grid-template-columns: 250px 170px 1fr 170px auto; gap: 12px; align-items: center; padding: 10px 20px; cursor: pointer; list-style: none; font-size: .9rem; }
.termin > summary::-webkit-details-marker { display: none; }
.termin > summary:hover { background: #fcfbf8; }
.termin[open] > summary { background: #f7f5ee; }
.termin.is-off > summary { color: var(--muted); } .termin.is-past > summary .termin__date { text-decoration: line-through; text-decoration-color: var(--line); }
.termin__price { font-weight: 600; } .termin__occ { text-align: right; }
.termin__body { padding: 14px 20px 18px; border-top: 1px solid var(--line-2); background: #fdfcfa; }
.termin--new > summary { grid-template-columns: 1fr; color: var(--accent); }
.miejsca td, .miejsca th { padding: 4px 6px; } .miejsca select, .miejsca input { padding: 5px 8px; font-size: .86rem; }
[data-collapsed] { opacity: .85; }

/* galeria */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery__item { margin: 0; position: relative; border: 2px solid transparent; border-radius: var(--r); overflow: hidden; cursor: grab; background: var(--line-2); }
.gallery__item.is-main { border-color: var(--gold); }
.gallery__item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery__item figcaption { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.gallery__item figcaption .btn { color: #fff; }
.gallery__item.is-dragging { opacity: .4; }

/* uczestnicy */
.participant { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px 14px; margin: 0 0 12px; }
.participant legend { font-weight: 600; padding: 0 6px; }

/* menu */
.menu-tree { list-style: none; padding: 0; margin: 0; } .menu-tree--sub { padding-left: 26px; }
.menu-item { border: 1px solid var(--line); border-radius: var(--r); margin: 6px 0; background: #fff; }
.menu-item > summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; list-style: none; }
.menu-item > summary::-webkit-details-marker { display: none; }
.menu-item.is-off > summary b { color: var(--muted); }
.menu-item .drag { color: var(--muted); cursor: grab; }
.menu-edit { padding: 10px 12px 14px; border-top: 1px solid var(--line-2); }
.menu-tree li.is-dragging > .menu-item { opacity: .4; }

/* login */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--navy); }
.login { width: 360px; }
.login__brand { text-align: center; color: #fff; margin-bottom: 22px; } .login__brand h1 { font-size: 1.4rem; } .login__brand p { margin: 2px 0 0; opacity: .7; font-size: .9rem; }
.login__form { background: var(--card); border-radius: var(--r-lg); padding: 24px; display: grid; gap: 14px; }
.login__form .field span { font-size: .84rem; font-weight: 500; color: var(--ink-2); }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; }
  .form__cols { grid-template-columns: 1fr; } .form__side { position: static; }
  .termin > summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; } .nav__group { width: 100%; padding-top: 6px; }
  .main { padding: 16px; } .fields > .half, .fields > .third { grid-column: span 6; } .fields > .sixth { grid-column: span 3; }
  .tl { grid-template-columns: 80px 1fr; } .tl__occ { grid-column: 2; text-align: left; }
}
