/* ================================================================
 * sidebar.css – Datei-Liste links neben der A4-Vorschau
 * Auf dem Bildschirm sichtbar; im Druck komplett ausgeblendet.
 * ============================================================== */

/* Layout greift erst, wenn der Multi-Mode aktiv ist (siehe app.js).
   Im Single-Mode bleibt es eine einzelne Spalte. */
.layout.multi {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
  padding: 0 16px;
}

.sidebar {
  position: sticky;
  top: 70px; /* unter der Toolbar */
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  background: var(--color-editor-bg);
  color: var(--color-editor-fg);
  border: 1px solid var(--color-editor-br);
  border-radius: 6px;
  font-size: 13px;
}

.sidebar-empty {
  padding: 24px 16px;
  color: var(--color-dropzone-fg);
  text-align: center;
  line-height: 1.5;
}

.sidebar-header {
  position: sticky; top: 0;
  background: var(--color-editor-bg);
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-editor-br);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  z-index: 1;
}
.sidebar-header .muted { color: var(--color-dropzone-fg); }
.sidebar-header .sidebar-actions {
  margin-left: auto;
  display: flex; gap: 4px;
}
.sidebar-header button {
  font-size: 12px;
  padding: 4px 8px;
  background: var(--color-secondary);
  color: var(--color-toolbar-fg);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}
.sidebar-header button:hover { background: var(--color-secondary-h); }
.sidebar-header button.danger { background: #b94747; }
.sidebar-header button.danger:hover { background: #d05656; }

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-editor-br);
  cursor: default;
}
.file-row:hover { background: rgba(127,127,127,.07); }
.file-row.dragging { opacity: .4; }
.file-row.drop-before { box-shadow: inset 0 2px 0 0 var(--color-primary); }
.file-row.drop-after  { box-shadow: inset 0 -2px 0 0 var(--color-primary); }

.file-row .grip {
  cursor: grab;
  color: var(--color-dropzone-fg);
  user-select: none;
  padding: 2px 4px;
  letter-spacing: -2px;
  font-size: 14px;
}
.file-row .grip:active { cursor: grabbing; }

.file-row .order-no {
  min-width: 1.6em;
  text-align: right;
  color: var(--color-dropzone-fg);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.file-row .file-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.file-row .file-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row .file-path {
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--color-dropzone-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row .file-size {
  font-size: 11px;
  color: var(--color-dropzone-fg);
  font-variant-numeric: tabular-nums;
}

.file-row [data-action=remove] {
  background: transparent;
  border: 0;
  color: var(--color-dropzone-fg);
  font-size: 18px;
  line-height: 1;
  width: 24px; height: 24px;
  border-radius: 3px;
  cursor: pointer;
}
.file-row [data-action=remove]:hover {
  background: #b94747;
  color: #fff;
}

/* Die globale Editor-Anpassung lebt jetzt in app.css. */

@media (max-width: 900px) {
  .layout.multi {
    grid-template-columns: 1fr;
  }
  .sidebar { position: static; max-height: none; }
}

@media print {
  .sidebar, .layout { display: block; }
  .sidebar { display: none !important; }
  .layout { padding: 0; }
}
