/* Panel administracyjny. Korzysta ze zmiennych z /style.css (kolory, promienie). Wszystkie klasy zaczynają się od a-. */

.a-body {
  background: #faf9f7;
  min-height: 100vh;
  min-height: 100dvh;
}

.a-wrap {
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.a-muted { margin: 0; color: var(--gray); font-size: .95rem; }

.a-loading { padding: 80px 16px; text-align: center; color: var(--gray); }

.a-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Przyciski ---------- */

.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease-out);
}

.a-btn:hover:not(:disabled) { background: var(--ink); color: #fff; }
.a-btn:active:not(:disabled) { transform: translateY(1px); }
.a-btn:disabled { opacity: .55; cursor: not-allowed; }

.a-btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.a-btn--primary:hover:not(:disabled) { background: var(--red-dark); border-color: var(--red-dark); }

.a-btn--danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.a-btn--danger:hover:not(:disabled) { background: #8c1d18; border-color: #8c1d18; }

.a-btn--ghost { border-color: var(--line); background: transparent; }
.a-btn--ghost:hover:not(:disabled) { background: #fff; color: var(--ink); border-color: var(--ink); }

.a-btn--small { min-height: 38px; padding: 6px 16px; font-size: .875rem; }
.a-btn--big { min-height: 52px; padding: 12px 28px; font-size: 1rem; }
.a-btn--wide { width: 100%; }

.a-btn--quiet-danger { border-color: transparent; background: transparent; color: #b3261e; }
.a-btn--quiet-danger:hover:not(:disabled) { background: #fbe9e7; color: #8c1d18; }

.a-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.a-actions--end { justify-content: flex-end; }

/* ---------- Formularze ---------- */

.a-form, .a-editor__form { display: grid; gap: 20px; }

.a-field { display: grid; gap: 8px; }
.a-field__label { font-size: .9rem; font-weight: 600; }
.a-field__hint { color: var(--gray); font-size: .85rem; line-height: 1.45; }

.a-input {
  width: 100%;
  min-height: 48px;
  padding: 11px 16px;
  border: 1.5px solid #d8d4cd;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}

.a-input:hover { border-color: #b9b4ab; }
.a-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(227, 0, 16, .12); }
.a-input--code { letter-spacing: .2em; text-transform: uppercase; font-weight: 600; text-align: center; }
.a-textarea { min-height: 150px; resize: vertical; line-height: 1.55; }

.a-pass { position: relative; display: block; }
.a-pass .a-input { padding-right: 84px; }

.a-reveal {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--gray);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}

.a-reveal:hover { color: var(--ink); background: var(--tint); }

.a-error {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #f0b8b3;
  border-radius: 12px;
  background: #fdeceb;
  color: #8c1d18;
  font-size: .92rem;
  font-weight: 500;
}

.a-error[hidden] { display: none; }

.a-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.a-switch { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; font-size: .95rem; }
.a-switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.a-switch__track {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #cfcac2;
  transition: background-color .2s;
}

.a-switch__track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .25s var(--ease-out);
}

.a-switch__input:checked + .a-switch__track { background: #1d8a45; }
.a-switch__input:checked + .a-switch__track::after { transform: translateX(20px); }
.a-switch__input:focus-visible + .a-switch__track { outline: 3px solid var(--red); outline-offset: 3px; }

/* ---------- Logowanie ---------- */

.a-auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }

.a-auth__card {
  width: 100%;
  max-width: 440px;
  padding: clamp(28px, 6vw, 44px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .06);
}

.a-auth__card .a-logo { height: 56px; width: auto; margin-bottom: 28px; }
.a-auth__title { margin-bottom: 8px; font-size: 1.7rem; font-weight: 700; }
.a-auth__card .a-form { margin-top: 28px; }

.a-auth__back {
  display: inline-block;
  margin-top: 24px;
  color: var(--gray);
  font-size: .9rem;
  text-underline-offset: 3px;
}

.a-auth__back:hover { color: var(--ink); }

/* ---------- Nagłówek panelu ---------- */

.a-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.a-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.a-brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.a-brand .a-logo { height: 42px; width: auto; display: block; }
.a-brand__label { padding-left: 14px; border-left: 1px solid var(--line); font-weight: 600; letter-spacing: .02em; }
.a-header__actions { display: flex; align-items: center; gap: 10px; }

.a-menu { position: relative; }
.a-menu__button { list-style: none; display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; cursor: pointer; }
.a-menu__button::-webkit-details-marker { display: none; }
.a-menu__button:hover { background: var(--tint); }
.a-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; }
.a-menu__name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 600; }

.a-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 5;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .12);
}

.a-menu__item { display: block; width: 100%; padding: 12px 14px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: .95rem; text-align: left; cursor: pointer; }
.a-menu__item:hover { background: var(--tint); }

@media (max-width: 640px) {
  .a-header__actions .a-btn--ghost { display: none; }
  .a-menu__name { display: none; }
  .a-menu__button { padding-right: 4px; }
  .a-brand__label { display: none; }
}

/* ---------- Zakładki i panele ---------- */

.a-main { padding-top: 28px; padding-bottom: 80px; }

.a-tabs { display: flex; gap: 6px; margin-bottom: 28px; padding: 5px; border-radius: 999px; background: #efece7; width: fit-content; max-width: 100%; overflow-x: auto; }

.a-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--gray);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}

@media (max-width: 640px) {
  .a-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; overflow: visible; border-radius: 24px; }
  .a-tab { min-width: 0; justify-content: center; gap: 6px; padding: 8px 10px; font-size: .88rem; white-space: normal; line-height: 1.2; text-align: center; }
}

.a-tab:hover { color: var(--ink); }
.a-tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.a-count { min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--tint); color: var(--gray); font-size: .8rem; text-align: center; }
.a-tab[aria-selected="true"] .a-count { background: var(--red); color: #fff; }

.a-panel__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.a-h1 { margin-bottom: 6px; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; }

.a-empty { padding: clamp(40px, 8vw, 80px) 24px; border: 2px dashed #d8d4cd; border-radius: var(--radius); text-align: center; background: #fff; }
.a-empty__title { margin: 0 0 6px; font-size: 1.2rem; font-weight: 700; }

/* ---------- Lista postów ---------- */

.a-list, .a-tiles { margin: 0; padding: 0; list-style: none; }
.a-list { display: grid; gap: 12px; }

.a-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  transition: box-shadow .25s, transform .25s var(--ease-out);
}

.a-row:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, .07); transform: translateY(-1px); }

.a-row__main { display: flex; flex: 1; align-items: center; gap: 16px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.a-row__thumb { flex: none; width: 88px; height: 66px; border-radius: 12px; object-fit: cover; background: var(--tint); }
.a-row__thumb--empty { display: grid; place-items: center; font-size: 1.5rem; opacity: .4; }
.a-row__text { display: grid; gap: 4px; min-width: 0; }
.a-row__title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 600; line-height: 1.3; }
.a-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--gray); font-size: .85rem; }
.a-badge { padding: 2px 10px; border-radius: 999px; background: #fff3d6; color: #7a5200; font-size: .75rem; font-weight: 600; }
.a-row__actions { display: flex; flex: none; gap: 4px; }

@media (max-width: 640px) {
  .a-row { flex-direction: column; align-items: stretch; padding: 10px; }
  .a-row__actions { justify-content: flex-end; }
  .a-row__thumb { width: 76px; height: 58px; }
}

/* ---------- Zajęcia ---------- */

.a-group { margin-bottom: 36px; }
.a-group__title { margin-bottom: 14px; font-size: 1.15rem; font-weight: 700; }

.a-row__when {
  flex: none;
  display: grid;
  gap: 2px;
  min-width: 112px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--tint);
  text-align: center;
}

.a-row__day { color: var(--red); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.a-row__hours { font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.a-box { display: grid; gap: 14px; margin-top: 8px; padding: clamp(20px, 3vw, 28px); border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.a-box .a-group__title { margin: 0; }

.a-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.a-choice { position: relative; cursor: pointer; }
.a-choice__input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.a-choice__box {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 20px;
  border: 1.5px solid #d8d4cd;
  border-radius: 12px;
  background: #fff;
  font-weight: 600;
  transition: border-color .2s, background-color .2s, color .2s;
}

.a-choice:hover .a-choice__box { border-color: #b9b4ab; }
.a-choice__input:checked + .a-choice__box { border-color: var(--red); background: #fff5f5; color: var(--red-dark); }
.a-choice__input:focus-visible + .a-choice__box { outline: 3px solid var(--red); outline-offset: 3px; }

.a-input:disabled { background: var(--tint); color: var(--gray); cursor: not-allowed; }

@media (max-width: 640px) {
  .a-row__when { min-width: 96px; padding: 6px 10px; }
}

/* ---------- Taśma zdjęć ---------- */

.a-ribbon__status { min-height: 1.4em; margin-bottom: 12px; }

.a-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 14px; }
.a-tile { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 16px; background: var(--tint); }
.a-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

.a-tile__remove {
  position: absolute;
  right: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 21, 21, .72);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease-out);
}

.a-tile__remove:hover { background: #b3261e; transform: scale(1.08); }

/* ---------- Okna dialogowe ---------- */

.a-dialog {
  max-height: calc(100dvh - 24px);
  padding: clamp(22px, 4vw, 36px);
  border: 0;
  border-radius: 28px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
}

.a-dialog::backdrop { background: rgba(21, 21, 21, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.a-dialog[open] { animation: a-pop .3s var(--ease-out); }
.a-dialog--small { width: min(100% - 24px, 460px); }
.a-dialog--small .a-muted { margin-bottom: 24px; }
.a-dialog--small .a-form { margin-top: 20px; }
.a-dialog--editor { width: min(100% - 24px, 1040px); padding: 0; }
.a-dialog__title { margin-bottom: 20px; font-size: 1.5rem; font-weight: 700; }

@keyframes a-pop {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.a-editor { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.a-editor__main { padding: clamp(22px, 4vw, 36px); }
.a-editor__buttons { padding-top: 8px; }

.a-preview { padding: clamp(22px, 4vw, 36px); border-radius: 0 28px 28px 0; background: #f3f1ed; }
.a-preview__label { margin: 0 0 16px; color: var(--gray); font-size: .85rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.a-preview__card { position: sticky; top: 24px; }
.a-preview .post:hover { transform: none; box-shadow: none; }

@media (max-width: 860px) {
  .a-editor { grid-template-columns: 1fr; }
  .a-preview { border-radius: 0 0 28px 28px; }
  .a-preview__card { position: static; }
  .a-grid2 { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- Pole ze zdjęciem ---------- */

.a-drop {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 16px;
  border: 2px dashed #cfcac2;
  border-radius: 16px;
  background: #fbfaf8;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}

.a-drop:hover, .a-drop.is-over { border-color: var(--red); background: #fff5f5; }
.a-drop__icon { font-size: 2rem; }
.a-drop__title { font-weight: 700; }

.a-image { display: grid; gap: 12px; }
.a-image__shown { position: relative; overflow: hidden; border-radius: 16px; background: var(--tint); }
.a-image__shown img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.a-image__busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .72); font-weight: 600; }

/* ---------- Powiadomienia ---------- */

.a-toasts { position: fixed; left: 50%; bottom: 24px; z-index: 1000; display: grid; gap: 10px; width: min(100% - 32px, 460px); transform: translateX(-50%); pointer-events: none; }

.a-toast {
  padding: 14px 20px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  font-size: .95rem;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
  animation: a-toast-in .35s var(--ease-out);
  transition: opacity .4s, transform .4s;
}

.a-toast--error { background: #b3261e; }
.a-toast.is-leaving { opacity: 0; transform: translateY(8px); }

@keyframes a-toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .a-dialog[open], .a-toast { animation: none; }
  .a-row, .a-btn, .a-switch__track::after { transition: none; }
}

/* ---------- Zdjęcia w poście ---------- */

.a-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.a-pic { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 12px; background: var(--tint); }
.a-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }

.a-pic__cover { position: absolute; left: 6px; top: 6px; padding: 2px 9px; border-radius: 999px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .04em; }

.a-pic__actions { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; }

.a-pic__btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 21, 21, .72);
  color: #fff;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s;
}

.a-pic__btn:hover:not(:disabled) { background: var(--red); }
.a-pic__btn--remove:hover:not(:disabled) { background: #b3261e; }
.a-pic__btn:disabled { opacity: .5; cursor: not-allowed; }

.a-drop--small { padding: 18px 14px; width: 100%; }
.a-drop:disabled { opacity: .5; cursor: not-allowed; }

.a-preview__dark { padding: 18px; border-radius: 20px; background: #151515; }
.a-preview .project { width: 100%; }
.a-preview .post__link { pointer-events: none; }

/* ---------- Logotypy dofinansowania ---------- */

.a-logos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.a-logo { position: relative; display: block; cursor: pointer; }
.a-logo__input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.a-logo__tile {
  display: grid;
  gap: 8px;
  justify-items: start;
  height: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line, #e6e1da);
  border-radius: 14px;
  background: #fff;
  transition: border-color .2s, background-color .2s;
}

.a-logo__img { display: block; width: auto; max-width: 100%; height: 30px; object-fit: contain; object-position: left center; }
.a-logo__name { color: var(--gray); font-size: .78rem; line-height: 1.35; }

.a-logo:hover .a-logo__tile { border-color: #cfc8bf; }
.a-logo__input:checked + .a-logo__tile { border-color: var(--red); background: #fff7f8; }
.a-logo__input:checked + .a-logo__tile::after {
  content: "✓";
  position: absolute;
  right: 10px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
}
.a-logo__input:focus-visible + .a-logo__tile { outline: 3px solid var(--red); outline-offset: 2px; }

@media (max-width: 520px) {
  .a-logos { grid-template-columns: 1fr; }
}

/* ---------- Kontakt ---------- */

.a-contact { display: grid; gap: 20px; }
.a-contact .a-box { margin-top: 0; }
.a-contact__save { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(to top, #faf9f7 70%, transparent); }

.a-cl { display: grid; gap: 10px; }
.a-cr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 10px; align-items: center; }

.a-blocks { display: grid; gap: 16px; }
.a-block { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--tint, #faf8f5); }

@media (max-width: 640px) {
  .a-cr { grid-template-columns: 1fr; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .a-cr .a-btn { justify-self: start; }
  .a-tab:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
