/* Detail Panel (slide-in from right) */
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 150;
  transition: background 0.25s;
}

.panel-backdrop.active {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .panel-backdrop.active {
  background: rgba(0, 0, 0, 0.4);
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100vw;
  background: var(--surface);
  z-index: 151;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
  border-left: 1px solid var(--surface-border);
}

.detail-panel.open {
  transform: translateX(0);
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--surface-border);
  border-top: 3px solid var(--surface-border);
  flex-shrink: 0;
}

.panel-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.panel-category {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
}

.panel-category svg {
  width: 14px;
  height: 14px;
}

.panel-title-input {
  width: 100%;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  border: none;
  background: none;
  padding: 0.25rem 0;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

.panel-title-input:focus {
  outline: none;
  border-bottom-color: var(--input-focus-border);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.panel-section {
  margin-bottom: 1.5rem;
}

.panel-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

/* Document items in panel */
.doc-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: border-color 0.15s;
}

.doc-item:hover {
  border-color: var(--surface-border-hover);
}

.doc-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-icon svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
}

.doc-info {
  flex: 1;
  min-width: 0;
}

.doc-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Metadata rows */
.panel-meta {
  border-top: 1px solid var(--surface-border);
  padding-top: 1rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 0.375rem 0;
}

.meta-row span:first-child {
  color: var(--text-tertiary);
}

.meta-row span:last-child {
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .detail-panel {
    width: 100vw;
  }
}
