/* ============================================================
 * LendPaper White Labeling — white-label.css (LEN-306 / LEN-308 / LEN-310)
 * Tenant branding chrome + Doc Combine + quote share styles.
 * --tenant-primary is set per tenant by js/branding.js at runtime;
 * the default is LendPaper brand green (BRANDING.md --color-brand-dark).
 * ============================================================ */

:root {
  --tenant-primary: #14532D; /* LendPaper default; overridden per tenant */
  /* Brand token layer (LEN-698) — surfaces must reference these, never a
     hardcoded green, so branding.js can re-theme every state. Defaults = the
     LendPaper green family; overridden per tenant at runtime. */
  --accent-rgb: 20, 83, 45;  /* channels for theming alpha greens: rgba(var(--accent-rgb), a) */
  --accent-ink: #14532D;     /* contrast-safe brand color for text/links on white */
}

/* Hide brand chrome until tenant resolves (returning tenant sessions only —
 * branding.js adds .branding-pending to <html> only when a tenant was cached,
 * so anonymous/non-tenant visitors never see this state). */
.branding-pending [data-tenant-logo],
.branding-pending [data-tenant-name],
.branding-pending [data-tenant-hide] {
  visibility: hidden;
}

/* Tenant logo dropped into the SPA sidebar (replaces the lendpaper wordmark) */
.sidebar-logo img[data-tenant-logo] { max-height: 34px; max-width: 180px; }

/* "Company profile" link in the topbar account cluster (tenant users only) */
.auth-account a[data-tenant-profile-link] {
  font-size: 0.82rem;
  color: var(--accent-ink, var(--tenant-primary, #14532D));
  text-decoration: none;
  font-weight: 600;
}
.auth-account a[data-tenant-profile-link]:hover { text-decoration: underline; }

/* ---------- Homepage tenant contact card ---------- */
.tenant-contact-card {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 3px solid var(--tenant-primary);
  border-radius: 8px;
  background: #fff;
  margin-top: 10px;
}
.tenant-contact-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.tenant-contact-line {
  font-size: 0.85rem;
  color: var(--accent-ink, var(--tenant-primary, #14532D));
  text-decoration: none;
}
.tenant-contact-line:hover { text-decoration: underline; }

/* Tertiary (base/surface) tone — branding.js adds .lp-tenant-surface to <html>
 * only when a tenant sets a tertiary_color, and computes a contrast-safe
 * --tenant-tertiary-ink. The contact card then reads as the tenant's branded
 * surface band; the primary accent stays as the left border for layering. */
.lp-tenant-surface .tenant-contact-card {
  background: var(--tenant-tertiary, #fff);
  border-color: var(--tenant-tertiary, rgba(0, 0, 0, 0.08));
  border-left-color: var(--tenant-primary);
}
.lp-tenant-surface .tenant-contact-name { color: var(--tenant-tertiary-ink, inherit); }
.lp-tenant-surface .tenant-contact-line {
  color: var(--tenant-tertiary-ink, inherit);
  opacity: 0.85;
}

/* ---------- Print/PDF tenant footer ---------- */
[data-tenant-doc-footer] { display: none; }
@media print {
  [data-tenant-doc-footer]:not([hidden]) {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 8pt;
    color: #555;
    text-align: center;
    padding: 4pt 0;
    border-top: 0.5pt solid #ccc;
  }
}

/* ---------- Doc Combine module (LEN-308) ---------- */
.dc-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 20px;
  background: #fff;
  max-width: 560px;
}
.dc-title { margin: 0 0 4px; font-size: 1.05rem; }
.dc-sub { margin: 0 0 16px; font-size: 0.85rem; color: #555; }

.dc-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 22px 12px;
  border: 1.5px dashed var(--tenant-primary);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
}
.dc-drop-label { font-weight: 600; color: var(--accent-ink, var(--tenant-primary, #14532D)); font-size: 0.95rem; }
.dc-drop-hint { font-size: 0.78rem; color: #777; }

.dc-add-amort {
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--accent-ink, var(--tenant-primary, #14532D));
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 6px 0;
}

.dc-list { list-style: none; margin: 14px 0 0; padding: 0; }
.dc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.88rem;
}
.dc-item-idx {
  flex: none;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--tenant-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.dc-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-item-size { flex: none; color: #888; font-size: 0.76rem; }
.dc-item-controls { flex: none; display: inline-flex; gap: 4px; }
.dc-btn {
  width: 30px; height: 30px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}
.dc-btn-x { color: #b3261e; }

.dc-merge {
  margin-top: 16px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--tenant-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.dc-merge:disabled { opacity: 0.45; cursor: not-allowed; }

.dc-error {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #b3261e;
}

/* ---------- Quote share (LEN-310, paid) ---------- */
.qs-btn {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--tenant-primary);
  border-radius: 10px;
  background: #fff;
  color: var(--accent-ink, var(--tenant-primary, #14532D));
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.qs-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.qs-status { margin: 8px 0 0; font-size: 0.82rem; text-align: center; min-height: 1.2em; }
.qs-status.ok { color: #1b7a3d; }
.qs-status.err { color: #b3261e; }

/* ---------- Admin tenant preview pill (LEN-330) ---------- */
.tenant-preview-pill {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #111827;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.tenant-preview-pill button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: none;
  color: #fff;
  font: inherit;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.tenant-preview-pill button:hover { background: rgba(255, 255, 255, 0.12); }

/* Doc Combine, quote share, and the preview pill never belong in the printed document */
@media print {
  .dc-card, .qs-btn, .qs-status, .tenant-preview-pill { display: none !important; }
}

@media (max-width: 480px) {
  .dc-card { padding: 16px; border-radius: 0; border-left: none; border-right: none; }
  .dc-btn { width: 36px; height: 36px; } /* bigger touch targets */
}
