/* =========================================================
   AIVARA ID - ADMIN CMS LITE
   Admin-only content manager. Baseline tetap aman.
   ========================================================= */

.aivara-cms-launcher {
  position: fixed;
  right: 22px;
  bottom: 142px;
  z-index: 10025;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: #ef4d5c;
  color: #fff;
  box-shadow: 0 18px 54px rgba(239, 77, 92, .24);
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.aivara-cms-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: none;
  background: rgba(7, 24, 63, .34);
  backdrop-filter: blur(12px);
}

.aivara-cms-backdrop.is-open {
  display: block;
}

.aivara-cms-panel {
  position: fixed;
  inset: 16px 16px 16px auto;
  z-index: 10031;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 26px;
  border: 1px solid #e8edf5;
  border-radius: 30px;
  background:
    radial-gradient(circle at 8% 0%, rgba(239, 77, 92, .10), transparent 30%),
    #fff;
  box-shadow: 0 34px 100px rgba(7, 24, 63, .26);
  transform: translateX(calc(100% + 50px));
  transition: transform .22s ease;
}

.aivara-cms-panel.is-open {
  transform: translateX(0);
}

.aivara-cms-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.aivara-cms-head h2 {
  margin: 0;
  color: #07183f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: .96;
  letter-spacing: -.052em;
}

.aivara-cms-head p {
  margin: 8px 0 0;
  color: #5f6b85;
  font-size: 15px;
  line-height: 1.55;
}

.aivara-cms-close {
  width: 46px;
  height: 46px;
  border: 1px solid #e8edf5;
  border-radius: 999px;
  background: #fff;
  color: #07183f;
  font-size: 28px;
  cursor: pointer;
}

.aivara-cms-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 18px 0;
}

.aivara-cms-tabs button {
  min-height: 46px;
  border: 1px solid #e8edf5;
  border-radius: 999px;
  background: #fff;
  color: #07183f;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.aivara-cms-tabs button.is-active {
  background: #fff1f2;
  color: #ef4d5c;
  border-color: rgba(239, 77, 92, .34);
}

.aivara-cms-section {
  display: none;
}

.aivara-cms-section.is-active {
  display: grid;
  gap: 16px;
}

.aivara-cms-card {
  border: 1px solid #e8edf5;
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  padding: 16px;
  box-shadow: 0 12px 34px rgba(7,24,63,.055);
}

.aivara-cms-card h3 {
  margin: 0 0 12px;
  color: #07183f;
  font-size: 17px;
}

.aivara-cms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.aivara-cms-field {
  display: grid;
  gap: 7px;
}

.aivara-cms-field.full {
  grid-column: 1 / -1;
}

.aivara-cms-field label {
  color: #07183f;
  font-size: 13px;
  font-weight: 900;
}

.aivara-cms-field input,
.aivara-cms-field textarea,
.aivara-cms-field select {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  background: #fbfcff;
  color: #07183f;
  font: inherit;
  font-size: 14.5px;
  outline: none;
}

.aivara-cms-field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}

.aivara-cms-row-list {
  display: grid;
  gap: 12px;
}

.aivara-cms-repeat {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px dashed rgba(7,24,63,.14);
  border-radius: 20px;
  background: #fbfcff;
}

.aivara-cms-repeat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.aivara-cms-repeat-head strong {
  color: #07183f;
  font-size: 14px;
}

.aivara-cms-mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.aivara-cms-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #e8edf5;
  border-radius: 999px;
  background: #fff;
  color: #07183f;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.aivara-cms-btn.primary {
  border: 0;
  background: #07183f;
  color: #fff;
}

.aivara-cms-btn.coral {
  border: 0;
  background: #ef4d5c;
  color: #fff;
}

.aivara-cms-btn.danger {
  border-color: rgba(239,77,92,.32);
  color: #ef4d5c;
}

.aivara-cms-actions {
  position: sticky;
  bottom: -26px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.68), #fff 36%);
}

.aivara-cms-actions button,
.aivara-cms-import {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e8edf5;
  border-radius: 999px;
  background: #fff;
  color: #07183f;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.aivara-cms-actions .primary {
  border: 0;
  background: #07183f;
  color: #fff;
}

.aivara-cms-actions .danger {
  border-color: rgba(239,77,92,.34);
  color: #ef4d5c;
}

.aivara-cms-import input {
  display: none;
}

.aivara-cms-note {
  padding: 12px 14px;
  border-radius: 18px;
  background: #f8fafc;
  color: #5f6b85;
  font-size: 13.5px;
  line-height: 1.55;
}

.aivara-product-item[data-admin-hidden="true"] {
  display: none !important;
}

@media (max-width: 760px) {
  .aivara-cms-panel {
    inset: 10px;
    width: calc(100vw - 20px);
    padding: 18px;
  }

  .aivara-cms-head h2 {
    font-size: 34px;
  }

  .aivara-cms-tabs,
  .aivara-cms-actions,
  .aivara-cms-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   AIVARA ID - ADMIN CMS EXTENDED
   - Benefit bawah bisa tambah/hapus.
   - Mata pelajaran/topik bisa tambah/hapus.
   - Help button punya Video Tutorial + FAQ.
   ========================================================= */

.aivara-cms-tabs {
  grid-template-columns: repeat(5, 1fr) !important;
}

.aivara-cms-repeat.is-disabled {
  opacity: .58;
}

.aivara-cms-mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff1f2;
  color: #ef4d5c;
  font-size: 12px;
  font-weight: 900;
}

.aivara-help-wrap {
  position: relative;
  display: inline-flex;
}

.aivara-help-popover {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 1000;
  width: 300px;
  padding: 12px;
  border: 1px solid #e8edf5;
  border-radius: 22px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 28px 80px rgba(7,24,63,.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
  backdrop-filter: blur(16px);
}

.aivara-help-popover.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.aivara-help-popover a {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border-radius: 16px;
  color: #07183f;
  text-decoration: none;
}

.aivara-help-popover a:hover {
  background: #fff1f2;
}

.aivara-help-popover .help-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff1f2;
  color: #ef4d5c;
  font-weight: 900;
}

.aivara-help-popover strong {
  display: block;
  font-size: 14px;
}

.aivara-help-popover small {
  display: block;
  margin-top: 2px;
  color: #5f6b85;
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .aivara-cms-tabs {
    grid-template-columns: 1fr !important;
  }

  .aivara-help-popover {
    right: auto;
    left: 0;
    width: min(300px, calc(100vw - 40px));
  }
}
