:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f4efe8;
  color: #241f17;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: linear-gradient(180deg, #f7f1e7 0%, #eee4d7 100%);
}
.hidden {
  display: none !important;
}
.screen {
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  max-width: 420px;
  margin: 10vh auto;
}
.card {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(36, 31, 23, 0.08);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 80px rgba(36, 31, 23, 0.08);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
#admin-status {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #e67e22;
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
#admin-status.visible {
  opacity: 1;
}
#admin-status.error {
  background: #c0392b;
}
.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tab,
button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  background: #fa7517;
  color: #fff;
  font-weight: 600;
  transition: color 0.5s ease;
}
button:hover {
  color: yellow !important;
}
.tab.secondary,
button.secondary {
  background: #e6ddd0;
  color: #241f17;
}
.tab.active {
  background: #241f17;
}
.danger {
  background: #b42318;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}
main {
  overflow: visible !important;
  max-height: none !important;
}
.stack {
  display: grid;
  gap: 12px;
}
.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.split {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 20px;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.list {
  display: grid;
  gap: 10px;
  max-height: 65vh;
  overflow: auto;
}
.list.compact {
  max-height: 260px;
}
#texts-list {
  max-height: none !important;
  overflow: visible !important;
}
[data-panel='programs'] .list {
  max-height: none !important;
  overflow: visible !important;
}
[data-panel='team'] .list,
[data-panel='team'] #team-media-list {
  max-height: none !important;
  overflow: visible !important;
}
[data-panel='program-categories'] .list,
[data-panel='program-categories'] #program-categories-list {
  max-height: none !important;
  overflow: visible !important;
}
.list-item {
  border: 1px solid rgba(36, 31, 23, 0.08);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 8px;
}
[data-panel='programs'] .list-item:hover,
[data-panel='team'] .list-item:hover {
  background: #fef9e0;
  cursor: pointer;
}
[data-panel='programs'] .media-card:hover,
[data-panel='team'] .media-card:hover {
  background: transparent;
  cursor: default;
}
.program-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.program-buttons {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.program-title {
  flex: 1;
  min-width: 0;
}
.icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  background: #e6ddd0;
  color: #241f17;
}
.list-item.active {
  outline: 2px solid #fa7517;
}
.media-card {
  grid-template-columns: 176px 1fr;
  align-items: center;
  column-gap: 16px;
}
.media-thumb {
  width: 168px;
  height: 112px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: #eee4d7;
}
.media-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.media-meta .row > strong,
.media-meta .row > button,
.media-meta .row > .badge {
  flex: 0 0 auto;
}
.media-meta .row > button.secondary,
.media-meta .row > .badge {
  min-width: 146px;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #241f17;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(36, 31, 23, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
input[type='checkbox'] {
  width: auto;
  margin: 0;
}
textarea {
  min-height: 200px;
  resize: none;
  overflow: hidden;
}
.error {
  color: #b42318;
  min-height: 20px;
}
.muted {
  color: #6c6357;
  font-size: 13px;
}
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.row > * {
  flex: 1;
}
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
}
.checkbox-row span {
  line-height: 1.2;
}
.form-actions {
  margin-top: 18px;
}
.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.upload-row button {
  white-space: nowrap;
}
hr {
  border: 0;
  border-top: 1px solid rgba(36, 31, 23, 0.08);
  margin: 20px 0;
}

@media (max-width: 980px) {
  .split {
    grid-template-columns: 1fr;
  }
  .upload-row {
    grid-template-columns: 1fr;
  }
}
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(36, 31, 23, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
  padding: 20px;
  gap: 12px;
}
.lightbox.hidden {
  display: none;
}
.lightbox img {
  max-width: 90vw;
  max-height: calc(90vh - 80px);
  object-fit: contain;
  border-radius: 12px;
  cursor: default;
  flex: 0 0 auto;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.35);
}
.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lightbox-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.lb-preview {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.6;
  border: 2px solid transparent;
}
.lb-thumb {
  width: 240px;
  height: 168px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.6;
  border: 2px solid transparent;
}
.lb-thumb:hover,
.lb-preview:hover,
.lb-thumb.active,
.lb-preview.active {
  opacity: 1;
  border-color: #fff;
}
