/* ── 1.1 View Toggle Buttons ── */
.docs-view-toggle {
  display: flex;
  gap: 2px;
  background: var(--color-card);
  border: 0.5px solid rgba(31, 31, 30, 0.15);
  border-radius: 8px;
  padding: 2px;
}

.docs-view-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.docs-view-btn:hover {
  color: var(--color-text-primary);
}

.docs-view-btn.active {
  background: var(--color-card);
  color: var(--color-text-primary);
  border: 0.5px solid rgba(31, 31, 30, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.docs-view-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

/* ── 1.1 List View ── */
.doc-grid.doc-grid--list {
  grid-template-columns: 1fr;
  gap: 0;
  border: 0.5px solid rgba(31, 31, 30, 0.12);
  border-radius: 12px;
  background: var(--color-card);
}

/* Column header */
.doc-list-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  background: var(--color-card);
  border-radius: 12px 12px 0 0;
}

.doc-list-header-col {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.doc-list-header-col:hover {
  color: var(--color-text-primary);
}

.doc-list-header-col--title {
  flex: 1;
  min-width: 0;
  padding-left: 48px; /* align with title text (checkbox + icon + gaps) */
}

.doc-list-header-col--date {
  min-width: 80px;
  text-align: right;
  justify-content: flex-end;
}

.doc-list-header-col--words {
  min-width: 60px;
  text-align: right;
  justify-content: flex-end;
}

.doc-list-header-col--actions {
  width: 90px; /* matches 3 action buttons: 3×28px + 2×2px gap */
}

.doc-list-header-col .sort-arrow {
  font-size: 10px;
  opacity: 0.5;
}

/* List row */
.doc-list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 48px;
  background: var(--color-card);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

[data-theme="dark"] .doc-list-row {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.doc-list-row:first-of-type:not(:first-child) {
  /* No top radius when header exists */
}

.doc-list-row:last-of-type {
  border-bottom: none;
  border-radius: 0 0 12px 12px;
}

.doc-list-row:only-of-type {
  border-radius: 12px;
}

.doc-list-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .doc-list-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.doc-list-row:active {
  transform: scale(0.998);
}

/* Checkbox positioning in list rows */
.doc-list-row .doc-card-checkbox {
  position: relative;
  top: auto;
  left: auto;
  flex-shrink: 0;
}

.doc-list-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--card-accent-bg, rgba(0, 0, 0, 0.04));
}

.doc-list-icon svg {
  width: 14px;
  height: 14px;
  color: var(--card-accent, rgb(115, 113, 108));
}

.doc-list-title {
  flex: 1;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.doc-list-row .doc-tag-pills {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.doc-list-date {
  font-size: 12px;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.doc-list-words {
  font-size: 12px;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

/* Hover action buttons */
.doc-list-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.doc-list-row:hover .doc-list-actions {
  opacity: 1;
}

.doc-list-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.doc-list-action-btn:hover {
  background: var(--color-bg);
  color: var(--color-text-primary);
}

.doc-list-action-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.doc-list-action-btn--delete:hover {
  color: #ff3e1d;
  background: rgba(255, 62, 29, 0.06);
}

.doc-list-row .doc-card-overflow {
  position: relative;
  top: auto;
  right: auto;
}

.doc-list-row .doc-overflow-btn {
  opacity: 0;
}

.doc-list-row:hover .doc-overflow-btn {
  opacity: 1;
}

@media (max-width: 767px) {
  .doc-list-header {
    display: none;
  }
  .doc-list-row .doc-tag-pills {
    display: none;
  }
  .doc-list-actions {
    opacity: 1;
  }
  .doc-list-row .doc-overflow-btn {
    opacity: 1;
  }
}

/* ── Responsive: View toggle ── */
@media (max-width: 767px) {
  /* View toggle + sort on same row */
  .docs-view-toggle {
    order: 2;
  }
}
