:root {
  color: #1f2d3d;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f6f8;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }

#content-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

.status-card {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
  background: linear-gradient(145deg, #f7fafc, #edf3f7);
}
.status-card h1 { margin: 8px 0 0; font-size: 24px; }
.status-card p { margin: 0; max-width: 440px; color: #6a7785; line-height: 1.5; }
.status-card.error h1 { color: #c23b3b; }
.spinner { width: 30px; height: 30px; border: 3px solid #d9e4ea; border-top-color: #2fc6f6; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.admin-button {
  position: fixed;
  top: 56px;
  right: 28px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  background: rgba(30, 48, 65, .84);
  box-shadow: 0 6px 22px rgba(16, 35, 50, .22);
  backdrop-filter: blur(8px);
}
.admin-button:hover { background: #1f78b4; }
.backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(23, 36, 49, .35); }
.admin-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 40;
  width: min(460px, 100vw);
  overflow-y: auto;
  padding: 24px;
  background: #f8fafb;
  box-shadow: -16px 0 45px rgba(23, 36, 49, .18);
  transform: translateX(105%);
  transition: transform .22s ease;
}
.admin-panel.open { transform: translateX(0); }
.panel-header, .section-heading, .item-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-header h2, .section-heading h3 { margin: 0; }
.eyebrow { color: #1aa3d8; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 10px; color: #687785; font-size: 28px; background: #eaf0f3; }
.panel-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid #dfe7eb; }
.section-heading { align-items: flex-start; }
.section-heading p { margin: 5px 0 0; color: #788794; font-size: 13px; }
.secondary-button, .upload-button, .primary-button, .danger-button {
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  font-weight: 650;
}
.secondary-button { color: #167ba4; background: #e4f5fb; }
.upload-button { display: block; margin-top: 16px; color: white; text-align: center; background: #20a9dc; cursor: pointer; }
.primary-button { color: #147ca5; background: #e1f3fa; }
.danger-button { color: #bd3f47; background: #fbeaec; }
.item-list { display: grid; gap: 9px; margin-top: 14px; }
.item-row { padding: 12px; border: 1px solid #e1e8ec; border-radius: 11px; background: white; }
.item-main { min-width: 0; }
.item-title { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { margin-top: 4px; color: #84919d; font-size: 12px; }
.item-actions { display: flex; flex-shrink: 0; gap: 7px; }
.active-badge { display: inline-block; margin-top: 6px; padding: 3px 7px; border-radius: 999px; color: #138552; font-size: 10px; font-weight: 800; background: #dcf7e9; }
.empty { padding: 17px; border: 1px dashed #cbd7dd; border-radius: 10px; color: #7b8994; text-align: center; }
.panel-message { margin-top: 16px; padding: 11px 13px; border-radius: 9px; color: #28734f; background: #e4f6ec; }
.panel-message.error { color: #a4323a; background: #fbe8ea; }

@media (max-width: 520px) {
  .admin-panel { padding: 18px; }
  .section-heading { align-items: stretch; flex-direction: column; }
}
