/*
  Bootstrap 5.3.8 (vendor/bootstrap/) is the base — loaded before this file
  on every page. This file only covers what Bootstrap has no component for:
  the drag-and-drop zone, the rich-text editor + its toolbar, attachment
  thumbnails, roster rows, and a few entry-card specifics. Everything else
  (buttons, form controls, cards, nav, badges, grid, toasts) uses real
  Bootstrap classes in the HTML — see public/*.html.

  Uses Bootstrap's own CSS variables (--bs-primary, --bs-border-color, etc.)
  instead of inventing separate tokens, so these custom pieces automatically
  follow Bootstrap's theme (including its built-in dark mode).
*/

body { background: var(--bs-tertiary-bg); }

.app-narrow { max-width: 900px; margin-inline: auto; }

/* ---------- Rich text editor (New Entry + Manager Review) ---------- */
.rte, .review-rte {
  min-height: 110px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 10px 12px;
  background: var(--bs-body-bg);
  font-size: 0.95rem;
}
.rte:focus, .review-rte:focus {
  outline: 0;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}
.rte:empty::before, .review-rte:empty::before {
  content: attr(data-placeholder);
  color: var(--bs-secondary-color);
  pointer-events: none;
}
.rte ul, .rte ol, .review-rte ul, .review-rte ol { margin: 4px 0 4px 20px; padding: 0; }
.rte p, .review-rte p { margin: 0 0 8px; }

/* ---------- Dropzone (attachments) ---------- */
.dropzone {
  border: 2px dashed var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 18px 14px;
  text-align: center;
  background: var(--bs-tertiary-bg);
  transition: border-color .15s, background .15s;
}
.dropzone.dragover {
  border-color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.08);
}
.dropzone:focus-within {
  border-color: var(--bs-primary);
  outline: 0.2rem solid rgba(var(--bs-primary-rgb), 0.25);
}
.dropzone-hint { margin: 0; font-size: 0.9rem; }
.dropzone-subhint { margin: 4px 0 0; font-size: 0.8rem; color: var(--bs-secondary-color); }
.dropzone-browse { color: var(--bs-primary); text-decoration: underline; cursor: pointer; font-weight: 600; }

.attachments-preview, .attachments-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.pending-attachment { width: 84px; }
.pending-thumb-wrap { position: relative; width: 84px; height: 84px; }
.pending-thumb, .attachment-thumb {
  width: 84px; height: 84px; object-fit: cover;
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  display: block;
}
.attachment-thumb-link { display: block; line-height: 0; }
.pending-file-icon {
  width: 84px; height: 84px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius);
  background: var(--bs-tertiary-bg); font-size: 11px; color: var(--bs-secondary-color); text-align: center; padding: 4px;
}
.pending-name {
  display: block; font-size: 11px; color: var(--bs-secondary-color); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pending-remove {
  position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); color: var(--bs-danger);
  font-size: 13px; line-height: 1; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pending-remove:hover { background: var(--bs-danger); color: #fff; }
.attachment-file {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px;
  border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius);
  background: var(--bs-tertiary-bg); color: var(--bs-body-color); font-size: 0.8rem; text-decoration: none;
}
.attachment-file:hover { background: var(--bs-secondary-bg); }
.attachment-size { color: var(--bs-secondary-color); }

/* ---------- Entry cards (Complete Log, home of the analyst name heading) ---------- */
.entry-card {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.entry-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; font-size: 0.85rem; color: var(--bs-secondary-color); margin-bottom: 8px; }
.entry-meta strong { color: var(--bs-body-color); }
.entry-title { margin: 0; font: inherit; font-weight: 700; color: var(--bs-body-color); }
.entry-body { font-size: 0.95rem; border-top: 1px solid var(--bs-border-color); padding-top: 8px; }
.entry-body ul, .entry-body ol { margin: 4px 0 4px 20px; padding: 0; }
.entry-body p { margin: 0 0 6px; }
.analyst-link { color: var(--bs-primary); text-decoration: none; font-weight: 600; }
.analyst-link:hover { text-decoration: underline; }

/* ---------- Manager Review page ---------- */
.review-card { border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); padding: 16px 18px; margin-bottom: 16px; }
.review-readonly dt { font-size: 0.75rem; font-weight: 600; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .02em; margin-top: 10px; }
.review-readonly dd { margin: 2px 0 0; }
.review-editable { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--bs-border-color); }
.review-updated { font-size: 0.8rem; color: var(--bs-secondary-color); margin-top: 8px; }

/* ---------- Manage Roster page ---------- */
.roster-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bs-border-color); }
.roster-row:last-child { border-bottom: none; }
.roster-row-name { flex: 1; font-size: 0.9rem; font-weight: 600; }
.roster-row-manager { width: auto; min-width: 160px; }

/* ---------- Home page ---------- */
.home-card { transition: border-color .12s, box-shadow .12s, transform .12s; text-decoration: none; }
.home-card:hover { border-color: var(--bs-primary); box-shadow: 0 2px 10px rgba(var(--bs-primary-rgb), 0.15); transform: translateY(-1px); }
