/* KHB — powierzchnie operacyjne (zawsze dark navy, także na stronie light) */

html[data-theme="executive-light"] .admin-panel-shell,
html[data-theme="executive-light"] .admin-access-state,
html[data-theme="executive-light"] .admin-panel-block,
html[data-theme="executive-light"] .admin-stat-card,
html[data-theme="executive-light"] .admin-quality-item,
html[data-theme="executive-light"] .admin-list-item,
html[data-theme="executive-light"] .admin-log-item,
html[data-theme="executive-light"] .user-panel-card {
  background:
    radial-gradient(circle at top right, rgba(159, 122, 55, 0.12), transparent 28%),
    linear-gradient(165deg, rgba(17, 28, 46, 0.98), rgba(11, 19, 33, 0.98));
  border-color: rgba(142, 162, 192, 0.22);
  box-shadow: var(--khb-shadow);
  color: var(--khb-text);
}

html[data-theme="executive-light"] .admin-panel-lead,
html[data-theme="executive-light"] .admin-stat-card small,
html[data-theme="executive-light"] .admin-quality-card p,
html[data-theme="executive-light"] .admin-quality-item span,
html[data-theme="executive-light"] .admin-list-item span,
html[data-theme="executive-light"] .admin-empty,
html[data-theme="executive-light"] .admin-access-state p,
html[data-theme="executive-light"] .user-panel-header p {
  color: rgba(201, 213, 229, 0.88);
}

html[data-theme="executive-light"] .admin-panel-head h1,
html[data-theme="executive-light"] .user-panel-identity strong {
  color: var(--khb-text-strong);
}

html[data-theme="executive-light"] .admin-tab-btn,
html[data-theme="executive-light"] .admin-filter-grid input,
html[data-theme="executive-light"] .admin-filter-grid select,
html[data-theme="executive-light"] .admin-editor-grid input,
html[data-theme="executive-light"] .admin-editor-grid select,
html[data-theme="executive-light"] .admin-editor-grid textarea,
html[data-theme="executive-light"] .admin-role-select,
html[data-theme="executive-light"] .admin-res-status,
html[data-theme="executive-light"] .admin-res-qty,
html[data-theme="executive-light"] .admin-res-notes,
html[data-theme="executive-light"] .user-panel-tab {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(142, 162, 192, 0.24);
  color: var(--khb-text);
}

html[data-theme="executive-light"] .admin-tab-btn.is-active,
html[data-theme="executive-light"] .user-panel-tab.is-active {
  background: rgba(159, 122, 55, 0.16);
  border-color: rgba(210, 166, 76, 0.42);
  color: var(--khb-gold-soft);
}

html[data-theme="executive-light"] .admin-inline-badge {
  background: rgba(159, 122, 55, 0.14);
  border-color: rgba(210, 166, 76, 0.35);
  color: var(--khb-gold-soft);
}

html[data-theme="executive-light"] .admin-log-item {
  color: var(--khb-text);
  border-left-color: var(--khb-gold);
}

html[data-theme="executive-light"] .user-panel-kicker {
  color: var(--khb-gold-soft);
}

/* Sekcje strategiczne na landingu — ciemny granat (premium) także w trybie jasnym */
html[data-theme="executive-light"] .strategic-unified-panel,
html[data-theme="executive-light"] .strategic-hero-main,
html[data-theme="executive-light"] .strategic-hero-aside,
html[data-theme="executive-light"] .strategic-card,
html[data-theme="executive-light"] .strategic-outcome {
  background:
    radial-gradient(circle at top right, rgba(159, 122, 55, 0.1), transparent 32%),
    linear-gradient(155deg, rgba(23, 36, 59, 0.98), rgba(12, 21, 36, 0.97));
  border-color: rgba(142, 162, 192, 0.2);
  box-shadow: 0 12px 32px rgba(11, 19, 33, 0.18);
}

html[data-theme="executive-light"] .strategic-unified-panel .lead,
html[data-theme="executive-light"] .strategic-hero-main p,
html[data-theme="executive-light"] .strategic-hero-aside p,
html[data-theme="executive-light"] .strategic-card p {
  color: rgba(218, 226, 239, 0.86);
}

html[data-theme="executive-light"] .strategic-unified-panel h2,
html[data-theme="executive-light"] .strategic-hero-main h3,
html[data-theme="executive-light"] .strategic-hero-aside h3,
html[data-theme="executive-light"] .strategic-card h3,
html[data-theme="executive-light"] .strategic-outcome h3 {
  color: var(--khb-text-strong);
}

html[data-theme="executive-light"] .section-kicker,
html[data-theme="executive-light"] .strategic-label {
  color: var(--khb-gold-soft);
}

html[data-theme="executive-light"] .strategic-inline-points li,
html[data-theme="executive-light"] .effect-points li {
  border-color: rgba(210, 166, 76, 0.28);
  background: rgba(159, 122, 55, 0.1);
  color: var(--khb-gold-soft);
}

/* Panel administratora — estetyka, kontrast, paleta KHB */
#adminPanelSection .admin-panel-shell {
  padding: clamp(1.15rem, 2vw, 1.45rem);
  gap: 1rem;
  border-color: rgba(142, 162, 192, 0.24);
  background:
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(159, 122, 55, 0.14), transparent 55%),
    linear-gradient(168deg, rgba(17, 28, 46, 0.98), rgba(11, 19, 33, 0.98));
}

#adminPanelSection .admin-panel-head {
  align-items: center;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(142, 162, 192, 0.16);
}

#adminPanelSection .admin-panel-kicker,
#adminPanelSection .admin-panel-head .section-kicker {
  color: var(--khb-gold-soft);
  letter-spacing: 0.14em;
}

#adminPanelSection .admin-panel-head h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.55rem, 2.8vw, 2rem);
  color: #f6f8fc;
}

#adminPanelSection .admin-panel-lead {
  color: rgba(204, 216, 232, 0.88);
  font-size: 0.92rem;
  line-height: 1.55;
}

#adminPanelSection .admin-panel-btn-ghost {
  border-color: rgba(142, 162, 192, 0.35);
  color: rgba(231, 238, 248, 0.92);
  background: rgba(255, 255, 255, 0.04);
}

#adminPanelSection .admin-panel-btn-ghost:hover {
  border-color: rgba(210, 166, 76, 0.45);
  color: var(--khb-gold-soft);
  background: rgba(159, 122, 55, 0.1);
}

#adminPanelSection .admin-panel-btn-refresh {
  border: 1px solid rgba(210, 166, 76, 0.55);
  background: linear-gradient(135deg, rgba(159, 122, 55, 0.92), rgba(122, 93, 40, 0.95));
  color: #fffaf0;
  box-shadow: 0 8px 20px rgba(89, 66, 24, 0.28);
}

#adminPanelSection .admin-panel-btn-refresh:hover {
  filter: brightness(1.06);
}

#adminPanelSection .cms-admin {
  --cms-accent: var(--khb-gold-strong);
  --cms-accent-soft: var(--khb-gold-muted);
  --cms-bg: #0e1728;
  --cms-surface: #152238;
  --cms-surface-soft: #1a2a42;
  --cms-line: rgba(142, 162, 192, 0.22);
  --cms-text: #eef2f8;
  --cms-muted: #9aadc4;
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#adminPanelSection .cms-admin[data-theme="light"] {
  --cms-bg: #eef2f7;
  --cms-surface: #ffffff;
  --cms-surface-soft: #f3f6fb;
  --cms-line: rgba(38, 56, 88, 0.14);
  --cms-text: #17243b;
  --cms-muted: #5a6f8c;
}

#adminPanelSection .cms-nav-btn.is-active {
  border-color: rgba(210, 166, 76, 0.4);
  background: var(--khb-gold-muted);
  color: var(--khb-gold-soft);
}

#adminPanelSection .cms-theme-toggle {
  min-height: 40px;
  border-radius: 10px;
  border-color: var(--cms-line);
  background: var(--cms-surface-soft);
  color: var(--cms-text);
  font-size: 0.82rem;
  font-weight: 600;
}

#adminPanelSection .cms-quick-actions.is-hidden-on-dashboard {
  display: none;
}

#adminPanelSection .cms-quick-actions {
  padding: 0.15rem 0 0.05rem;
}

#adminPanelSection .cms-chip {
  border-radius: 10px;
  border-color: var(--cms-line);
  background: var(--cms-surface-soft);
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
}

#adminPanelSection .cms-chip:hover {
  border-color: rgba(210, 166, 76, 0.45);
  background: var(--khb-gold-muted);
  color: var(--khb-gold-soft);
}

#adminPanelSection .cms-stat-card {
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}

#adminPanelSection .cms-admin[data-theme="light"] .cms-stat-card {
  background: linear-gradient(165deg, #ffffff, #f5f8fc);
}

#adminPanelSection .cms-stat-card strong {
  color: var(--khb-gold-strong);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-variant-numeric: tabular-nums;
}

#adminPanelSection .cms-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

#adminPanelSection .cms-shortcut-card {
  display: grid;
  gap: 0.2rem;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--cms-line);
  background: var(--cms-surface-soft);
  color: var(--cms-text);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

#adminPanelSection .cms-shortcut-card:hover {
  border-color: rgba(210, 166, 76, 0.42);
  background: var(--khb-gold-muted);
  transform: translateY(-1px);
}

#adminPanelSection .cms-shortcut-card__label {
  font-size: 0.86rem;
  font-weight: 700;
}

#adminPanelSection .cms-shortcut-card__hint {
  font-size: 0.74rem;
  color: var(--cms-muted);
  line-height: 1.35;
}

#adminPanelSection .cms-log-item {
  border-radius: 10px;
}

#adminPanelSection .cms-topbar {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--cms-line);
}

@media (max-width: 900px) {
  #adminPanelSection .admin-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  #adminPanelSection .admin-panel-actions {
    justify-content: flex-start;
  }

  #adminPanelSection .cms-shortcut-grid {
    grid-template-columns: 1fr;
  }
}
#adminPanelSection .cms-nav {
  display: grid;
  gap: 0.75rem;
}

#adminPanelSection .cms-nav-group {
  display: grid;
  gap: 0.28rem;
}

#adminPanelSection .cms-nav-group + .cms-nav-group {
  padding-top: 0.55rem;
  border-top: 1px solid var(--cms-line);
}

#adminPanelSection .cms-nav-group__title {
  margin: 0;
  padding: 0.1rem 0.45rem 0.2rem;
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cms-muted);
}

#adminPanelSection .cms-nav-group__items {
  display: grid;
  gap: 0.28rem;
}
/* Modal patrona — układ profesjonalny */
.cms-modal-backdrop .cms-modal-card--patron,
.cms-modal-backdrop .cms-modal-card--partner,
.cms-modal-backdrop .cms-modal-card--media {
  width: min(720px, 100%);
  max-height: min(90vh, 880px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid rgba(210, 166, 76, 0.22);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  background-color: #0f1828;
  background-image:
    radial-gradient(circle at top right, rgba(159, 122, 55, 0.14), transparent 42%),
    linear-gradient(180deg, #141f34 0%, #0c1422 100%);
}

.cms-modal-backdrop .cms-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.95rem;
  border-bottom: 1px solid rgba(142, 162, 192, 0.18);
  background: #141f34;
}

.cms-modal-backdrop .cms-modal-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--khb-gold-soft, #e5d4a8);
}

.cms-modal-backdrop .cms-modal-head h3 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--khb-text-strong, #f4f7fb);
}

.cms-modal-backdrop .cms-modal-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(142, 162, 192, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(230, 238, 248, 0.92);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cms-modal-backdrop .cms-modal-close:hover {
  background: rgba(159, 122, 55, 0.18);
  border-color: rgba(210, 166, 76, 0.45);
  color: #fff;
}

.cms-modal-backdrop .cms-form--patron,
.cms-modal-backdrop .cms-form--partner,
.cms-modal-backdrop .cms-form--media {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.cms-modal-backdrop .cms-form--patron > .cms-patron-form,
.cms-modal-backdrop .cms-form--partner > .cms-patron-form,
.cms-modal-backdrop .cms-form--media > .cms-patron-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.cms-modal-backdrop .cms-patron-form__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.15rem 0.65rem;
  display: grid;
  gap: 0.9rem;
}

.cms-modal-backdrop .cms-patron-form > .cms-patron-block--anchored {
  flex-shrink: 0;
  margin: 0 1.15rem 0.75rem;
}

.cms-modal-backdrop .cms-form--patron > .cms-form-actions,
.cms-modal-backdrop .cms-form--partner > .cms-form-actions,
.cms-modal-backdrop .cms-form--media > .cms-form-actions {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.85rem 1.15rem 1rem;
  border-top: 1px solid rgba(142, 162, 192, 0.16);
  background: #0c1422;
  box-shadow: 0 -12px 24px rgba(0, 0, 0, 0.22);
}

.cms-modal-backdrop .cms-form--patron > .cms-patron-form.cms-patron-form--details,
.cms-modal-backdrop .cms-form--partner > .cms-patron-form.cms-patron-form--details,
.cms-modal-backdrop .cms-form--media > .cms-patron-form.cms-patron-form--details {
  display: grid;
  gap: 0.9rem;
  overflow: auto;
  padding: 1rem 1.15rem 0.5rem;
}

.cms-modal-backdrop .cms-patron-block {
  margin: 0;
  border: 1px solid rgba(142, 162, 192, 0.16);
  border-radius: 14px;
  padding: 0.9rem 1rem 1rem;
  background: rgba(18, 28, 46, 0.92);
}

.cms-modal-backdrop .cms-patron-block__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.cms-modal-backdrop .cms-patron-block__step {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--khb-gold-soft, #e5d4a8);
  background: rgba(159, 122, 55, 0.16);
  border: 1px solid rgba(210, 166, 76, 0.28);
}

.cms-modal-backdrop .cms-patron-block__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--khb-text-strong, #f4f7fb);
}

.cms-modal-backdrop .cms-patron-block__lead {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--cms-muted, rgba(201, 213, 229, 0.78));
}

.cms-modal-backdrop .cms-patron-media-layout {
  display: grid;
  grid-template-columns: minmax(168px, 220px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.cms-modal-backdrop .cms-patron-preview {
  min-height: 150px;
  border-radius: 14px;
  border: 1px solid rgba(142, 162, 192, 0.2);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0.55rem;
  position: relative;
}

.cms-modal-backdrop .cms-patron-preview img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: 10px;
}

.cms-modal-backdrop .cms-patron-preview__empty,
.cms-modal-backdrop .cms-patron-preview__fallback {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
  text-align: center;
  padding: 0.45rem;
  color: var(--cms-muted, rgba(201, 213, 229, 0.82));
}

.cms-modal-backdrop .cms-patron-preview__empty p,
.cms-modal-backdrop .cms-patron-preview__fallback p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(230, 238, 248, 0.9);
}

.cms-modal-backdrop .cms-patron-preview__empty small,
.cms-modal-backdrop .cms-patron-preview__fallback small {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--cms-muted, rgba(201, 213, 229, 0.72));
}

.cms-modal-backdrop .cms-patron-preview__glyph {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 1px dashed rgba(142, 162, 192, 0.35);
  background: rgba(255, 255, 255, 0.03);
  position: relative;
}

.cms-modal-backdrop .cms-patron-preview__glyph::before {
  content: "";
  position: absolute;
  inset: 0.72rem;
  border-radius: 4px;
  border: 2px solid rgba(201, 213, 229, 0.35);
}

.cms-modal-backdrop .cms-patron-preview__glyph--warn {
  border-style: solid;
  border-color: rgba(210, 166, 76, 0.45);
  background: rgba(159, 122, 55, 0.12);
}

.cms-modal-backdrop .cms-patron-preview__glyph--warn::before {
  content: "!";
  inset: 0;
  display: grid;
  place-items: center;
  border: none;
  font-size: 1rem;
  font-weight: 800;
  color: var(--khb-gold-soft, #e5d4a8);
}

.cms-modal-backdrop .cms-patron-media-fields {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.cms-modal-backdrop .cms-field {
  display: grid;
  gap: 0.42rem;
}

.cms-modal-backdrop .cms-field__label {
  font-size: 0.78rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(230, 238, 248, 0.88);
}

.cms-modal-backdrop .cms-form--patron .cms-field input[type="text"],
.cms-modal-backdrop .cms-form--patron .cms-field input[type="url"],
.cms-modal-backdrop .cms-form--patron .cms-field input[type="number"],
.cms-modal-backdrop .cms-form--patron .cms-field select,
.cms-modal-backdrop .cms-form--patron .cms-field textarea,
.cms-modal-backdrop .cms-form--partner .cms-field input[type="text"],
.cms-modal-backdrop .cms-form--partner .cms-field input[type="url"],
.cms-modal-backdrop .cms-form--partner .cms-field input[type="number"],
.cms-modal-backdrop .cms-form--partner .cms-field select,
.cms-modal-backdrop .cms-form--partner .cms-field textarea,
.cms-modal-backdrop .cms-form--media .cms-field input[type="text"],
.cms-modal-backdrop .cms-form--media .cms-field input[type="url"],
.cms-modal-backdrop .cms-form--media .cms-field input[type="number"],
.cms-modal-backdrop .cms-form--media .cms-field select,
.cms-modal-backdrop .cms-form--media .cms-field textarea {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(142, 162, 192, 0.38);
  background: rgba(255, 255, 255, 0.1);
  color: #f4f7fb;
  padding: 0.58rem 0.72rem;
  font: inherit;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.cms-modal-backdrop .cms-form--patron .cms-field input:focus-visible,
.cms-modal-backdrop .cms-form--patron .cms-field select:focus-visible,
.cms-modal-backdrop .cms-form--patron .cms-field textarea:focus-visible,
.cms-modal-backdrop .cms-form--partner .cms-field input:focus-visible,
.cms-modal-backdrop .cms-form--partner .cms-field select:focus-visible,
.cms-modal-backdrop .cms-form--partner .cms-field textarea:focus-visible,
.cms-modal-backdrop .cms-form--media .cms-field input:focus-visible,
.cms-modal-backdrop .cms-form--media .cms-field select:focus-visible,
.cms-modal-backdrop .cms-form--media .cms-field textarea:focus-visible {
  outline: none;
  border-color: rgba(210, 166, 76, 0.55);
  box-shadow: 0 0 0 3px rgba(159, 122, 55, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.cms-modal-backdrop .cms-patron-block--description textarea {
  min-height: 128px;
  resize: vertical;
}

.cms-modal-backdrop .cms-file-drop {
  position: relative;
  display: grid;
  gap: 0.2rem;
  justify-items: center;
  min-height: 4.2rem;
  border-radius: 10px;
  border: 1px dashed rgba(142, 162, 192, 0.38);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.65rem 0.75rem;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.cms-modal-backdrop .cms-file-drop:hover {
  border-color: rgba(210, 166, 76, 0.45);
  background: rgba(159, 122, 55, 0.08);
}

.cms-modal-backdrop .cms-file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.cms-modal-backdrop .cms-file-drop__label,
.cms-modal-backdrop .cms-file-drop__text {
  pointer-events: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(230, 238, 248, 0.9);
  text-align: center;
}

.cms-modal-backdrop .cms-file-drop__name {
  pointer-events: none;
  font-size: 0.72rem;
  color: var(--cms-muted, rgba(201, 213, 229, 0.78));
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cms-modal-backdrop .cms-file-drop__name.is-set {
  color: var(--khb-gold-soft, #e5d4a8);
}

.cms-modal-backdrop .cms-form-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--cms-muted, rgba(201, 213, 229, 0.72));
}

.cms-modal-backdrop .cms-form-grid {
  display: grid;
  gap: 0.65rem;
}

.cms-modal-backdrop .cms-form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cms-modal-backdrop .cms-field--wide {
  grid-column: 1 / -1;
}

.cms-modal-backdrop .cms-patron-form--details .cms-patron-detail {
  display: grid;
  gap: 0.32rem;
}

.cms-modal-backdrop .cms-patron-detail__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(201, 213, 229, 0.75);
}

.cms-modal-backdrop .cms-patron-detail__value {
  padding: 0.58rem 0.72rem;
  border-radius: 10px;
  border: 1px solid rgba(142, 162, 192, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7fb;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}

.cms-modal-backdrop .cms-patron-detail__text {
  margin: 0;
  white-space: pre-wrap;
}

.cms-modal-backdrop .cms-patron-detail__link {
  color: var(--khb-gold-soft, #e5d4a8);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cms-modal-backdrop .cms-patron-block--description .cms-patron-detail {
  grid-column: 1 / -1;
}

.cms-modal-backdrop .cms-form--patron > .cms-form-actions .btn,
.cms-modal-backdrop .cms-form--partner > .cms-form-actions .btn,
.cms-modal-backdrop .cms-form--media > .cms-form-actions .btn {
  min-width: 6.75rem;
}

.cms-modal-backdrop .cms-media-preview__doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 140px;
  padding: 1rem;
  text-align: center;
  color: rgba(230, 238, 248, 0.88);
}

.cms-modal-backdrop .cms-media-preview__doc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: 3rem;
  border-radius: 12px;
  background: rgba(159, 122, 55, 0.22);
  border: 1px solid rgba(210, 166, 76, 0.35);
  font-weight: 700;
  letter-spacing: 0.06em;
}

#adminPanelSection .cms-patron-thumb--doc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cms-muted);
  background: rgba(159, 122, 55, 0.12);
}

#adminPanelSection .cms-patron-cell__main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

#adminPanelSection .cms-patron-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--cms-line);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.9);
}

#adminPanelSection .cms-patron-thumb--empty {
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: var(--cms-muted);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 720px) {
  .cms-modal-backdrop .cms-patron-media-layout {
    grid-template-columns: 1fr;
  }

  .cms-modal-backdrop .cms-form-grid--2 {
    grid-template-columns: 1fr;
  }

  .cms-modal-backdrop .cms-field--wide {
    grid-column: auto;
  }
}

#adminPanelSection .cms-content-shell {
  gap: 0.7rem;
}

/* Dashboard — zwarty układ */
#adminPanelSection .cms-view--dashboard {
  gap: 0.6rem;
}

#adminPanelSection .cms-view--dashboard .cms-stats-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr));
  gap: 0.45rem;
}

#adminPanelSection .cms-view--dashboard .cms-stat-card {
  padding: 0.5rem 0.6rem;
  gap: 0.12rem;
  border-radius: 10px;
}

#adminPanelSection .cms-view--dashboard .cms-stat-card span {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

#adminPanelSection .cms-view--dashboard .cms-stat-card strong {
  font-size: 1.12rem;
  line-height: 1.15;
}

#adminPanelSection .cms-view--dashboard .cms-stat-card small {
  font-size: 0.7rem;
  line-height: 1.25;
}

#adminPanelSection .cms-dashboard__grid {
  align-items: start;
  gap: 0.6rem;
}

#adminPanelSection .cms-card--compact {
  padding: 0.6rem 0.7rem;
  gap: 0.45rem;
  border-radius: 12px;
}

#adminPanelSection .cms-card-head--compact {
  margin: 0;
  padding-bottom: 0.1rem;
}

#adminPanelSection .cms-card-head--compact h3 {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#adminPanelSection .cms-log-list--compact {
  gap: 0.32rem;
  max-height: min(46vh, 380px);
  overflow-y: auto;
  padding-right: 0.1rem;
  align-content: start;
}

#adminPanelSection .cms-log-item--compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
}

#adminPanelSection .cms-log-item--compact .cms-log-item__action {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--cms-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#adminPanelSection .cms-log-item--compact .cms-log-item__meta {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--cms-muted);
  white-space: nowrap;
}

#adminPanelSection .cms-shortcuts--dashboard {
  display: block;
  width: 100%;
}

/* Skróty dashboardu — szczegóły w admin-panel.css */

#adminPanelSection .cms-view-title {
  font-size: 1.05rem;
  font-weight: 700;
}

#adminPanelSection .cms-breadcrumb {
  margin-bottom: 0.1rem;
  font-size: 0.68rem;
}

@media (max-width: 900px) {
  #adminPanelSection .cms-view--dashboard .cms-stats-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #adminPanelSection .cms-view--dashboard .cms-shortcut-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  #adminPanelSection .cms-view--dashboard .cms-stats-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

