/* ===================================================================
   لوحة التحرير العائمة — تظهر فقط عند تسجيل دخول الأدمن
   =================================================================== */

/* Top admin bar */
.adm-bar {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  height: 48px;
  background: linear-gradient(135deg, #1A3140 0%, #0F1F2A 100%);
  color: #FCF7EC;
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 9998;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  gap: 16px;
}
body.adm-active { padding-top: 48px; }
body.adm-active .site-header { top: 48px; }
.adm-bar-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700;
  color: #D9A24A;
}
.adm-bar-brand svg { width: 16px; height: 16px; }
.adm-bar-spacer { flex: 1; }
.adm-bar-status {
  font-size: 12px;
  opacity: .72;
}
.adm-bar-status.saving { color: #D9A24A; }
.adm-bar-status.saved  { color: #86C26B; }
.adm-bar-status.error  { color: #ff6b6b; }
.adm-bar-btn {
  background: transparent;
  border: 1px solid rgba(252,247,236,.18);
  color: #FCF7EC;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex; align-items: center; gap: 6px;
}
.adm-bar-btn:hover { background: rgba(252,247,236,.08); border-color: rgba(252,247,236,.32); }
.adm-bar-btn.danger { color: #ff8585; border-color: rgba(255,107,107,.25); }
.adm-bar-btn.danger:hover { background: rgba(255,107,107,.10); }
.adm-bar-btn.primary { background: #D9A24A; border-color: #D9A24A; color: #1A3140; }
.adm-bar-btn.primary:hover { background: #B8842E; border-color: #B8842E; }
.adm-bar-btn.is-active {
  background: rgba(217,162,74,.18);
  border-color: rgba(217,162,74,.55);
  color: #D9A24A;
}

/* Side toolbar (floating) */
.adm-tools {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(26,49,64,.22);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 9997;
  border: 1px solid rgba(26,49,64,.10);
}
.adm-tool {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  border-radius: 10px;
  color: #1A3140; cursor: pointer;
  transition: all .15s;
  position: relative;
}
.adm-tool:hover { background: rgba(217,162,74,.12); color: #B8842E; }
.adm-tool.is-active { background: #1A3140; color: #FCF7EC; }
.adm-tool svg { width: 20px; height: 20px; }
.adm-tool::after {
  content: attr(data-label);
  position: absolute;
  inset-inline-end: 54px;
  top: 50%; transform: translateY(-50%);
  background: #1A3140; color: #FCF7EC;
  padding: 6px 12px; border-radius: 6px;
  font-family: 'Cairo', sans-serif; font-size: 12px; font-weight: 600;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.adm-tool:hover::after { opacity: 1; }

/* Editable markers — only shown in edit mode */
body.adm-edit [data-editable] {
  outline: 1.5px dashed rgba(217,162,74,.55);
  outline-offset: 4px;
  border-radius: 4px;
  cursor: text;
  transition: outline-color .15s, background .15s;
  min-height: 1em;
}
body.adm-edit [data-editable]:hover {
  outline-color: #D9A24A;
  background: rgba(217,162,74,.08);
}
body.adm-edit [data-editable]:focus {
  outline: 2px solid #D9A24A;
  outline-offset: 4px;
  background: rgba(217,162,74,.08);
  box-shadow: 0 0 0 4px rgba(217,162,74,.15);
}
body.adm-edit [data-editable]::before {
  content: '✎';
  position: absolute;
  margin-top: -22px;
  margin-inline-start: -8px;
  background: #D9A24A; color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
body.adm-edit [data-editable]:hover::before { opacity: 1; }

/* Theme panel (slide-in from right) */
.adm-panel {
  position: fixed;
  top: 48px;
  inset-inline-end: -360px;
  width: 340px;
  height: calc(100vh - 48px);
  background: #fff;
  box-shadow: -8px 0 32px rgba(26,49,64,.18);
  z-index: 9996;
  transition: inset-inline-end .32s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  font-family: 'Cairo', sans-serif;
}
.adm-panel.is-open { inset-inline-end: 0; }
.adm-panel-head {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(26,49,64,.08);
  display: flex; align-items: center; justify-content: space-between;
}
.adm-panel-head h3 {
  font-family: 'Reem Kufi', sans-serif;
  margin: 0; font-size: 18px; color: #1A3140;
}
.adm-panel-close {
  background: none; border: none; cursor: pointer; padding: 8px;
  color: #6B7A82; border-radius: 6px;
}
.adm-panel-close:hover { background: rgba(26,49,64,.06); color: #1A3140; }
.adm-panel-body { padding: 20px 24px; overflow-y: auto; flex: 1; }

.adm-field { margin-bottom: 18px; }
.adm-field-label {
  display: block; font-size: 13px; font-weight: 600;
  color: #1A3140; margin-bottom: 8px;
}
.adm-field-hint {
  font-size: 12px; color: #6B7A82; margin: 4px 0 8px;
}
.adm-color-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #FCF7EC; border-radius: 8px;
  border: 1px solid rgba(26,49,64,.08);
}
.adm-color-swatch {
  width: 32px; height: 32px; border-radius: 8px;
  cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.10);
  flex-shrink: 0;
}
.adm-color-row label {
  flex: 1; font-size: 13px; color: #1A3140;
  font-weight: 500;
}
.adm-color-input {
  width: 100px; padding: 6px 10px;
  border: 1px solid rgba(26,49,64,.12);
  border-radius: 6px;
  font-family: monospace; font-size: 12px;
  background: #fff;
}
.adm-select {
  width: 100%; padding: 10px 12px;
  border: 1px solid rgba(26,49,64,.12);
  border-radius: 8px; background: #fff;
  font-family: inherit; font-size: 14px;
  color: #1A3140;
}
.adm-panel-actions {
  padding: 16px 24px;
  border-top: 1px solid rgba(26,49,64,.08);
  display: flex; gap: 10px;
}
.adm-panel-actions .adm-bar-btn { flex: 1; justify-content: center; padding: 10px; }

/* Toast notification */
.adm-toast {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 24px;
  background: #1A3140;
  color: #FCF7EC;
  padding: 14px 20px;
  border-radius: 10px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.24);
  z-index: 10000;
  display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(20px);
  transition: opacity .25s, transform .25s;
}
.adm-toast.show { opacity: 1; transform: translateY(0); }
.adm-toast.success { background: #44512A; }
.adm-toast.error { background: #B91C1C; }

/* Hidden inputs */
.adm-hidden-input { display: none; }

@media (max-width: 768px) {
  .adm-bar { height: 56px; padding: 0 12px; font-size: 12px; }
  body.adm-active { padding-top: 56px; }
  body.adm-active .site-header { top: 56px; }
  .adm-bar-status { display: none; }
  .adm-tools { bottom: 16px; inset-inline-end: 16px; }
  .adm-tool::after { display: none; }
  .adm-panel { width: 100vw; }
}
