.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  overflow: hidden;
}

.overlay.open {
  display: flex;
}

/* ── Side panel ── */
.panel {
  background: var(--color-white);
  width: 520px;
  max-width: 95vw;
  height: 100vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideIn .2s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-white);
  z-index: 1;
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 18px;
}

.panel-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--color-muted);
  padding: 4px 8px;
  transition: color var(--transition);
}

.panel-close:hover {
  color: var(--color-black);
}

.panel-body {
  padding: var(--space-lg);
  flex: 1;
}

.panel-footer {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  background: var(--color-white);
  position: sticky;
  bottom: 0;
}

/* ── Confirm dialog ── */
.dialog {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}

.dialog.open {
  display: flex;
}

.dialog-box {
  background: var(--color-white);
  padding: var(--space-xl);
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.dialog-title {
  font-family: var(--font-serif);
  font-size: 18px;
  margin-bottom: var(--space-sm);
}

.dialog-msg {
  color: var(--color-muted);
  font-size: 13px;
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}
