/* Stone Surgeons CRM — Calls page, the browser phone, call scripts, profile, Bugs / Suggestions board, referral codes. */

/* ── Calls page ── */
.calls-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; margin-top: 12px; }
.calls-grid.scripts { grid-template-columns: 280px minmax(0, 1fr); }
.calls-phone { position: sticky; top: 76px; }
.calls-mid, .calls-side { min-width: 0; }
.calls-mid > .in { width: 100%; margin: 10px 0; }
.calls-side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.calls-side h3 { margin: 0 0 6px; } .calls-side h4 { margin: 16px 0 6px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.calls-list { display: grid; gap: 8px; }
.calls-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.calls-row.call { cursor: default; align-items: flex-start; }
.calls-row:hover { border-color: #b9cbe0; } .calls-row.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--ice); }
.calls-row.unheard { border-left: 4px solid var(--blue); }
.calls-row-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.calls-row-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.calls-transcript { margin: 6px 0 0; padding: 8px 10px; background: var(--off); border-radius: 8px; font-size: 14px; white-space: pre-wrap; }
.calls-audio audio { width: 100%; max-width: 360px; margin-top: 6px; }
.calls-note { margin: 0 0 6px; } .calls-details p { white-space: pre-wrap; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.warn { background: #fff4e0; border-color: #f5ddb0; color: #6b4100; cursor: default; }
.row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-lead-call { white-space: nowrap; }
td.c-phone .ph-lead-call { margin-left: 6px; padding: 2px 8px; }
@media (max-width: 1100px) { .calls-grid { grid-template-columns: 280px minmax(0, 1fr); } .calls-side { grid-column: 1 / -1; } }
@media (max-width: 760px) { .calls-grid, .calls-grid.scripts { grid-template-columns: 1fr; } .calls-phone { position: static; } }

/* ── the phone card ── */
.ph-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.ph-card h3 { margin: 0; }
.ph-card.ph-float { position: fixed; right: 16px; bottom: 16px; width: 300px; z-index: 900; box-shadow: var(--shadow); max-height: calc(100vh - 32px); overflow: auto; }
.ph-line { margin: 0; font-size: 13px; color: var(--muted); } .ph-line.ok { color: var(--ok); } .ph-line.err { color: var(--err); }
.ph-num { font-size: 20px; text-align: center; letter-spacing: .04em; }
.ph-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ph-key { border: 1px solid var(--line); background: var(--off); border-radius: 10px; padding: 10px 0; font-size: 18px; font-weight: 700; cursor: pointer; }
.ph-key:hover { background: var(--ice); }
.ph-call, .ph-answer { background: #1d7a4f; } .ph-call:hover, .ph-answer:hover { background: #17633f; }
.ph-end, .ph-decline { background: var(--err); } .ph-end:hover, .ph-decline:hover { background: #a3251f; }
.ph-who { display: grid; gap: 2px; text-align: center; } .ph-who strong { font-size: 18px; } .ph-who span { color: var(--muted); font-size: 14px; }
.ph-time { font: 700 22px/1.2 var(--display); color: var(--ink) !important; }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ph-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 4px; font-weight: 600; font-size: 14px; cursor: pointer; text-align: center; text-decoration: none; color: var(--navy); }
.ph-btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.ph-btn.rec.on { background: var(--err); border-color: var(--err); }
.ph-recording { margin: 0; color: var(--err); font-size: 13px; text-align: center; }
.ph-dispo { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-incoming { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1000; background: var(--navy); color: #fff; border-radius: 14px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); max-width: calc(100vw - 24px); }
.ph-incoming > div { display: grid; } .ph-incoming span { opacity: .85; font-size: 14px; }

/* ── call scripts ── */
.calls-script { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; min-height: 60vh; }
.script-tools { margin-bottom: 10px; }
.script-body { line-height: 1.55; max-width: 70ch; }
.script-body h3 { font-size: 1.15em; margin: 1em 0 .3em; color: var(--navy); }
.script-body p { margin: 0 0 .8em; } .script-body ul { margin: 0 0 .8em; padding-left: 1.2em; }
.script-edit { width: 100%; font-family: inherit; min-height: 50vh; }

/* ── profile ── */
.pf-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.pf-pic { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--ice); display: grid; place-items: center; font: 800 32px var(--display); color: var(--navy); flex: none; }
.pf-pic img { width: 100%; height: 100%; object-fit: cover; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.topbar .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

/* ── Bugs / Suggestions board ── */
.fb-new { margin: 0 0 16px; } .fb-new > summary { list-style: none; display: inline-flex; } .fb-new > summary::-webkit-details-marker { display: none; }
.fb-new[open] > summary { margin-bottom: 10px; }
.fb-plus.on { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── referral codes ── */
.scope-pick { display: inline-flex; align-items: center; gap: 6px; }
.code-st { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.code-st.live { background: #fff1b8; color: #6b5200; }
.code-st.used { background: #d9f5e6; color: #146c3f; }
.code-st.boof { background: #fde0de; color: #a3251f; }
