/* ───────── EDUCA Apartaments – system projektowy (współdzielony: strona + panel admina) ───────── */
:root {
  --bg: #07090d; --bg2: #0b0f16; --bg3: #10161f; --bg4: #161d29;
  --panel: rgba(255,255,255,.035); --panel2: rgba(255,255,255,.065);
  --line: rgba(255,255,255,.09); --line2: rgba(255,255,255,.17);
  --tx: #eef1f6; --tx2: #b6bdca; --tx3: #818b9b;
  --ice: #9fd8ff; --ice2: #6aa9ff; --plat: #dfe5ee; --steel: #8fa3bd;
  --ok: #5bd69d; --warn: #f3b65c; --err: #ff7b7b; --info: #7fb4ff;
  --serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --ease2: cubic-bezier(.77, 0, .18, 1);
  --r: 20px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 400 16px/1.7 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; font-feature-settings: 'lnum' 1; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 500; line-height: 1.05; letter-spacing: -.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(159,216,255,.3); color: #fff; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; border-radius: 6px; }
.container { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mute { color: var(--tx3); }
.center { text-align: center; }
.eyebrow { font: 600 .72rem/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--ice); display: inline-flex; align-items: center; gap: 14px; }
.eyebrow::before { content: ''; width: 36px; height: 1px; background: linear-gradient(90deg, transparent, var(--ice)); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #232c3b; border-radius: 10px; border: 2px solid var(--bg); } ::-webkit-scrollbar-track { background: var(--bg); }

/* ───────── przyciski ───────── */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .65em; padding: 1em 1.7em; border-radius: 999px; border: 1px solid transparent; font: 600 .88rem/1 var(--sans); letter-spacing: .03em; cursor: pointer; overflow: hidden; white-space: nowrap; transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s, border-color .3s, color .3s, opacity .3s; will-change: transform; -webkit-tap-highlight-color: transparent; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-primary { background: linear-gradient(135deg, #f7f9fc 0%, #cdd7e4 100%); color: #0a0e15; box-shadow: 0 10px 30px -10px rgba(159,216,255,.45), inset 0 1px 0 #fff; }
.btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.85) 50%, transparent 70%); transform: translateX(-130%); transition: transform .9s var(--ease); }
.btn-primary:hover { box-shadow: 0 16px 40px -10px rgba(159,216,255,.65), inset 0 1px 0 #fff; }
.btn-primary:hover::after { transform: translateX(130%); }
.btn-ghost { background: rgba(255,255,255,.04); border-color: var(--line2); color: var(--tx); backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: var(--ice); color: var(--ice); background: rgba(159,216,255,.07); }
.btn-ok { background: linear-gradient(135deg, #7fe8b9, #3fbf86); color: #04170f; box-shadow: 0 10px 30px -12px rgba(91,214,157,.6); }
.btn-ok:hover { box-shadow: 0 14px 36px -10px rgba(91,214,157,.8); }
.btn-warn { background: rgba(243,182,92,.1); border-color: rgba(243,182,92,.5); color: var(--warn); }
.btn-warn:hover { background: rgba(243,182,92,.18); }
.btn-danger { background: rgba(255,123,123,.08); border-color: rgba(255,123,123,.4); color: var(--err); }
.btn-danger:hover { background: rgba(255,123,123,.16); }
.btn-sm { padding: .72em 1.2em; font-size: .8rem; }
.btn-lg { padding: 1.15em 2.1em; font-size: .95rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .5; pointer-events: none; }
.btn.is-busy::before { content: ''; width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.link { color: var(--ice); border-bottom: 1px solid rgba(159,216,255,.3); transition: border-color .3s, color .3s; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0; padding: 0; }
.link:hover { border-bottom-color: var(--ice); }
.iconbtn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line2); background: rgba(255,255,255,.04); display: inline-grid; place-items: center; cursor: pointer; transition: .3s var(--ease); }
.iconbtn:hover { border-color: var(--ice); color: var(--ice); transform: scale(1.06); }
.iconbtn svg { width: 18px; height: 18px; }

/* ───────── formularze ───────── */
.field { display: grid; gap: 7px; min-width: 0; }
.field > label, .lbl { font: 600 .7rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--tx3); }
.field input, .field select, .field textarea, .input { width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--line2); border-radius: 13px; padding: .92em 1.05em; color: var(--tx); font: 500 .95rem/1.3 var(--sans); transition: border-color .25s, box-shadow .25s, background .25s; min-width: 0; }
.field input::placeholder { color: #566074; }
.field input:hover, .field select:hover { border-color: rgba(255,255,255,.28); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--ice); box-shadow: 0 0 0 4px rgba(159,216,255,.12); background: rgba(159,216,255,.04); }
.field select { appearance: none; -webkit-appearance: none; padding-right: 2.6em; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239fd8ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 1em center; }
.field select option { background: #10161f; color: var(--tx); }
.field input[type=date] { color-scheme: dark; }
.field .hint { font-size: .78rem; color: var(--tx3); }
.field .errmsg { display: none; font-size: .78rem; color: var(--err); }
.field.err input, .field.err select { border-color: var(--err); box-shadow: 0 0 0 4px rgba(255,123,123,.1); }
.field.err .errmsg { display: block; }
.pw { position: relative; }
.pw input { padding-right: 3.2em; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--tx3); cursor: pointer; border-radius: 10px; display: grid; place-items: center; }
.pw button:hover { color: var(--ice); }
.pw button svg { width: 18px; height: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.stack { display: grid; gap: 14px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: .86rem; color: var(--tx2); line-height: 1.5; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); display: grid; place-items: center; transition: .25s var(--ease); margin-top: 1px; }
.check .box svg { width: 14px; height: 14px; stroke: #07090d; stroke-width: 3; fill: none; opacity: 0; transform: scale(.4); transition: .25s var(--ease); }
.check input:checked + .box { background: var(--ice); border-color: var(--ice); }
.check input:checked + .box svg { opacity: 1; transform: none; }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px rgba(159,216,255,.2); }
.check.err .box { border-color: var(--err); }
.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); transition: border-color .3s, background .3s; }
.switch:hover { border-color: var(--line2); }
.switch input { position: absolute; opacity: 0; }
.switch .track { flex: none; width: 46px; height: 26px; border-radius: 99px; background: rgba(255,255,255,.12); position: relative; transition: background .3s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .35s var(--ease); }
.switch input:checked + .track { background: var(--ice2); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(159,216,255,.2); }
.switch b { display: block; font-weight: 600; font-size: .92rem; }
.switch small { color: var(--tx3); font-size: .8rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 999px; background: rgba(255,255,255,.04); overflow: hidden; }
.stepper button { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; font-size: 1.25rem; line-height: 1; color: var(--tx); transition: background .2s, color .2s; }
.stepper button:hover:not([disabled]) { background: rgba(159,216,255,.12); color: var(--ice); }
.stepper button[disabled] { opacity: .3; cursor: not-allowed; }
.stepper output { min-width: 44px; text-align: center; font: 700 1rem/1 var(--sans); font-variant-numeric: lining-nums tabular-nums; }

/* ───────── odznaki ───────── */
.badge { display: inline-flex; align-items: center; gap: .5em; padding: .42em .85em; border-radius: 999px; font: 700 .68rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line2); color: var(--tx2); background: rgba(255,255,255,.04); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); border-color: rgba(91,214,157,.4); background: rgba(91,214,157,.08); }
.badge.warn { color: var(--warn); border-color: rgba(243,182,92,.4); background: rgba(243,182,92,.08); }
.badge.err { color: var(--err); border-color: rgba(255,123,123,.4); background: rgba(255,123,123,.08); }
.badge.info { color: var(--info); border-color: rgba(127,180,255,.4); background: rgba(127,180,255,.08); }
.badge.pulse::before { animation: pulse 1.6s ease-in-out infinite; }

/* ───────── modal ───────── */
.modal { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 20px; background: rgba(3,5,9,.74); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); opacity: 0; transition: opacity .35s var(--ease); overscroll-behavior: contain; }
.modal.open { opacity: 1; }
.sheet { width: min(var(--w, 580px), 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: linear-gradient(180deg, #131a26 0%, #0d1219 100%); border: 1px solid var(--line2); border-radius: 26px; box-shadow: 0 50px 140px rgba(0,0,0,.65), 0 0 0 1px rgba(159,216,255,.04) inset; transform: translateY(28px) scale(.98); opacity: 0; transition: transform .5s var(--ease), opacity .4s var(--ease); overflow: hidden; }
.modal.open .sheet { transform: none; opacity: 1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 26px 0; }
.sheet-head h3 { font-size: 1.9rem; }
.sheet-body { padding: 22px 26px 28px; overflow: auto; overscroll-behavior: contain; }
.sheet-body::-webkit-scrollbar { width: 6px; }
@media (max-width: 640px) {
  .modal { place-items: end center; padding: 0; }
  .sheet { border-radius: 26px 26px 0 0; max-height: 94dvh; width: 100%; }
  .sheet-head { padding: 18px 20px 0; } .sheet-body { padding: 18px 20px 26px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ───────── toasty ───────── */
#toasts { position: fixed; top: 84px; right: 20px; z-index: 1200; display: grid; gap: 10px; width: min(380px, calc(100% - 40px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: rgba(16,22,31,.94); border: 1px solid var(--line2); backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0,0,0,.5); font-size: .9rem; line-height: 1.45; transform: translateX(30px); opacity: 0; transition: .5s var(--ease); }
.toast.in { transform: none; opacity: 1; }
.toast i { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--info); box-shadow: 0 0 12px currentColor; }
.toast.ok i { background: var(--ok); } .toast.err i { background: var(--err); } .toast.warn i { background: var(--warn); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--ice); animation: spin .8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
}

/* domyślny rozmiar ikon (zerowa specyficzność – każda reguła klasy ma pierwszeństwo) */
:where(svg[viewBox="0 0 24 24"]:not([width])) { width: 1.15em; height: 1.15em; flex: none; }
.rc-note svg { vertical-align: -3px; margin-right: 4px; }
