/* =====================================================================
   Projects page - table, edit-modal extras, and the branded print sheet.
   (Modal fields reuse the .nc-* styles from dashboard.css.)
   ===================================================================== */
.pj-wrap { max-width: none; }   /* full width: fixed page margin comes from .main (dashboard.css) */

.pj-err { display: none; margin: 0 0 16px; padding: 12px 16px; border-radius: 10px;
  border: 1px solid rgba(224,136,108,0.5); background: rgba(224,136,108,0.08); color: #e0a84a; font-size: 13.5px; }
.pj-err.show { display: block; }

.pj-tablewrap { overflow-x: auto; border: 1px solid var(--hair); border-radius: 12px; background: var(--panel); }
table.pj-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 780px; }
.pj-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--gold-bright); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.pj-table td { padding: 12px 14px; border-bottom: 1px solid var(--hair-soft); color: var(--text-mid); white-space: nowrap; }
.pj-table tbody tr:last-child td { border-bottom: 0; }
.pj-table tbody tr { cursor: pointer; transition: background .12s ease; }
.pj-table tbody tr:hover { background: rgba(212,175,95,0.06); }
.pj-table td.pj-job { color: var(--text-hi); font-weight: 600; }
.pj-empty { padding: 46px 20px; text-align: center; color: var(--text-dim); font-size: 14px; }

.pj-ghl {
  display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .05em;
  color: var(--gold-bright); border: 1px solid var(--gold-faint); border-radius: 6px;
  padding: 1px 6px; margin-left: 7px; vertical-align: middle;
}

.pj-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pj-modal-head h3 { margin: 0; font-size: 18px; color: var(--text-hi); }
.pj-client-row input { flex: 1; }

/* Branded printable sheet - only visible when printing */
#projPrint { display: none; }
@media print {
  .app, .nc-overlay, .tt-toast { display: none !important; }
  html, body { background: #fff !important; }
  body::before, body::after { display: none !important; content: none !important; }
  #projPrint { display: block; background: #fff; }
  .pjp-sheet, .pjp-table, .pjp-table td, .pjp-table th { background: #fff; }
  .pjp-table th, .pjp-l { background: #efe7d0 !important; }
  .pjp-sheet { color: #111; font-family: Georgia, "Times New Roman", serif; padding: 8px 4px; }
  .pjp-head { display: flex; align-items: center; gap: 18px; border-bottom: 3px solid #caa14e; padding-bottom: 12px; margin-bottom: 16px; }
  .pjp-head img { height: 54px; width: auto; }
  .pjp-head h1 { font-size: 22px; margin: 0; color: #111; font-weight: 600; }
  .pjp-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
  .pjp-table td, .pjp-table th { border: 1px solid #333; padding: 8px 12px; font-size: 12.5px; vertical-align: top; }
  .pjp-table th { text-align: left; background: #efe7d0; color: #111; }
  .pjp-l { width: 34%; font-weight: 700; background: #f3f3f3; }
  .pjp-v { color: #111; }
  .pjp-subh { font-size: 14px; font-weight: 700; color: #111; margin: 6px 0; border-bottom: 2px solid #caa14e; padding-bottom: 4px; }
  @page { margin: 0.6in; }
}

/* ---- Contracts & Documents (project edit popup) -------------------------- */
.pj-docs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pj-doc-none { font-size: 12px; color: var(--text-dim); padding: 2px 0 4px; }
.pj-doc {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px;
  border: 1px solid var(--hair); border-radius: 10px; padding: 7px 11px; background: rgba(255,255,255,0.02);
}
.pj-doc-name {
  color: var(--gold-bright); text-decoration: none; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pj-doc-name:hover { text-decoration: underline; }
.pj-doc-sent { color: #8fd8a2; font-size: 11px; white-space: nowrap; cursor: help; }
.pj-doc-send {
  font: inherit; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--hair); background: none; color: var(--text-mid); cursor: pointer; white-space: nowrap;
}
.pj-doc-send:hover { color: var(--gold-bright); border-color: var(--gold-faint); }
.pj-doc-send:disabled { opacity: .55; cursor: default; }
.pj-doc-del { border: 0; background: none; color: var(--text-dim); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.pj-doc-del:hover { color: #e88b86; }

/* ---- Column customizer ----------------------------------------------------- */
.pj-colwrap { position: relative; }
.pj-colbtn svg { margin-right: 2px; }
.pj-colpanel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  width: 250px; max-height: 62vh; overflow-y: auto; display: none;
  background: var(--panel-solid); border: 1px solid var(--hair);
  border-top: 3px solid var(--gold); border-radius: 14px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.8); padding: 6px 0 8px;
}
.pj-colpanel.show { display: block; }
.pj-colhead { font-size: 12px; font-weight: 700; color: var(--gold-bright); padding: 9px 14px 7px; border-bottom: 1px solid var(--hair-soft); }
.pj-colhead span { display: block; font-weight: 500; color: var(--text-dim); font-size: 10.5px; margin-top: 2px; }
.pj-colrow { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: grab; }
.pj-colrow:hover { background: rgba(255,255,255,0.03); }
.pj-colrow.dragging { opacity: .45; }
.pj-colgrip { color: var(--text-dim); font-size: 11px; letter-spacing: -2px; cursor: grab; user-select: none; }
.pj-colrow label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-mid); cursor: pointer; flex: 1; }
.pj-colrow input[type="checkbox"] { accent-color: var(--gold); }
.pj-colfoot { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px 4px; border-top: 1px solid var(--hair-soft); margin-top: 5px; }
.pj-colfoot button {
  font: inherit; font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 8px;
  border: 1px solid var(--hair); background: none; color: var(--text-mid); cursor: pointer;
}
.pj-colfoot button:hover { color: var(--gold-bright); border-color: var(--gold-faint); }

/* ---- Adaptive customer link (billing) ------------------------------------- */
.pj-adapthint { font-weight: 500; color: var(--text-dim); font-size: 10.5px; margin-left: 6px; }
.pj-adaptrow { display: flex; gap: 8px; align-items: stretch; }
.pj-adaptrow select { flex: 1; min-width: 0; }
.pj-adaptrow .nc-btn { white-space: nowrap; }
.pj-codeinput { max-width: 130px; text-transform: uppercase; letter-spacing: .08em; }
.pj-budget { font-size: 12.5px; color: var(--text-mid); margin-bottom: 8px; }
.pj-budget b { color: var(--gold-bright); }
.pj-budget-table td, .pj-budget-table th { font-size: 12px; }
.pj-budget-table select { width: 100%; min-width: 220px; font-size: 12px; }

/* Wider popups on desktop - the budget table must fit without side-scroll */
@media (min-width: 980px) {
  #pjOverlay .nc-modal-lg { max-width: 900px; }
  #pjBudgetOv .nc-modal-lg { max-width: 1040px; }
  .pj-budget-table select { min-width: 300px; }
}
.pj-budget-table td { white-space: normal; }
.pj-budget-table { min-width: 0; }
