/* r36 (12.10.2026) — the project card ("כרטיס פרויקט", openProjectDetailModal): a wide workspace with readable type.
   Scoped to #modal-container .modal.pj-card only — other windows (apartment, benefits, execution …) are not affected.
   Names, numbers and status pills stay on one line; free-text cells (notes, last contact) wrap with enough room. */

/* the card fills its container (the overlay keeps a thin frame while the card is open) */
html body #modal-overlay:has(.modal.pj-card){padding:10px}
html body #modal-container:has(> .modal.pj-card){padding:0;width:100%;height:100%;max-width:none;max-height:none;justify-content:center;align-items:center}
html body #modal-container .modal.pj-card{
  width:100%;max-width:1760px;height:100%;max-height:none;margin:0;
  font-size:15px;border-radius:18px;overflow:hidden;
}

/* ---- header: project name, contractor / developer line, actions ---- */
html body #modal-container .modal.pj-card .modal-header{padding:1.1rem 1.75rem 0;gap:.7rem!important;flex-shrink:0}
html body #modal-container .modal.pj-card .modal-header h3{font-size:26px!important;line-height:1.25;gap:.6rem!important}
html body #modal-container .modal.pj-card .modal-header h3 .ti{font-size:26px}
html body #modal-container .modal.pj-card .modal-header small{display:block;margin-top:.3rem;font-size:14px!important;line-height:1.5;color:var(--dcs-muted)!important}
html body #modal-container .modal.pj-card .modal-header .btn{font-size:14px;white-space:nowrap;padding:.45rem .85rem}
html body #modal-container .modal.pj-card .modal-header .btn-icon .ti{font-size:22px}

/* ---- tabs: one row, larger, the active tab clearly marked; scrolls only on a narrow screen ---- */
html body #modal-container .modal.pj-card .tabs{display:flex;flex-wrap:nowrap;gap:.15rem;overflow-x:auto;scrollbar-width:thin;
  margin:0 -1.75rem!important;padding:0 1.4rem!important;border-bottom:1px solid var(--dcs-line)!important}
html body #modal-container .modal.pj-card .tabs > :is(.tab,.tab-item){display:inline-flex;align-items:center;gap:.4rem;padding:.85rem .8rem .8rem;
  font-size:15.5px;color:var(--dcs-ink2,var(--text-secondary));white-space:nowrap;cursor:pointer;border-bottom:3px solid transparent;border-radius:10px 10px 0 0}
html body #modal-container .modal.pj-card .tabs > :is(.tab,.tab-item):hover{background:var(--dcs-hover);color:var(--dcs-ink)}
html body #modal-container .modal.pj-card .tabs > :is(.tab,.tab-item).active{color:var(--dcs-bronze-deep);border-bottom-color:var(--dcs-bronze);font-weight:600;background:var(--dcs-bronze-soft)}
html body #modal-container .modal.pj-card .tabs .ti{font-size:19px}
html body #modal-container .modal.pj-card .tabs .soft-chip{font-size:12.5px!important;min-width:26px;padding:2px 9px;text-align:center;line-height:1.5}

/* ---- body: a calm background so the cards / tables stand out; scrolls both ways inside the card ---- */
html body #modal-container .modal.pj-card .modal-body{flex:1;min-height:0;overflow:auto!important;padding:1.3rem 1.75rem 2rem;font-size:15px;background:var(--dcs-cream)}
html body #modal-container .modal.pj-card .modal-body .card{border-radius:14px;padding:1rem 1.25rem!important;margin-bottom:1rem!important}
html body #modal-container .modal.pj-card .modal-body h4{font-size:18px;margin-bottom:.7rem!important}
html body #modal-container .modal.pj-card .modal-body h4 span{font-size:14px!important}
html body #modal-container .modal.pj-card .modal-body strong{font-size:inherit}
html body #modal-container .modal.pj-card .modal-body .soft-chip{font-size:13px!important;padding:4px 11px;white-space:nowrap;line-height:1.45}
html body #modal-container .modal.pj-card .modal-body .btn{font-size:14px;white-space:nowrap}
html body #modal-container .modal.pj-card .modal-body :is(input:not([type=checkbox]):not([type=radio]),select){font-size:14.5px!important;min-height:40px;padding:.4rem .7rem}
html body #modal-container .modal.pj-card .modal-body input[type=search]{min-width:240px!important}
html body #modal-container .modal.pj-card .modal-body label{font-size:14.5px!important}
html body #modal-container .modal.pj-card .modal-body :is(input[type=checkbox],input[type=radio]){width:17px;height:17px;vertical-align:-3px}

/* ---- tables (apartments, leads, coordination, contacts, history …) ---- */
html body #modal-container .modal.pj-card .salary-table-wrap{overflow:visible}
html body #modal-container .modal.pj-card :is(.salary-table,.data-table){width:100%;font-size:14.5px!important;border-collapse:separate;border-spacing:0}
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) thead th{position:sticky;top:-1.3rem;z-index:2;background:var(--dcs-stone);
  color:var(--dcs-ink2,var(--text-secondary));font-size:13.5px;font-weight:600;text-transform:none;letter-spacing:0;white-space:nowrap;
  padding:.75rem .8rem;border-bottom:1px solid var(--dcs-line)}
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) thead th:first-child{border-start-start-radius:10px}
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) thead th:last-child{border-start-end-radius:10px}
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) tbody td{padding:.8rem .8rem;vertical-align:middle;white-space:nowrap;line-height:1.45;
  font-size:14.5px!important;color:var(--dcs-ink);border-bottom:1px solid var(--dcs-line)}
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) tbody tr:nth-child(even) > td{background:rgba(167,128,83,.045)}
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) tbody tr:hover > td{background:var(--dcs-hover)}
/* the small second lines inside a cell (VAT basis, coordinator, building · floor, status …) — readable, not tiny */
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) td :is(div,small,sup){font-size:12.5px!important;line-height:1.4}
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) td .soft-chip{font-size:12.5px!important;padding:3px 10px;display:inline-block}
/* names / links: one line, clearly clickable */
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) td a{white-space:nowrap;font-weight:600;color:var(--dcs-bronze-deep)}
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) td a:hover{text-decoration:underline}
/* free text keeps wrapping — with room */
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) td:is([style*="white-space:normal"],[style*="white-space: normal"]){white-space:normal;min-width:170px;max-width:300px!important}
/* apartments: tighter cells; the handling pill and the buyers' names may take two lines (never one word per line).
   r82: the buyers / notes cells are named by class — the column order changed (buyer, handling, track, contact come first: columns 8-11) */
html body #modal-container .modal.pj-card[data-pj-tab="apartments"] .salary-table :is(th,td){padding-left:.5rem;padding-right:.5rem}
html body #modal-container .modal.pj-card[data-pj-tab="apartments"] .salary-table td:nth-child(9) .soft-chip{white-space:normal;max-width:190px;text-align:center}
html body #modal-container .modal.pj-card[data-pj-tab="apartments"] .salary-table td.pj-apt-buyers{white-space:normal;min-width:150px;max-width:230px}
html body #modal-container .modal.pj-card[data-pj-tab="apartments"] .salary-table td.pj-apt-buyers a{white-space:normal}
html body #modal-container .modal.pj-card[data-pj-tab="apartments"] .salary-table td:last-child .btn-icon{width:32px;height:32px}
/* apartments: the contact cell (phone · email) wraps inside a fixed width */
html body #modal-container .modal.pj-card[data-pj-tab="apartments"] .salary-table td:nth-child(11){white-space:normal;min-width:170px;max-width:230px;overflow-wrap:anywhere}
html body #modal-container .modal.pj-card[data-pj-tab="apartments"] .salary-table td:nth-child(11) div{white-space:normal}
/* coordination: next action + last contact wrap */
html body #modal-container .modal.pj-card[data-pj-tab="coordination"] .salary-table td:nth-child(8){white-space:normal;min-width:240px;max-width:360px}
html body #modal-container .modal.pj-card[data-pj-tab="coordination"] .salary-table td:nth-child(5){white-space:normal;min-width:120px;max-width:170px}
/* row actions: bigger targets */
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) td .btn-icon{width:36px;height:36px;border-radius:9px}
html body #modal-container .modal.pj-card :is(.salary-table,.data-table) td .btn-icon .ti{font-size:19px}

/* ---- footer ---- */
html body #modal-container .modal.pj-card .modal-footer{flex-shrink:0;padding:.8rem 1.75rem;justify-content:flex-start;gap:.6rem}   /* buttons at the start (right): never under the floating drafts chip */
html body #modal-container .modal.pj-card .modal-footer .btn{font-size:15px;padding:.55rem 1.2rem}

/* narrow screens: full screen, slightly smaller type */
@media (max-width:900px){
  html body #modal-container .modal.pj-card{width:100vw;height:100vh;margin:0;border-radius:0;font-size:14px}
  html body #modal-container .modal.pj-card .modal-header,html body #modal-container .modal.pj-card .modal-body{padding-left:1rem;padding-right:1rem}
  html body #modal-container .modal.pj-card .tabs{margin:0 -1rem!important;padding:0 .6rem!important}
}

/* coordination: the long handling pill and the small second lines take two lines at most */
html body #modal-container .modal.pj-card[data-pj-tab="coordination"] .salary-table td:nth-child(3) .soft-chip{white-space:normal;max-width:230px;text-align:center}
html body #modal-container .modal.pj-card[data-pj-tab="coordination"] .salary-table td:is(:nth-child(1),:nth-child(2)) div{white-space:normal;max-width:220px}

/* laptops (≤1440px): slightly smaller type and spacing so the tabs and the wide tables fit */
@media (max-width:1440px){
  html body #modal-container .modal.pj-card .tabs > :is(.tab,.tab-item){font-size:14px;padding:.75rem .55rem .7rem;gap:.3rem}
  html body #modal-container .modal.pj-card .tabs .ti{font-size:17px}
  html body #modal-container .modal.pj-card :is(.salary-table,.data-table){font-size:14px!important}
  html body #modal-container .modal.pj-card :is(.salary-table,.data-table) tbody td{font-size:14px!important;padding:.7rem .55rem}
  html body #modal-container .modal.pj-card :is(.salary-table,.data-table) thead th{padding:.7rem .55rem;font-size:13px}
  html body #modal-container .modal.pj-card .modal-header h3{font-size:23px!important}
  html body #modal-container .modal.pj-card[data-pj-tab="apartments"] .salary-table td.pj-apt-notes{min-width:120px;max-width:150px!important}
  html body #modal-container .modal.pj-card[data-pj-tab="apartments"] .salary-table td:last-child .btn-icon{width:30px;height:30px}
}
