/* ==========================================================================
   Kwiaty – wspólny arkusz stylów dla całej strony i panelu administracyjnego
   Kolory pastelowe, układ responsywny (telefon → komputer)
   ========================================================================== */

:root {
  /* paleta */
  --bg: #fff9f7;
  --surface: #ffffff;
  --ink: #3f2f3c;
  --ink-soft: #6e5a69;
  --muted: #9a8794;
  --line: #f1e3e8;

  --rose: #f7d3de;
  --rose-2: #fbe7ed;
  --rose-deep: #c25d84;
  --rose-dark: #a2486c;
  --lavender: #e6dcf7;
  --mint: #d5efe4;
  --peach: #fde3d2;
  --butter: #fbf0c9;
  --sky: #dbe9f8;

  --ok: #3f8f6b;
  --err: #c0435a;

  /* typografia */
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* kształty */
  --r: 20px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(120, 60, 90, .05), 0 8px 24px -12px rgba(160, 80, 120, .22);
  --shadow-lg: 0 2px 4px rgba(120, 60, 90, .05), 0 22px 48px -20px rgba(160, 80, 120, .35);
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  font: 400 17px/1.65 var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 100% -10%, var(--rose-2), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, #f3edfb, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rose-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rose-deep); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: .2em 0 .25em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); }
h3 { font-size: 1.15rem; }
:focus-visible { outline: 3px solid #e7a3bb; outline-offset: 2px; border-radius: 6px; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 10px; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

/* ---------- tony pastelowe (kafelki, nagłówki) ---------- */
.tone-1 { --t: var(--rose);     --t-ink: #a2486c; }
.tone-2 { --t: var(--lavender); --t-ink: #7357a8; }
.tone-3 { --t: var(--mint);     --t-ink: #3f8f6b; }
.tone-4 { --t: var(--peach);    --t-ink: #c06a3d; }
.tone-5 { --t: var(--sky);      --t-ink: #4f77a8; }

/* ---------- przyciski, chipy, formularze ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font: 700 .95rem/1 var(--font-body);
  padding: .8em 1.3em; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--rose-deep); color: #fff; text-decoration: none;
  box-shadow: 0 6px 16px -8px rgba(194, 93, 132, .8);
  transition: transform .15s, background .15s;
}
.btn:hover { background: var(--rose-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--rose-dark); border: 1.5px solid var(--rose); box-shadow: none; }
.btn-ghost:hover { background: var(--rose-2); color: var(--rose-dark); }
.btn-danger { background: #fff; color: var(--err); border: 1.5px solid #f1c6cf; box-shadow: none; }
.btn-danger:hover { background: #fdecef; color: var(--err); }
.btn-sm { padding: .55em .95em; font-size: .85rem; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--rose-2); color: var(--rose-dark); cursor: pointer; }
.icon-btn .ico { width: 22px; height: 22px; }

.chip {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .3em .8em; border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--t-ink, var(--rose-dark));
  text-decoration: none;
}
.chip-sm { font-size: .68rem; padding: .2em .6em; background: var(--rose-2); color: var(--rose-dark); }
.chip-line { background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .9); text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.chip-line:hover { background: #fff; color: var(--rose-dark); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=url], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: .7em .9em; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #e7a3bb; box-shadow: 0 0 0 4px var(--rose-2); }
textarea { min-height: 120px; resize: vertical; }
label { font-weight: 600; font-size: .92rem; color: var(--ink-soft); }

/* ---------- nagłówek i menu ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 249, 247, .82);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--rose), var(--lavender)); color: var(--rose-deep); }
.brand-mark svg { width: 30px; height: 30px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font: 600 1.35rem/1 var(--font-head); }
.brand-text small { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.brand-sm strong { font: 600 1.2rem/1 var(--font-head); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 4px; font: 600 .97rem/1 var(--font-body);
  color: var(--ink-soft); text-decoration: none; padding: 11px 13px; border-radius: 999px;
  background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.nav-link:hover, .nav-item.open > .nav-link { background: var(--rose-2); color: var(--rose-dark); }
.nav-item.active > .nav-link, .nav-link[aria-current] { color: var(--rose-dark); background: var(--rose-2); }
.nav-link .ico { width: 16px; height: 16px; transition: transform .2s; }
.nav-item.open > .nav-link .ico { transform: rotate(180deg); }
.sub {
  list-style: none; margin: 0; padding: 8px; position: absolute; top: calc(100% + 8px); left: 0; min-width: 250px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .18s;
}
.nav-item.open > .sub { opacity: 1; visibility: visible; transform: none; }
.sub a { display: block; padding: 9px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .95rem; }
.sub a:hover, .sub a[aria-current] { background: var(--rose-2); color: var(--rose-dark); }
.sub .sub-all { font-weight: 700; color: var(--rose-dark); border-bottom: 1px dashed var(--line); border-radius: 10px 10px 0 0; margin-bottom: 4px; }
.nav-search { display: flex; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 4px 0 14px; }
.nav-search input { border: 0; padding: 9px 4px; width: 170px; background: transparent; box-shadow: none !important; }
.nav-search button { border: 0; background: var(--rose-2); color: var(--rose-dark); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.nav-toggle { display: none; margin-left: auto; }

@media (max-width: 1040px) {
  .nav-search input { width: 120px; }
}
@media (max-width: 920px) {
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .nav-toggle { display: inline-grid; }
  .nav {
    position: fixed; inset: 72px 0 0 0; margin: 0; flex-direction: column; align-items: stretch; gap: 16px;
    background: var(--bg); padding: 18px 16px 40px; overflow-y: auto;
    transform: translateX(100%); transition: transform .25s ease; visibility: hidden;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav { transform: none; visibility: visible; }
  .nav-search { order: -1; }
  .nav-search input { width: 100%; padding: 12px 4px; }
  .nav-list { flex-direction: column; gap: 4px; }
  .nav-link { width: 100%; justify-content: space-between; padding: 15px 16px; font-size: 1.05rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
  .sub { position: static; box-shadow: none; border: 0; background: transparent; padding: 4px 0 8px 12px; display: none; opacity: 1; visibility: visible; transform: none; min-width: 0; }
  .nav-item.open > .sub { display: block; }
  .sub a { padding: 11px 14px; }
  .brand-text small { display: none; }
}

/* ---------- strona główna ---------- */
.hero { padding: clamp(32px, 6vw, 72px) 0 clamp(20px, 4vw, 40px); }
.hero-in { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--rose-deep); margin: 0; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin: .15em 0 .5em; line-height: 1.05; }
.hero h1 span { color: var(--rose-deep); font-weight: 400; font-style: italic; }
.hero-meta { margin: 16px 4px 0; color: var(--muted); font-size: .95rem; }
.hero-meta a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.hero-meta a:hover { color: var(--rose-dark); }
.search-big {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 999px; padding: 6px 6px 6px 20px; box-shadow: var(--shadow); max-width: 620px;
}
.search-big > .ico { color: var(--muted); }
.search-big input { border: 0; box-shadow: none !important; padding: 12px 6px; font-size: 1.05rem; background: transparent; }
.center .search-big { margin: 22px auto 0; }
.daily {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px;
  padding: 30px; border-radius: 28px; text-decoration: none; color: var(--ink);
  background: linear-gradient(150deg, var(--t), #fff 120%); box-shadow: var(--shadow-lg);
  transition: transform .2s;
}
.daily:hover { transform: translateY(-3px); color: var(--ink); }
.daily-label { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--t-ink); }
.daily strong { font: 600 2rem/1.1 var(--font-head); margin-top: 60px; }
.daily em { color: var(--ink-soft); }
.daily-text { color: var(--ink-soft); font-size: .95rem; margin: 6px 0 10px; }
.daily-flower { position: absolute; right: -30px; top: -30px; width: 170px; color: var(--t-ink); opacity: .45; transform: rotate(18deg); }
.link-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--rose-dark); text-decoration: none; font-size: .95rem; }
.link-more:hover .ico { transform: translateX(3px); }
.link-more .ico { transition: transform .15s; }

.section { margin-block: clamp(28px, 5vw, 56px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cat {
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 112px;
  padding: 18px 20px; border-radius: var(--r); text-decoration: none; color: var(--ink);
  background: linear-gradient(140deg, var(--t), rgba(255,255,255,.6)); border: 1px solid rgba(255,255,255,.8);
  transition: transform .18s, box-shadow .18s;
}
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.cat-name { font: 600 1.12rem/1.25 var(--font-head); }
.cat-count { font-size: .82rem; font-weight: 700; color: var(--t-ink); }
.intro.prose { max-width: none; }
.intro { background: var(--surface); border-radius: 28px; padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow); border: 1px solid var(--line); }
.intro p:first-child { font: 400 1.3rem/1.5 var(--font-head); color: var(--ink); }

/* ---------- karty ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r);
  text-decoration: none; color: var(--ink); overflow: hidden; border: 1px solid var(--line);
  transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.card-media { aspect-ratio: 16 / 9; background: var(--t); position: relative; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-letter { display: grid; place-items: center; background: linear-gradient(135deg, var(--t), #fff 140%); }
.card-letter span { font: 600 2.6rem/1 var(--font-head); color: var(--t-ink); position: relative; z-index: 1; }
.card-letter svg { position: absolute; width: 140px; right: -26px; bottom: -36px; color: var(--t-ink); opacity: .35; }
.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 3px; }
.card-body .chip { align-self: flex-start; margin-bottom: 4px; }
.card-title { font: 600 1.12rem/1.25 var(--font-head); }
.card-latin { color: var(--muted); font-size: .9rem; }
.card-text { color: var(--ink-soft); font-size: .9rem; line-height: 1.5; margin-top: 6px; }

/* ---------- podstrony ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .88rem; color: var(--muted); margin: 22px 0 6px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--rose-dark); }
.page-head { margin: 8px 0 26px; }
.page-head .lead { color: var(--ink-soft); max-width: 70ch; }
.filter { display: flex; align-items: center; gap: 8px; max-width: 420px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 2px 6px 2px 16px; margin-top: 14px; color: var(--muted); }
.filter input { border: 0; box-shadow: none !important; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.tabs { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.tabs a { padding: 8px 16px; border-radius: 999px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .92rem; }
.tabs a.on { background: var(--rose-deep); color: #fff; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.letters a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 700; color: var(--ink-soft); }
.letters a:hover { background: var(--rose); color: var(--rose-dark); }
.az { columns: 3 280px; column-gap: 28px; }
.az-group { break-inside: avoid; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 20px 10px; }
.az-group h2 { margin: 0 0 6px; color: var(--rose-deep); }
.az-group ul { list-style: none; padding: 0; margin: 0; }
.az-group li { padding: 5px 0; border-top: 1px dashed var(--line); font-size: .97rem; }
.az-group li:first-child { border-top: 0; }
.az-group a { color: var(--ink); text-decoration: none; font-weight: 600; }
.az-group a:hover { color: var(--rose-dark); }
.az-group em { color: var(--muted); font-size: .88rem; }
.big-flower { display: block; width: 120px; margin: 40px auto 0; color: var(--rose-deep); }

/* artykuł / roślina */
.article-head {
  position: relative; overflow: hidden; border-radius: 28px; padding: clamp(24px, 5vw, 48px);
  background: linear-gradient(135deg, var(--t), #fff 130%); margin-bottom: 28px;
}
.article-head > div { position: relative; z-index: 1; max-width: 760px; }
.article-head h1 { margin-top: 12px; }
.latin { font: italic 400 1.25rem/1.3 var(--font-head); color: var(--ink-soft); margin: 0; }
.article-flower { position: absolute; right: -40px; bottom: -60px; width: clamp(160px, 26vw, 280px); color: var(--t-ink); opacity: .32; transform: rotate(-12deg); }
.notice { background: var(--butter); padding: 8px 14px; border-radius: 10px; font-size: .9rem; display: inline-block; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(24px, 4vw, 48px); align-items: start; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.toc a { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .9rem; }
.toc a:hover { border-color: var(--rose); color: var(--rose-dark); background: var(--rose-2); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 26px; }
.gallery a { border-radius: 14px; overflow: hidden; aspect-ratio: 1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.05); }
.prose { font-size: 1.05rem; max-width: 72ch; }
.prose p { margin: 0 0 1.05em; text-align: left; hyphens: auto; }
.prose h2 { font-size: 1.45rem; margin: 1.6em 0 .55em; display: flex; align-items: center; gap: 12px; }
.prose h2::before { content: ""; width: 12px; height: 12px; border-radius: 50% 0; background: var(--rose-deep); transform: rotate(45deg); flex: none; opacity: .7; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.4em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .3em; }
.prose li::marker { color: var(--rose-deep); }
.prose blockquote { margin: 1.2em 0; padding: 14px 20px; border-left: 4px solid var(--rose); background: var(--rose-2); border-radius: 0 14px 14px 0; }
.prose img { border-radius: 16px; margin: 1em 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--rose-2); }
.article-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 14px; }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.side-box h3 { margin: 0 0 10px; }
.side-list { list-style: none; margin: 0 0 12px; padding: 0; }
.side-list a { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; text-decoration: none; color: var(--ink); font-weight: 600; border-top: 1px dashed var(--line); line-height: 1.3; }
.side-list li:first-child a { border-top: 0; }
.side-list a:hover { color: var(--rose-dark); }
.side-list em { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--t); flex: none; margin-top: 4px; border: 1px solid rgba(0,0,0,.04); }
.side-random { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; color: var(--rose-dark); background: linear-gradient(135deg, var(--rose-2), var(--lavender)); border: 0; }
.side-random:hover { color: var(--rose-dark); filter: brightness(1.02); }

@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; }
  .daily strong { margin-top: 24px; }
  .article-grid { grid-template-columns: 1fr; }
  .article-side { position: static; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-media { aspect-ratio: 4 / 3; }
  .card-text { display: none; }
  .card-body { padding: 12px 12px 14px; }
  .card-title { font-size: 1rem; }
  .cat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat { min-height: 96px; padding: 14px; }
  .cat-name { font-size: 1rem; }
  .search-big { padding-left: 14px; }
  .search-big .btn { padding: .8em 1em; }
}

/* ---------- stopka ---------- */
.footer { margin-top: 64px; background: linear-gradient(180deg, transparent, var(--rose-2) 40%); padding: 48px 0 24px; }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
.footer .muted { margin: 10px 0; }
.stats { display: flex; gap: 18px; color: var(--ink-soft); font-size: .92rem; margin: 0; }
.stats b { color: var(--rose-dark); font-size: 1.1rem; }
.footer-links { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 32px; align-content: start; }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--rose-dark); }
.footer-bottom { border-top: 1px solid rgba(194, 93, 132, .15); margin-top: 28px; padding-top: 18px; font-size: .88rem; color: var(--muted); }
.footer-bottom a { color: var(--ink-soft); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(63, 47, 60, .85); display: grid; place-items: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 90vh; border-radius: 16px; box-shadow: var(--shadow-lg); }
.lb-close { position: absolute; top: 16px; right: 16px; }

/* ==========================================================================
   Panel administracyjny (te same zmienne i komponenty)
   ========================================================================== */
.admin { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.admin-side .brand { margin: 0 6px 22px; }
.admin-side a.nav-a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.admin-side a.nav-a:hover, .admin-side a.nav-a.on { background: var(--rose-2); color: var(--rose-dark); }
.admin-side .spacer { flex: 1; }
.admin-main { padding: clamp(18px, 3vw, 36px); max-width: 1200px; width: 100%; }
.admin-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.admin-top h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 2.5vw, 26px); margin-bottom: 20px; }
.panel h2 { font-size: 1.2rem; margin: 0 0 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px 20px; border-radius: var(--r); background: linear-gradient(140deg, var(--t), #fff 140%); }
.stat b { display: block; font: 600 2rem/1 var(--font-head); color: var(--t-ink); }
.stat span { color: var(--ink-soft); font-weight: 600; font-size: .9rem; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar-row > * { flex: 0 1 auto; }
.toolbar-row input[type=search] { flex: 1 1 220px; width: auto; }
.toolbar-row select { width: auto; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #fffbfc; }
.table .t-title a { font-weight: 700; color: var(--ink); text-decoration: none; }
.table .t-title a:hover { color: var(--rose-dark); }
.table em { color: var(--muted); font-size: .88rem; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions form { display: inline; }
.badge-off { background: var(--butter); color: #8a6d1b; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field small { color: var(--muted); font-weight: 400; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: .88rem; }
.checks input:checked + span { color: var(--rose-dark); }
.checks label:has(input:checked) { background: var(--rose-2); border-color: var(--rose); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--rose-deep); }
.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.edit-side { position: sticky; top: 20px; }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; }
.alert-ok { background: var(--mint); color: #2c6b4f; }
.alert-err { background: #fde3e8; color: var(--err); }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a, .pager span { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink-soft); font-weight: 700; padding: 0 10px; }
.pager .on { background: var(--rose-deep); color: #fff; border-color: var(--rose-deep); }

/* edytor treści */
.editor { border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.editor:focus-within { border-color: #e7a3bb; box-shadow: 0 0 0 4px var(--rose-2); }
.ed-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: #fffafb; position: sticky; top: 0; z-index: 2; }
.ed-bar button { min-width: 36px; height: 34px; padding: 0 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-soft); font: 700 .88rem/1 var(--font-body); cursor: pointer; }
.ed-bar button:hover { background: var(--rose-2); color: var(--rose-dark); }
.ed-bar button.on { background: var(--rose); color: var(--rose-dark); }
.ed-bar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
.ed-area { min-height: 380px; max-height: 70vh; overflow-y: auto; padding: 18px 22px; outline: none; }
.ed-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.ed-source { border: 0; border-radius: 0; min-height: 380px; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; box-shadow: none !important; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; }
.thumb { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--rose-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--err); cursor: pointer; font-weight: 800; }
.thumb .cover { position: absolute; left: 4px; bottom: 4px; font-size: .65rem; background: rgba(255,255,255,.92); padding: 2px 6px; border-radius: 6px; font-weight: 800; color: var(--rose-dark); }
.dropzone { display: block; border: 2px dashed var(--rose); border-radius: var(--r-sm); padding: 16px; text-align: center; color: var(--ink-soft); cursor: pointer; background: #fffafb; font-weight: 600; }
.dropzone:hover, .dropzone.drag { background: var(--rose-2); }
.dropzone input { display: none; }

/* edytor menu */
.menu-tree { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.menu-row { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 8px; align-items: center; }
.menu-node { background: #fffafb; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.menu-kids { list-style: none; margin: 10px 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.menu-kids .menu-node { background: #fff; }
.row-btns { display: flex; gap: 4px; }
.row-btns button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-soft); font-weight: 800; }
.row-btns button:hover { background: var(--rose-2); color: var(--rose-dark); }
.row-btns .del:hover { background: #fde3e8; color: var(--err); }

/* logowanie */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(100%, 420px); background: var(--surface); border-radius: 28px; padding: 36px 32px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.login .brand { justify-content: center; margin-bottom: 22px; }
.login h1 { font-size: 1.6rem; text-align: center; margin: 0 0 22px; }
.login .field { margin-bottom: 14px; }
.login .btn { width: 100%; margin-top: 8px; padding: 1em; }

.admin-mobilebar { display: none; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: fixed; inset: 0 30% 0 0; z-index: 60; transform: translateX(-102%); transition: transform .22s; box-shadow: var(--shadow-lg); height: 100%; }
  body.nav-open .admin-side { transform: none; }
  .admin-mobilebar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
  .edit-layout { grid-template-columns: 1fr; }
  .edit-side { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .menu-row { grid-template-columns: 1fr; }
  .table .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .footer, .article-side, .toc { display: none !important; }
  body { background: #fff; }
}
.checks input, .switch input { accent-color: var(--rose-deep); }
