/* ===========================================================
   Bulk Archive modal — 14 May 2026
   Lean rewrite — no classification-specific styles.
   =========================================================== */

.ba-modal {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: stretch; justify-content: center;
}
.ba-backdrop {
  position: absolute; inset: 0;
  background: rgba(18, 21, 61, 0.55);
}
.ba-dialog {
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: 24px auto;
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
}

.ba-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid #e6e3da;
  background: #fafaf6;
  flex-shrink: 0;
}
.ba-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a8a96;
  font-weight: 600;
  margin-bottom: 2px;
}
.ba-title {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: #12153D;
  line-height: 1.2;
}
.ba-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #6b6e80;
  padding: 4px 8px;
}

.ba-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  background: #fdfdfb;
}

.ba-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid #e6e3da;
  background: #fafaf6;
  flex-shrink: 0;
}
.ba-foot-hint {
  font-size: 12px;
  color: #6b6e80;
  flex: 1 1 auto;
}

.ba-btn-primary,
.ba-btn-ghost,
.ba-btn-text {
  font-family: inherit;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  border: 1px solid transparent;
  padding: 8px 14px;
  font-weight: 600;
  line-height: 1.2;
}
.ba-btn-primary {
  background: #12153D;
  color: #fff;
}
.ba-btn-primary:hover:not(:disabled) { background: #1a1f5a; }
.ba-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.ba-btn-ghost {
  background: #fff;
  color: #12153D;
  border-color: #d8d4c4;
}
.ba-btn-ghost:hover { background: rgba(0,0,0,.04); }
.ba-btn-text {
  background: transparent;
  color: #6b6e80;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
}
.ba-btn-text:hover { color: #B3261E; }

.ba-intro {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #4a4a55;
  line-height: 1.5;
  margin-bottom: 18px;
}

.ba-muted { color: #6b6e80; font-weight: normal; font-size: 12px; }

.ba-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 20px;
  border: 2px dashed #d8d4c4;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: background .15s, border-color .15s;
}
.ba-drop.is-drag {
  background: rgba(201,168,76,0.10);
  border-color: #C9A84C;
}
.ba-drop-icon { font-size: 36px; line-height: 1; }
.ba-drop-text strong { font-size: 15px; color: #12153D; }
.ba-drop-or { display: block; margin-top: 4px; font-size: 12px; color: #6b6e80; }
.ba-drop-buttons {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.ba-queue-section { margin-top: 20px; }
.ba-queue-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  font-size: 13px;
  color: #12153D;
}
.ba-queue-head strong { color: #12153D; }
.ba-queue {
  border: 1px solid #ebe8e0;
  border-radius: 8px;
  max-height: 360px;
  overflow-y: auto;
  background: #fff;
}
.ba-empty {
  padding: 24px;
  text-align: center;
  color: #6b6e80;
  font-style: italic;
  font-size: 13px;
  background: #fafaf6;
  border-radius: 8px;
}

.ba-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0ede5;
  font-size: 13px;
}
.ba-row:last-child { border-bottom: none; }
.ba-row-main { flex: 1; min-width: 0; }
.ba-row-name {
  font-weight: 600;
  color: #12153D;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ba-row-path {
  font-size: 11.5px;
  color: #6b6e80;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ba-row-err {
  font-size: 11px;
  color: #B3261E;
  margin-top: 3px;
}
.ba-row-size {
  font-size: 11.5px;
  color: #6b6e80;
  white-space: nowrap;
  flex-shrink: 0;
}
.ba-row-remove {
  flex-shrink: 0;
  padding: 4px 8px;
  font-size: 14px;
}

.ba-row-status { flex-shrink: 0; }
.ba-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #f0ede5;
  color: #6b6e80;
  white-space: nowrap;
}
.ba-badge-busy { background: rgba(201,168,76,0.18); color: #8a6f1e; }
.ba-badge-good { background: rgba(30,125,79,0.12); color: #1E7D4F; }
.ba-badge-bad  { background: rgba(179,38,30,0.12); color: #B3261E; }

.ba-progress-wrap { margin-bottom: 18px; }
.ba-progress-bar {
  height: 8px;
  background: #ebe8e0;
  border-radius: 4px;
  overflow: hidden;
}
.ba-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #C9A84C, #12153D);
  transition: width .3s;
}
.ba-progress-stats {
  margin-top: 8px;
  font-size: 13px;
  color: #4a4a55;
}
.ba-progress-stats strong { color: #12153D; }
.ba-stat-bad { color: #B3261E; font-weight: 600; }
.ba-progress-list {
  border: 1px solid #ebe8e0;
  border-radius: 8px;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
}
.ba-row-progress { padding: 12px 14px; align-items: flex-start; }

@media (max-width: 640px) {
  .ba-dialog {
    margin: 0;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .ba-head { padding: 14px 16px; }
  .ba-body { padding: 14px; }
  .ba-foot { padding: 12px 16px; flex-wrap: wrap; }
  .ba-foot-hint { display: none; }
}

/* ============================================================
   OneDrive Archive — tree view (inside Doc Explorer)
   ============================================================ */
.docs-archive-head {
  padding: 12px 14px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.docs-archive-summary { font-size: 13px; color: #12153D; }
.docs-archive-summary strong { color: #12153D; }
.docs-archive-hint { color: #6b6e80; font-size: 12px; }

.docs-archive-tree {
  border: 1px solid #ebe8e0;
  border-radius: 8px;
  background: #fff;
  padding: 6px 0;
  font-size: 13px;
}

.docs-archive-folder {
  border: none;
}
.docs-archive-folder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.docs-archive-folder-row::-webkit-details-marker { display: none; }
.docs-archive-folder-row:hover { background: rgba(0,0,0,.03); }
.docs-archive-folder-chev {
  font-size: 10px;
  color: #6b6e80;
  transition: transform .15s;
  display: inline-block;
  width: 12px;
}
.docs-archive-folder[open] > .docs-archive-folder-row .docs-archive-folder-chev {
  transform: rotate(90deg);
}
.docs-archive-folder-icon { font-size: 14px; }
.docs-archive-folder-name {
  font-weight: 600;
  color: #12153D;
  flex: 1;
}
.docs-archive-folder-count {
  font-size: 11px;
  color: #6b6e80;
  background: #f0ede5;
  padding: 1px 8px;
  border-radius: 999px;
}
.docs-archive-folder-inner {
  padding-left: 22px;
  border-left: 1px dashed #e6e3da;
  margin-left: 18px;
}

.docs-archive-files { padding: 2px 0; }

/* Checkboxes for multi-select */
.docs-select-cb {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #C9A84C;
  margin-right: 2px;
}

/* Per-folder search bar */
.docs-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid #e6e3da;
  border-radius: 10px;
  margin-bottom: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.docs-search-bar:focus-within {
  border-color: #C9A84C;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.docs-search-icon {
  font-size: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}
.docs-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: #12153D;
  padding: 4px 0;
  min-width: 0;
}
.docs-search-input::placeholder { color: #9ea1ad; }
.docs-search-input::-webkit-search-cancel-button {
  display: none;  /* we provide our own clear button */
}
.docs-search-clear {
  background: transparent;
  border: none;
  color: #6b6e80;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.docs-search-clear:hover {
  color: #B3261E;
  background: rgba(179,38,30,0.08);
}
.docs-search-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: #6b6e80;
  background: #f0ede5;
  padding: 2px 8px;
  border-radius: 999px;
}
.docs-archive-file.is-selected,
.docs-row.is-selected {
  background: rgba(201,168,76,0.12);
  border-radius: 6px;
}
.docs-archive-file.is-selected .docs-archive-file-name,
.docs-row.is-selected .docs-row-name {
  color: #8a6f1e;
  font-weight: 700;
}

/* Archive head select-all */
.docs-archive-head {
  flex-wrap: wrap;
}
.docs-archive-selectall {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b6e80;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
.docs-archive-selectall input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #C9A84C;
}

/* Selection toolbar — appears above the file list when 1+ files selected */
.docs-selection-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(18,21,61,0.95), rgba(18,21,61,1));
  color: #fff;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(18,21,61,0.25);
  border-left: 4px solid #C9A84C;
  position: sticky;
  top: 0;
  z-index: 50;
}
.docs-selection-count {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.docs-selection-count strong {
  background: #C9A84C;
  color: #12153D;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}
.docs-selection-ready {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}
.docs-selection-ready-ok { color: #6cf3a8; }
.docs-selection-ready-loading { color: #f4c97a; }

.docs-selection-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.docs-selection-actions .btn-sm {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
}
.docs-selection-actions .btn-sm:hover {
  background: rgba(201,168,76,0.3);
  border-color: #C9A84C;
}
.docs-selection-hint {
  flex: 1 1 100%;
  font-size: 11.5px;
  opacity: 0.85;
  margin-top: 2px;
}

/* Mobile */
@media (max-width: 640px) {
  .docs-selection-actions { margin-left: 0; }
}

.docs-archive-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: grab;
}
.docs-archive-file:hover { background: rgba(0,0,0,.03); }
.docs-archive-file.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.docs-archive-file:active { cursor: grabbing; }
.docs-archive-file-icon { font-size: 13px; color: #6b6e80; }
.docs-archive-file-name {
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  color: #12153D;
  font-family: inherit;
  font-size: 13px;
  flex: 1;
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.docs-archive-file-name:hover { color: #C9A84C; text-decoration: underline; }
.docs-archive-file-meta {
  font-size: 11px;
  color: #6b6e80;
  flex-shrink: 0;
}
.docs-archive-file-action,
.docs-archive-file-del {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6b6e80;
  font-size: 13px;
  padding: 4px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.docs-archive-file-action:hover {
  color: #12153D;
  background: rgba(0,0,0,.05);
}
.docs-archive-file-del { color: #c0c0c8; }
.docs-archive-file-del:hover {
  color: #B3261E;
  background: rgba(179,38,30,0.08);
}

/* Regular doc rows — visual cue for draggability */
.docs-row[draggable="true"] {
  cursor: grab;
}
.docs-row[draggable="true"]:active { cursor: grabbing; }
.docs-row.is-dragging {
  opacity: 0.5;
}

/* Edit-in-app workflow — replace-this-file prompt (Mitch, 20 May 2026) */
.docs-row {
  position: relative;
}
.docs-edit-prompt {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-top: 8px;
  background: rgba(201, 168, 76, 0.10);
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 6px;
  font-size: 13px;
  color: var(--navy);
}
.docs-edit-prompt-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.docs-edit-prompt-text {
  flex: 1;
  line-height: 1.4;
}
.docs-edit-prompt-replace {
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}
.docs-edit-prompt-replace:hover {
  filter: brightness(1.05);
}
.docs-edit-prompt-dismiss {
  background: transparent;
  border: 1px solid rgba(18, 21, 61, 0.2);
  color: var(--mu);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════════════
   Copy / Move context menu (Mitch, 20 May 2026)
   ════════════════════════════════════════════════════════════════════ */
.docs-ctx-backdrop {
  position: fixed; inset: 0;
  z-index: 9998;
  background: transparent;
}
.docs-ctx-menu {
  position: fixed;
  z-index: 9999;
  min-width: 200px;
  background: #fff;
  border: 1px solid rgba(18, 21, 61, 0.15);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(18, 21, 61, 0.18);
  padding: 6px 0;
  font-size: 13px;
  color: var(--navy);
}
.docs-ctx-head {
  padding: 8px 14px 6px;
  color: var(--mu);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(18, 21, 61, 0.06);
  margin-bottom: 4px;
}
.docs-ctx-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--navy);
}
.docs-ctx-item:hover {
  background: rgba(201, 168, 76, 0.10);
}
.docs-ctx-cancel {
  color: var(--mu);
}
.docs-ctx-sep {
  height: 1px;
  background: rgba(18, 21, 61, 0.08);
  margin: 4px 0;
}

/* Destination picker modal */
.docs-ctx-modal-wrap {
  position: fixed; inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.docs-ctx-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(18, 21, 61, 0.45);
}
.docs-ctx-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(18, 21, 61, 0.30);
}
.docs-ctx-modal-head {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(18, 21, 61, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.docs-ctx-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}
.docs-ctx-modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--mu);
  cursor: pointer;
  padding: 0 4px;
}
.docs-ctx-modal-filter {
  margin: 12px 20px 8px;
  padding: 8px 12px;
  border: 1px solid rgba(18, 21, 61, 0.15);
  border-radius: 6px;
  font-size: 13px;
}
.docs-ctx-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 12px;
}
.docs-ctx-modal-section {
  padding: 10px 20px 4px;
  color: var(--mu);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.docs-ctx-modal-item {
  display: block;
  width: 100%;
  padding: 8px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}
.docs-ctx-modal-item:hover {
  background: rgba(201, 168, 76, 0.08);
}
.docs-ctx-modal-item-label {
  display: block;
  font-size: 13px;
  color: var(--navy);
  font-weight: 500;
}
.docs-ctx-modal-item-hint {
  display: block;
  font-size: 11px;
  color: var(--mu);
  margin-top: 1px;
}

/* Clipboard pending-paste banner (bottom-right) */
.docs-clipboard-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9997;
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(18, 21, 61, 0.25);
  max-width: 420px;
}
.docs-clipboard-icon {
  font-weight: 600;
  color: var(--gold);
}
.docs-clipboard-text {
  line-height: 1.4;
}
.docs-clipboard-clear {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.docs-clipboard-clear:hover {
  background: rgba(255, 255, 255, 0.20);
}

/* Delete option in context menu — red to signal destructive (Mitch 20 May) */
.docs-ctx-item.docs-ctx-delete {
  color: #c0392b;
}
.docs-ctx-item.docs-ctx-delete:hover {
  background: rgba(192, 57, 43, 0.10);
}
