/* אזור מתווכים */
.portal { max-width: 1080px; margin: 0 auto; padding: 36px 20px 90px; min-height: 50vh; }
.portal-loading { text-align: center; color: var(--muted); padding: 40px 0; }
.portal h2 { font-size: 21px; font-weight: 800; margin: 26px 0 12px; color: var(--deep); }
.portal h2 small { font-size: 14px; font-weight: 500; color: var(--muted); }
.portal a { color: var(--sea); }

.pt-card, .pt-auth { background: #fff; border-radius: 24px; padding: 30px; box-shadow: var(--shadow-card); }
.pt-auth { max-width: 640px; margin: 0 auto; padding: 0; overflow: hidden; }
.pt-auth .pt-form { padding: 26px 30px 30px; }
.pt-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--tint); }
.pt-auth-tabs button { font: inherit; font-size: 16px; font-weight: 700; padding: 16px; border: 0; background: transparent; color: var(--soft); cursor: pointer; border-bottom: 3px solid transparent; }
.pt-auth-tabs button[aria-selected="true"] { background: #fff; color: var(--deep); border-bottom-color: var(--amber); }
.pt-done { max-width: 560px; margin: 0 auto; text-align: center; }
.pt-done p { color: var(--soft); line-height: 1.7; }

.pt-form { display: flex; flex-direction: column; gap: 14px; }
.pt-lead { color: var(--soft); line-height: 1.6; }
.pt-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.pt-row.four { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.pt-f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--soft); }
.pt-f small { font-weight: 400; color: var(--muted); }
.pt-f input, .pt-f select, .pt-f textarea, .pt-fwd select, .pt-item select {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; background: #fff; width: 100%;
}
.pt-f input:focus, .pt-f select:focus, .pt-f textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px rgba(14, 116, 144, .14); }
.pt-f.bad input { border-color: #b3261e; }
.pt-f textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
legend { font-weight: 800; color: var(--deep); padding: 0 8px; }
.pt-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--soft); line-height: 1.6; cursor: pointer; }
.pt-check input { margin-top: 4px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--sea); }
.pt-hint { color: var(--muted); font-size: 14px; line-height: 1.6; }

.pt-btn { font: inherit; font-size: 16px; font-weight: 700; background: var(--sea); color: #fff; border: 0; border-radius: 100px; padding: 12px 26px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, transform .15s; }
.pt-btn:hover { background: var(--sea-dark); }
.pt-btn:disabled { opacity: .6; cursor: wait; }
.pt-btn.ghost { background: #fff; color: var(--sea); border: 1.5px solid var(--line); }
.pt-btn.ghost:hover { border-color: var(--sea); }
.pt-btn.sm { font-size: 14px; padding: 7px 14px; }
.pt-form > .pt-btn[type=submit] { align-self: flex-start; }
.pt-auth .pt-btn[type=submit] { align-self: stretch; background: var(--amber); color: var(--amber-ink); padding: 14px; }
.pt-link { font: inherit; font-size: 14.5px; background: none; border: 0; color: var(--sea); cursor: pointer; text-decoration: underline; padding: 4px; }
.pt-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pt-actions.sticky { position: sticky; bottom: 0; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); padding: 12px 0; border-top: 1px solid var(--line); z-index: 2; }
.pt-msg { font-size: 14.5px; min-height: 1em; }
.pt-msg.bad { color: #b3261e; }
.pt-msg.ok { color: #157f3d; }

.pt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.pt-hello { font-size: 24px; font-weight: 800; color: var(--deep); }
.pt-sub { color: var(--muted); font-size: 14.5px; }
.pt-banner { background: #fff7e6; border: 1px solid #f7d58c; color: #6b4a00; border-radius: 14px; padding: 13px 16px; margin-bottom: 14px; line-height: 1.6; }
.pt-banner.bad { background: #fdecea; border-color: #f2b8b5; color: #8c1d18; }
.pt-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1.5px solid var(--line); margin-bottom: 8px; scrollbar-width: none; }
.pt-tabs button { font: inherit; font-size: 15px; font-weight: 700; color: var(--soft); background: none; border: 0; padding: 12px 14px; cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1.5px; display: inline-flex; gap: 6px; align-items: center; }
.pt-tabs button[aria-selected="true"] { color: var(--deep); border-bottom-color: var(--amber); }
.pt-badge:not(:empty) { background: var(--amber); color: var(--amber-ink); font-size: 12px; border-radius: 100px; padding: 1px 7px; }

.pt-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pt-list { display: flex; flex-direction: column; gap: 10px; }
.pt-item { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.pt-item.lead, .pt-list > .pt-item:not(:has(.pt-thumb)) { grid-template-columns: 1fr auto auto; }
.pt-thumb { width: 92px; height: 68px; border-radius: 10px; overflow: hidden; background: var(--tint); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.pt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pt-item-title { font-weight: 700; color: var(--ink); }
.pt-meta { color: var(--muted); font-size: 14px; line-height: 1.6; }
.pt-meta .warn { color: #b3261e; }
.pt-note { font-size: 13.5px; color: #8c1d18; background: #fdecea; border-radius: 8px; padding: 4px 8px; margin-top: 4px; display: inline-block; }
.pt-quote { background: var(--tint); border-radius: 10px; padding: 8px 12px; margin-top: 6px; font-size: 14.5px; color: var(--soft); white-space: pre-line; }
.pt-item-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pt-fwd { display: flex; gap: 6px; }
.pt-fwd select { padding: 6px 10px; font-size: 14px; }
.pt-item select { padding: 6px 10px; font-size: 14px; width: auto; }
.pt-chip { font-size: 12.5px; font-weight: 700; border-radius: 100px; padding: 4px 11px; white-space: nowrap; background: var(--tint); color: var(--soft); }
.st-active, .ag-approved, .ld-won { background: #e3f6ea; color: #157f3d; }
.st-pending, .ag-pending, .ld-new { background: #fff3d6; color: #7a5300; }
.st-rejected, .ag-suspended, .ld-lost { background: #fdecea; color: #8c1d18; }
.ld-forwarded, .ld-in_progress { background: var(--aqua-soft); color: var(--sea-dark); }
.pt-empty { background: var(--tint); border-radius: 16px; padding: 26px; text-align: center; color: var(--soft); }

.pt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 10px; }
.pt-kpi { font: inherit; text-align: start; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.pt-kpi b { font-size: 26px; color: var(--deep); }
.pt-kpi span { color: var(--muted); font-size: 14px; }

.pt-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pt-img { position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--tint); }
.pt-img img { width: 100%; height: 100%; object-fit: cover; }
.pt-img-btn { position: absolute; top: 6px; inset-inline-start: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--deep); cursor: pointer; font-size: 14px; }
.pt-img-btn.del { inset-inline-start: auto; inset-inline-end: 6px; color: #b3261e; }
.pt-cover { position: absolute; bottom: 6px; inset-inline-start: 6px; background: var(--amber); color: var(--amber-ink); font-size: 12px; font-weight: 700; border-radius: 100px; padding: 2px 9px; }
.pt-img-add { aspect-ratio: 4/3; border: 2px dashed var(--line); border-radius: 12px; display: grid; place-items: center; color: var(--sea); font-weight: 700; cursor: pointer; text-align: center; padding: 8px; }
.pt-img-add:hover { border-color: var(--sea); background: var(--tint); }
.pt-img-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.pt-doc { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; padding: 6px 20px; margin: 14px 0; font-size: 15px; line-height: 1.75; background: var(--tint); }
.pt-doc h2 { font-size: 17px; margin: 18px 0 6px; }
.pt-doc p { margin-bottom: 8px; }
.pt-doc ul { padding-inline-start: 20px; }
.pt-gate form { display: flex; flex-direction: column; gap: 12px; }

.pt-deal { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 6px 20px 20px; margin-top: 12px; }
.pt-calc { font-weight: 700; color: var(--deep); min-height: 1.2em; }
.pt-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.pt-table th, .pt-table td { padding: 11px 12px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pt-table th { background: var(--tint); color: var(--soft); font-weight: 700; }

.pt-profile-photo { display: flex; align-items: center; gap: 16px; }
.pt-profile-photo img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--tint); }

.pt-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--deep); color: #fff; padding: 12px 22px; border-radius: 100px; font-weight: 600; z-index: 1000; box-shadow: var(--shadow-card); transition: opacity .4s; }
.pt-toast.bad { background: #8c1d18; }
.pt-toast.out { opacity: 0; }

@media (max-width: 720px) {
  .portal { padding: 22px 16px 80px; }
  .pt-item, .pt-item.lead, .pt-list > .pt-item:not(:has(.pt-thumb)) { grid-template-columns: 1fr; }
  .pt-thumb { width: 100%; height: 150px; }
  .pt-item-acts { justify-content: flex-start; }
  .pt-auth .pt-form { padding: 20px; }
}
.portal a.pt-btn:not(.ghost) { color: #fff; }
