/* Τηλέφωνο στη σελίδα και κουμπί «Κλήση» (01/12/2026). */
.pbx-call {
  margin-left: 8px; padding: 7px 16px; font: inherit; font-size: 1em; font-weight: 600; line-height: 1.3;
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  color: var(--brand); background: none; border: 1px solid var(--brand); border-radius: var(--radius-sm); cursor: pointer;
}
.pbx-call svg { flex: none; }
/* Αριθμός και «Κλήση» μαζί, στην ίδια γραμμή (01/12/2026). */
.tel-call { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.tel-call .pbx-call { margin-left: 0; }
.crm-phones { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 6px; }
.crm-contact-lines { display: grid; gap: 6px; justify-items: start; }
.pbx-call:hover { color: #fff; background: var(--brand); }
.pbx-call:disabled { opacity: .5; cursor: default; }

/* Κλήση συναδέλφου δίπλα στον χειριστή του CRM (02/12/2026): πράσινο = συνδεδεμένος. */
.pbx-mate { display: inline-grid; place-items: center; width: 32px; height: 30px; padding: 0; color: var(--ink); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.pbx-mate[hidden] { display: none; }
.pbx-mate.on { color: var(--ok, #15803d); }
.pbx-mate.off { color: var(--muted); opacity: .55; }
.pbx-mate:hover:not(:disabled) { background: var(--fill); }
.pbx-mate:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pbx-mate:disabled { cursor: default; }
@media (pointer: coarse) { .pbx-mate { width: 40px; height: 40px; } }

.pbx-choose {
  position: fixed; z-index: 60; width: min(320px, calc(100vw - 16px));
  background: var(--panel); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px;
}
.pbx-choose-head { padding: 8px 10px 6px; font-weight: 600; }
.pbx-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left;
  padding: 10px; font: inherit; color: inherit; background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer;
}
.pbx-opt:hover:not(:disabled), .pbx-opt:focus-visible { background: var(--hover); outline: none; }
.pbx-opt:disabled { cursor: default; opacity: .55; }
.pbx-opt .muted { font-size: .85em; }

.pbx-panel {
  position: fixed; z-index: 60; right: 16px; bottom: 16px; width: min(300px, calc(100vw - 32px));
  background: var(--panel); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px;
}
.pbx-who { font-weight: 600; font-size: 1.05em; overflow-wrap: anywhere; }
.pbx-state { display: block; color: var(--muted); margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.pbx-panel.in-card .pbx-who { display: none; }
/* Η άλλη κλήση (αναμονή ή δεύτερη που χτυπά), σε μία γραμμή (απόφαση Mike 02/12/2026) */
.pbx-others { display: grid; }
.pbx-other { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.pbx-other-who { flex: 1; min-width: 0; display: grid; }
.pbx-other-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbx-other-who span { font-size: .9em; color: var(--muted); font-variant-numeric: tabular-nums; }
.pbx-other.ringing .pbx-other-who span { color: var(--ok, #15803d); font-weight: 600; }
.pbx-panel > .pbx-others { margin: -14px -14px 12px; }
.pbx-panel > .pbx-others .pbx-other { padding: 10px 14px; }
.pcc.mini .pbx-other { padding: 8px 14px; border-bottom: 0; border-top: 1px solid var(--line); }
/* Τηλέφωνο που ανήκει σε πολλούς πελάτες */
.pcc-pick { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.pcc-pick h3 { margin: 0 0 10px; font-size: 1em; font-weight: 600; }
.pcc-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.pcc-pick-one { display: grid; gap: 2px; padding: 10px 12px; text-align: left; font: inherit; color: inherit; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.pcc-pick-one b { font-weight: 600; }
.pcc-pick-one span { font-size: .88em; color: var(--muted); }
.pcc-pick-one:hover, .pcc-pick-one:focus-visible { border-color: var(--brand); outline: none; }
.pbx-controls { display: flex; flex-wrap: wrap; gap: 10px; }
/* Κουμπιά της κλήσης: στρογγυλά εικονίδια όπως στο τηλέφωνο (απόφαση Mike 02/12/2026). */
.pbx-ic {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
  color: var(--ink); background: var(--fill); border: 1px solid transparent; transition: background-color .15s, color .15s;
}
.pbx-ic[hidden] { display: none; }
.pbx-ic:disabled { opacity: .4; cursor: default; }
.pbx-ic:hover:not(:disabled) { background: var(--fill-press); }
.pbx-ic.on, .pbx-ic.on:hover:not(:disabled) { color: var(--panel); background: var(--ink); }
.pbx-ic.answer { color: #fff; background: #15803d; }
.pbx-ic.answer:hover:not(:disabled) { background: #11692f; }
.pbx-ic.hang { color: #fff; background: #d92d20; }
.pbx-ic.hang:hover:not(:disabled) { background: #b42318; }
.pbx-ic.hang svg { transform: rotate(135deg); }
.pcc-tool { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: none; cursor: pointer; }
.pcc-tool:hover { color: var(--ink); background: var(--fill); }
.pbx-ic:focus-visible, .pcc-tool:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pbx-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.pbx-pad[hidden], .pbx-users[hidden] { display: none; }
/* Λίστα «Μεταφορά σε» (02/12/2026) */
.pbx-users { display: grid; gap: 2px; margin-top: 10px; }
.pbx-users-head { margin: 0; padding: 4px 10px; font-size: .85em; color: var(--muted); }
.pbx-users-none { margin: 0; padding: 8px 10px; color: var(--muted); }
.pbx-user { display: grid; gap: 1px; width: 100%; padding: 8px 10px; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.pbx-user b { font-weight: 600; }
.pbx-user span { font-size: .88em; color: var(--muted); }
.pbx-user span.on { color: var(--ok, #15803d); }
.pbx-user:hover:not(:disabled), .pbx-user:focus-visible { background: var(--fill); outline: none; }
.pbx-user:disabled { cursor: default; }
.pbx-user:disabled b { color: var(--muted); }
.pbx-pad .btn { justify-content: center; }
@media (max-width: 640px) { .pbx-panel { right: 8px; left: 8px; bottom: 8px; width: auto; } }

/* Κλήση και ιστορικό προμηθευτή (Ανάγκες, Σύγκριση προσφορών, 01/12/2026) */
.sup-tools { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.sup-tools .pbx-call { margin-left: 0; }
.sup-talk { margin-top: 10px; }
.sup-talk-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.sup-talk-text { margin: 6px 0 0; white-space: pre-line; }
/* Ηχογράφηση και απομαγνητοφώνηση στο ιστορικό (01/12/2026) */
.msg-call { display: grid; gap: 4px; margin-top: 6px; }
.msg-call audio { width: 100%; max-width: 360px; height: 32px; }
.msg-transcript { white-space: pre-line; font-size: 12.5px; max-height: 260px; overflow: auto; border-left: 2px solid var(--line); padding-left: 8px; }

/* Καρτέλα κλήσης (01/12/2026): ένα παράθυρο στο κέντρο, η κλήση πάνω και τα στοιχεία σε στήλες (απόφαση Mike). */
.pcc-bg { position: fixed; inset: 0; z-index: 58; background: rgba(15, 18, 24, .28); }
.pcc-bg[hidden] { display: none; }
.pcc {
  position: fixed; z-index: 59; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(1040px, calc(100vw - 48px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow-lg); overflow: hidden;
}
.pcc-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.pcc-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; letter-spacing: .02em; border: 1px solid var(--line); color: var(--brand); }
.pcc-id { min-width: 0; }
.pcc-name { margin: 0; font-size: 1.3em; line-height: 1.2; overflow-wrap: anywhere; }
.pcc-sub { margin-top: 3px; color: var(--muted); font-size: .92em; overflow-wrap: anywhere; }
.pcc-call { display: flex; align-items: center; justify-content: flex-end; min-width: 0; }
.pcc-call .pbx-state { margin: 0; text-align: right; }
.pbx-panel.in-card { position: static; width: auto; box-shadow: none; background: none; padding: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.pbx-panel.in-card .pbx-state { white-space: nowrap; margin: 0; font-size: 1.05em; color: var(--ink); }
.pbx-panel.in-card .pbx-pad, .pbx-panel.in-card .pbx-users { flex-basis: 100%; max-width: 220px; margin-left: auto; }
.pcc-tools { display: flex; gap: 2px; }
.pcc-dialbox { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pcc-dial { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.15em; font-weight: 650; padding: 14px 28px; min-height: 52px; border-radius: calc(var(--radius) + 2px); }
.pcc-dial svg { flex: none; }
.pcc-via { color: var(--muted); font-size: .85em; }
.pcc-body { overflow: auto; }
/* Κατάσταση πελάτη: κείμενο, όχι χρωματιστό φόντο (κανόνας εμφάνισης). */
.pcc-status { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: .92em; }
.pcc-st { color: var(--muted); }
.pcc-st.active { color: var(--ok, #15803d); font-weight: 600; }
.pcc-st.lost { color: var(--warn, #b45309); font-weight: 600; }
.pcc-st.prospect { color: var(--ink); font-weight: 600; }
.pcc-st.bad { color: var(--bad, #b91c1c); font-weight: 600; }
/* Τα τέσσερα νούμερα: μία σειρά, οριζόντια. */
.pcc-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.pcc-tile { padding: 14px 20px; display: grid; gap: 2px; align-content: start; }
.pcc-tile + .pcc-tile { border-left: 1px solid var(--line); }
.pcc-tile-label { font-size: .74em; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pcc-tile-value { font-size: 1.35em; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.25; }
.pcc-tile-note { font-size: .85em; color: var(--muted); }
.pcc-tile.bad .pcc-tile-value, .pcc-tile.bad .pcc-tile-note { color: var(--bad, #b91c1c); }
.pcc-tiprow { padding: 14px 20px 0; }
.pcc-kv.bad b, .pcc-kv.bad span { color: var(--bad, #b91c1c); }
.pcc-quick { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.pcc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pcc-col { padding: 18px 20px; display: grid; gap: 22px; align-content: start; }
.pcc-col + .pcc-col { border-left: 1px solid var(--line); }
.pcc-block h3, .pcc-tip h3 { margin: 0 0 10px; font-size: .74em; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pcc-none { margin: 0; color: var(--muted); }
.pcc-minor { margin: 10px 0 6px; font-size: .85em; color: var(--muted); }
.pcc-item { padding: 8px 0; }
.pcc-item + .pcc-item { border-top: 1px dashed var(--line); }
.pcc-item-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.pcc-item-top > :last-child { color: var(--muted); font-size: .88em; white-space: nowrap; }
.pcc-item-text { margin: 4px 0 0; white-space: pre-line; font-size: .93em; line-height: 1.45; }
.pcc-desc { max-height: 220px; overflow: auto; }
.pcc-lines { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: .93em; }
.pcc-lines li { display: flex; justify-content: space-between; gap: 10px; }
.pcc-lines li b { font-variant-numeric: tabular-nums; }
.pcc-kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .95em; }
.pcc-kv span { color: var(--muted); }
.pcc-kv b { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.pcc-kv.strong b { font-weight: 700; }
.pcc-flags { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: .9em; }
.pcc-tip { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.pcc-tip-text { margin: 0; line-height: 1.5; }
.pcc-note { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.pcc-note textarea { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; min-height: 44px; }
.pcc-note-actions { display: flex; gap: 6px; }
/* Σμίκρυνση: μόνο η πάνω γραμμή, κάτω δεξιά, χωρίς σκίαση της σελίδας. */
.pcc.mini { left: auto; top: auto; right: 16px; bottom: 16px; transform: none; width: min(560px, calc(100vw - 32px)); cursor: pointer; }
.pcc.mini .pcc-body { display: none; }
.pcc.mini .pcc-head { border-bottom: 0; padding: 12px 14px; }
.pcc.mini .pcc-sub, .pcc.mini .pcc-avatar { display: none; }
.pcc.mini .pcc-head { grid-template-columns: minmax(0, 1fr) auto auto; }
.pcc.mini .pcc-name { font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Το πληκτρολόγιο ανοίγει πάνω από τα στοιχεία, χωρίς να σπρώχνει την καρτέλα. */
.pbx-panel.in-card { position: relative; inset: auto; }
.pcc:not(.mini) .in-card .pbx-pad, .pcc:not(.mini) .in-card .pbx-users { position: absolute; z-index: 2; top: calc(100% + 8px); right: 0; width: 220px; margin: 0; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.pcc:not(.mini) .pcc-head { position: relative; z-index: 1; }
@media (max-width: 900px) {
  .pcc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pcc-tile:nth-child(3) { border-left: 0; }
  .pcc-tile:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pcc-grid { grid-template-columns: 1fr; }
  .pcc-col + .pcc-col { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .pcc { left: 0; top: 0; transform: none; width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
  .pcc-head { grid-template-columns: auto minmax(0, 1fr) auto; padding: 14px; }
  .pcc-tools { grid-row: 1; grid-column: 3; }
  .pcc-call { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; }
  .pbx-panel.in-card { justify-content: flex-start; gap: 8px; }
  .pbx-panel.in-card .pbx-controls { gap: 6px; flex-wrap: nowrap; }
  .pbx-panel.in-card .pbx-ic { width: 42px; height: 42px; }
  .pbx-panel.in-card .pbx-state { font-size: .95em; white-space: normal; }
  .pcc:not(.mini) .in-card .pbx-pad, .pcc:not(.mini) .in-card .pbx-users { right: auto; left: 0; }
  .pcc.mini .pcc-head { grid-template-columns: minmax(0, 1fr) auto; }
  .pcc.mini .pcc-tools { grid-column: 2; }
  .pcc-call .pbx-state { text-align: left; }
  .pcc-dialbox { align-items: stretch; width: 100%; }
  .pcc-via { text-align: center; }
  .pcc-note { grid-template-columns: 1fr; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
  .pcc.mini { left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
}
