/* Web client - desktop-first layout (icon rail + top bar + floating call window), folds to a phone layout under 760px */
body.wc { overflow: hidden; }
.wc-app { display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: 58px minmax(0, 1fr); height: 100vh; }

/* top bar */
.wc-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 16px 0 0; background: var(--side); color: #fff; z-index: 20; }
.wc-top .brand { width: 84px; justify-content: center; padding: 0; font-size: 0; }
.wc-top .brand span:last-child { display: none; }
.wc-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.reg { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--side-ink); margin-right: 6px; }
.top-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #fff; font: inherit; cursor: pointer; }
.top-btn:hover { background: rgba(255,255,255,.12); }
.top-btn.primary { background: var(--green); border-color: var(--green); font-weight: 600; }
.top-btn.primary:hover { background: #12894a; }
.top-btn .caret { opacity: .6; font-size: 11px; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; }
.av { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: #2b4a6f; color: #fff; font-weight: 700; font-size: 13px; position: relative; }
.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(14,26,43,.22); z-index: 40; }
.pop.menu { min-width: 240px; padding: 6px; display: grid; }
.pop.menu > button, .pop.menu > a { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 8px; font: inherit; color: var(--ink); cursor: pointer; flex-wrap: wrap; }
.pop.menu > button:hover, .pop.menu > a:hover { background: #f2f5f9; }
.pop.menu small { width: 100%; padding-left: 19px; color: var(--muted); font-size: 12px; margin-top: -4px; }
.me-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; gap: 2px; }
.me-head small { color: var(--muted); }
.dot.away { background: var(--amber); }
.dot.dnd { background: var(--red); }

/* dialer popover */
.dialer { width: 300px; padding: 14px; display: grid; gap: 10px; }
.dial-input { display: flex; align-items: center; border: 1px solid #d3d9e2; border-radius: 10px; padding: 0 4px 0 12px; }
.dial-input input { border: 0; font-size: 20px; padding: 10px 0; outline: none; }
.dial-input .icon { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 6px 8px; }
.suggest:empty { display: none; }
.suggest { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.suggest button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 8px 10px; font: inherit; text-align: left; cursor: pointer; }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.sel { background: var(--accent-2); }
.suggest small { margin-left: auto; color: var(--muted); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad .k { height: 52px; border-radius: 10px; border: 1px solid var(--line); background: #f7f9fc; font: inherit; font-size: 20px; cursor: pointer; display: grid; place-items: center; line-height: 1; }
.pad .k small { display: block; font-size: 9px; letter-spacing: .14em; color: var(--muted); margin-top: 2px; }
.pad .k:hover { background: #eef3f9; }
.call-go { background: var(--green); border-color: var(--green); }
.call-go:hover { background: #12894a; }

/* rail */
.wc-rail { background: var(--side); display: flex; flex-direction: column; padding: 8px 8px 12px; gap: 4px; overflow-y: auto; }
.wc-rail a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 10px 4px; border-radius: 10px; color: var(--side-ink); font-size: 12px; }
.wc-rail a:hover { background: rgba(255,255,255,.06); color: #fff; }
.wc-rail a.active { background: var(--accent); color: #fff; }
.wc-rail .ri { font-size: 18px; line-height: 1; }
.wc-rail .rail-end { margin-top: auto; }
.rb { position: absolute; top: 4px; right: 12px; background: var(--red); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 1px 6px; }

/* main */
.wc-main { overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.wc-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px 14px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.wc-head h1 { margin: 0; font-size: 20px; font-weight: 650; }
.wc-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wc-body { padding: 20px 24px 120px; }
.banner { background: #fff6e0; color: #7a5200; font-size: 13px; padding: 9px 24px; border-bottom: 1px solid #f3e1b3; }

/* team */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1px solid #d3d9e2; background: #fff; border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--accent-2); border-color: #9cc8ee; color: #075d9f; font-weight: 600; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; position: relative; }
.tcard:hover { border-color: #b9c7d8; box-shadow: 0 4px 14px rgba(14,26,43,.06); }
.tcard .av { width: 44px; height: 44px; grid-row: span 2; background: #e6eef7; color: #23476e; }
.tcard .av .dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border: 2px solid #fff; }
.tcard b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .st { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .acts { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 8px; }
.tcard .acts .btn { padding: 5px 10px; font-size: 12.5px; }
.group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin: 18px 0 10px; }
.group-title:first-child { margin-top: 0; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { background: #12894a; }
.num-link { color: var(--accent); cursor: pointer; white-space: nowrap; }
.num-link:hover { text-decoration: underline; }
.dir-in { color: var(--accent); } .dir-out { color: var(--purple); } .dir-miss { color: var(--red); }

/* queues */
.qcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.qcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; }
.qcard.on { border-color: #9fd9b8; box-shadow: inset 4px 0 0 var(--green); }
.switch { position: relative; width: 46px; height: 26px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cfd6df; border-radius: 99px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }

/* panel */
.panel-split { display: grid; gap: 16px; }

/* settings */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* call window */
.callwin { position: fixed; right: 24px; bottom: 24px; width: 340px; background: #0f2036; color: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(14,26,43,.45); padding: 16px; display: grid; gap: 14px; z-index: 60; }
.cw-top { display: flex; gap: 12px; align-items: center; }
.cw-av { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; font-weight: 700; flex: none; }
.cw-who { min-width: 0; display: grid; }
.cw-who b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-who small { color: #a9bdd6; font-size: 12.5px; }
.cw-state { margin-left: auto; font: 600 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #cfe1f6; }
.callwin.ringing { animation: ringpulse 1.2s ease-in-out infinite; }
@keyframes ringpulse { 50% { box-shadow: 0 24px 60px rgba(14,26,43,.45), 0 0 0 6px rgba(24,160,88,.35); } }
.cw-ctl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cw-ctl button { border: 0; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font: inherit; font-size: 11.5px; padding: 8px 0 7px; cursor: pointer; display: grid; gap: 3px; justify-items: center; }
.cw-ctl button span { font-size: 17px; }
.cw-ctl button:hover { background: rgba(255,255,255,.18); }
.cw-ctl button.on { background: #fff; color: #0f2036; }
.cw-ans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cw-ans .btn, .cw-end .btn { justify-content: center; padding: 10px; }
.cw-pad .k { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; height: 44px; }
.cw-pad .k small { color: #a9bdd6; }
.cw-pad .k:hover { background: rgba(255,255,255,.18); }
.cw-xfer { display: flex; gap: 8px; }
.cw-xfer input { border: 0; }

/* phone-sized screens: rail becomes a bottom bar, call window becomes a sheet */
@media (max-width: 760px) {
  .wc-app { grid-template-columns: 1fr; grid-template-rows: 54px minmax(0, 1fr) 62px; }
  .wc-top { padding-right: 10px; }
  .wc-top .brand { width: 54px; }
  .top-btn .lbl, .reg #regText { display: none; }
  .wc-rail { grid-row: 3; flex-direction: row; padding: 4px; justify-content: space-around; overflow: hidden; }
  .wc-rail a { padding: 6px 2px; font-size: 10.5px; flex: 1; }
  .wc-rail .rail-end { margin-top: 0; }
  .wc-head { padding: 14px 16px 10px; }
  .wc-body { padding: 14px 16px 120px; }
  .set-grid { grid-template-columns: 1fr; }
  .callwin { left: 8px; right: 8px; bottom: 70px; width: auto; }
  .dialer { position: fixed; left: 8px; right: 8px; top: 62px; width: auto; }
}
/* virtual faxes */
.fax-tabs { margin-bottom: 14px; }
.fax-send, .fax-filters { padding: 18px 20px; }
.fax-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 40px; }
.fax-grid label, .fax-grid .lbl-wrap { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 4px 12px; font-weight: 600; font-size: 13px; }
.fax-grid label .hint, .fax-grid .lbl-wrap .hint { grid-column: 2; font-weight: 400; }
.fax-grid .lbl-wrap > .lbl { font-weight: 600; }
.file-pick { display: flex; align-items: center; gap: 8px; border: 1px dashed #c7d0dc; border-radius: 8px; padding: 6px 6px 6px 12px; min-height: 37px; }
.file-pick > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick.has { border-style: solid; background: #f6fafe; }
.file-pick.drag { border-color: var(--accent); background: #eaf3fd; }
.fax-bar { margin: 12px 0 8px; gap: 6px; }
.fax-bar select, .fax-bar input { width: auto; display: inline-block; padding: 5px 8px; }
.fax-table .sortable { cursor: pointer; user-select: none; }
.fax-type { font-size: 12.5px; font-weight: 600; }
.fax-type.incoming { color: #1d5fa8; } .fax-type.outgoing { color: #a8481c; }
.pager { display: flex; gap: 4px; }
@media (max-width: 1000px) { .fax-grid { grid-template-columns: 1fr; } }
.fax-table td { white-space: normal; }
.fax-table td.nowrap { white-space: nowrap; }
.fax-table td:nth-child(6) { word-break: break-all; min-width: 130px; font-size: 12px; }
.fax-table td:nth-child(8) { max-width: 170px; }
.fax-table td:nth-child(4) { min-width: 150px; }
.fax-table td:nth-child(3), .fax-table td:nth-child(5) { white-space: nowrap; }
.fax-table td:nth-child(6) { min-width: 0; max-width: 150px; }
