/* --- /styles/hea_backoffice_peeker.css --- */
/* HEA Peeker: slide-in right drawer for entity quick-preview.
   Builds on hea_tokens.css — uses its color/radius/shadow tokens. */

/* =========================
   1) Overlay backdrop
   ========================= */
.bo-peeker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.bo-peeker-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   2) Drawer panel
   ========================= */
.bo-peeker-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.bo-peeker-overlay.open .bo-peeker-drawer {
  transform: translateX(0);
}

/* =========================
   3) Header
   ========================= */
.bo-peeker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--surface);
}
.bo-peeker-head h2 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bo-peeker-close {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.bo-peeker-close:hover {
  background: var(--surface-2, var(--bg));
  color: var(--ink);
}

/* =========================
   4) Body content
   ========================= */
.bo-peeker-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  font-size: 0.78rem;
}

/* Loading state */
.bo-peeker-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.bo-peeker-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--line);
  border-top-color: var(--brand1, #6366f1);
  border-radius: 50%;
  animation: bo-peeker-spin 0.7s linear infinite;
}
@keyframes bo-peeker-spin {
  to { transform: rotate(360deg); }
}

/* Error state */
.bo-peeker-error {
  padding: 20px;
  text-align: center;
  color: var(--fail, #e74c3c);
  font-size: 0.8rem;
}

/* =========================
   5) KV grid (key-value pairs)
   ========================= */
.bo-peeker-section {
  margin-bottom: 16px;
}
.bo-peeker-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.bo-peeker-kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 10px;
  align-items: baseline;
}
.bo-peeker-kv dt {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  margin: 0;
}
.bo-peeker-kv dd {
  font-size: 0.76rem;
  color: var(--ink);
  margin: 0;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.bo-peeker-kv dd.text {
  font-family: inherit;
  word-break: break-word;
}

/* Status badges inside peeker */
.bo-peeker-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid var(--line);
}
.bo-peeker-badge--ok    { color: var(--ok);   border-color: rgba(40,167,69,.3); }
.bo-peeker-badge--warn  { color: var(--warn); border-color: rgba(176,110,0,.3); }
.bo-peeker-badge--muted { color: var(--muted); }

/* =========================
   6) Deep-link actions
   ========================= */
.bo-peeker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.bo-peeker-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}
.bo-peeker-action:hover {
  background: var(--surface-2, var(--bg));
  border-color: var(--brand1, #6366f1);
  color: var(--brand1, #6366f1);
}

/* =========================
   7) Peek-link styling
   ========================= */
.peek-link {
  color: var(--brand1, #6366f1);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dashed rgba(99, 102, 241, 0.3);
  transition: color 0.12s, border-color 0.12s;
}
.peek-link:hover {
  color: var(--brand2, #818cf8);
  border-bottom-color: var(--brand2, #818cf8);
}

/* =========================
   8) Responsive
   ========================= */
@media (max-width: 540px) {
  .bo-peeker-drawer {
    width: 100vw;
  }
  .bo-peeker-kv {
    grid-template-columns: 90px 1fr;
  }
}
