/* טראנקול פון - the colors of trunkol.co.il (deep blue + orange, Heebo), in a darker, app-like frame. */
:root {
  --navy-900: #04213b; --navy-800: #062f52; --navy-700: #073d6c; --blue: #07569a; --blue-500: #1170c4; --blue-soft: #eaf5fd;
  --orange: #ff6500; --orange-600: #e85a00; --orange-soft: #fff1e6;
  --green: #16a34a; --green-soft: #e8f7ee; --red: #e5383b; --red-soft: #fdecec; --amber: #f59e0b;
  --text: #102f4c; --muted: #5c7690; --line: #e1ebf4; --bg: #f3f7fb; --card: #fff;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(6, 47, 82, .05), 0 8px 28px rgba(6, 47, 82, .07);
  --shadow-lg: 0 24px 70px rgba(4, 33, 59, .28);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Heebo', Arial, sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--orange) 55%, transparent); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--card); }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 15% 85%, rgba(255, 101, 0, .35), transparent 42%), radial-gradient(circle at 90% 10%, rgba(17, 112, 196, .55), transparent 45%), linear-gradient(150deg, var(--navy-900), var(--navy-700) 55%, var(--blue)); }
.login-hero::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(to bottom, #000, transparent 75%); }
.login-hero > * { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 22px; }
.hero-brand img { width: 44px; height: 44px; }
.hero-copy h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.15; margin: 0 0 16px; font-weight: 900; letter-spacing: -.5px; }
.hero-copy h1 em { font-style: normal; color: #ffb27d; }
.hero-copy p { font-size: 18px; color: rgba(255, 255, 255, .78); max-width: 440px; margin: 0; }
.hero-points { display: grid; gap: 12px; margin-top: 34px; }
.hero-points div { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .9); font-weight: 500; }
.hero-points svg { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #ffb27d; }
.hero-foot { font-size: 13px; color: rgba(255, 255, 255, .55); }
.login-side { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: min(400px, 100%); }
.login-card .logo { width: 210px; display: block; margin-bottom: 28px; }
.login-card h2 { font-size: 28px; margin: 0 0 6px; font-weight: 800; }
.login-card p.lead { margin: 0 0 28px; color: var(--muted); }
.login-card .btn { width: 100%; height: 50px; font-size: 16px; margin-top: 8px; }
.login-card .secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- forms & buttons */
.field { display: grid; gap: 6px; margin-bottom: 16px; align-content: start; }
.field label { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); font-size: 12.5px; }
.input, select.input, textarea.input { width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 0 14px; background: #fbfdff; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 80px; padding: 10px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(17, 112, 196, .12); background: #fff; }
.input.ltr { direction: ltr; text-align: right; }
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--radius-sm); border: 0; font-weight: 700; white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(180deg, #ff7a1f, var(--orange)); color: #fff; box-shadow: 0 6px 18px rgba(255, 101, 0, .28); }
.btn-primary:hover { background: var(--orange-600); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--navy-700); }
.btn-ghost { background: #fff; border: 1.5px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: #c9dbea; background: #f8fbfe; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fbdcdc; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--blue-soft); color: var(--blue); }
.icon-btn svg { width: 18px; height: 18px; }
.error-box { background: var(--red-soft); color: #b42318; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; font-weight: 500; font-size: 14px; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfdbe7; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; top: 3px; right: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(-20px); }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; color: #fff;
  background: radial-gradient(circle at 100% 0, rgba(17, 112, 196, .35), transparent 50%), linear-gradient(180deg, var(--navy-800), var(--navy-900)); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.side-brand img { width: 38px; height: 38px; }
.side-brand b { display: block; font-size: 19px; font-weight: 800; line-height: 1.1; }
.side-brand small { color: rgba(255, 255, 255, .55); font-size: 12px; }
.nav { display: grid; gap: 4px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 12px; background: transparent; color: rgba(255, 255, 255, .72); font-weight: 600; text-align: right; transition: background .15s, color .15s; }
.nav button svg { width: 20px; height: 20px; flex: none; }
.nav button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav button.active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset -3px 0 0 var(--orange); }
.nav .badge { margin-inline-start: auto; background: var(--orange); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .07); }
.me-card .who { min-width: 0; flex: 1; }
.me-card .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .who small { color: rgba(255, 255, 255, .6); font-size: 12px; }
.me-card .icon-btn { color: rgba(255, 255, 255, .7); }
.me-card .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.avatar { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, var(--orange), #ff9a4d); }
.avatar.blue { background: linear-gradient(135deg, var(--blue-500), var(--blue)); }
.avatar.lg { width: 52px; height: 52px; border-radius: 16px; font-size: 19px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 70px; padding: 0 30px; background: rgba(243, 247, 251, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 21px; margin: 0; font-weight: 800; }
.topbar .spacer { flex: 1; }
.content { padding: 26px 30px 40px; max-width: 1280px; width: 100%; }

.pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 700; background: #fff; border: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #9fb3c6; flex: none; }
.dot.green { background: var(--green); box-shadow: 0 0 0 4px rgba(22, 163, 74, .15); }
.dot.orange { background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 101, 0, .15); animation: blink 1.4s infinite; }
.dot.red { background: var(--red); }
.dot.amber { background: var(--amber); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* ---------------------------------------------------------------- cards & tables */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(225, 235, 244, .7); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.card-head .spacer { flex: 1; }
.grid { display: grid; gap: 18px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.stat .ico svg { width: 22px; height: 22px; }
.stat .ico.blue { background: var(--blue-soft); color: var(--blue); }
.stat .ico.orange { background: var(--orange-soft); color: var(--orange); }
.stat .ico.green { background: var(--green-soft); color: var(--green); }
.stat .ico.navy { background: #e7edf5; color: var(--navy-700); }
.stat b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13.5px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: right; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 12px 16px; background: #f8fbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid #eef3f8; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcfe; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: #b7c8d8; display: block; margin: 0 auto 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: var(--blue-soft); color: var(--blue); white-space: nowrap; }
.chip.orange { background: var(--orange-soft); color: var(--orange-600); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.gray { background: #eef2f6; color: var(--muted); }
.dir { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; }
.dir svg { width: 16px; height: 16px; }
.dir.in { background: var(--green-soft); color: var(--green); }
.dir.out { background: var(--blue-soft); color: var(--blue); }
.dir.miss { background: var(--red-soft); color: var(--red); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .input { width: auto; min-width: 170px; height: 40px; }
.toolbar .spacer { flex: 1; }
.quota { display: flex; align-items: center; gap: 14px; }
.quota .bar { flex: 1; height: 10px; background: #e8eff6; border-radius: 99px; overflow: hidden; min-width: 120px; }
.quota .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), #ff9a4d); border-radius: 99px; }

/* live agent tiles */
.agents-live { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.agent-tile { padding: 16px; display: grid; gap: 12px; position: relative; overflow: hidden; }
.agent-tile.busy::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--orange); }
.agent-tile.ready::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--green); }
.agent-tile .top { display: flex; align-items: center; gap: 12px; }
.agent-tile .top b { display: block; font-size: 15.5px; }
.agent-tile .top small { color: var(--muted); font-size: 12.5px; }
.agent-tile .state { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.agent-tile .meta { display: grid; gap: 2px; color: var(--muted); font-size: 12.5px; border-top: 1px dashed var(--line); padding-top: 10px; }
.agent-tile .meta .num { justify-self: start; }

/* ---------------------------------------------------------------- phone */
.phone-layout { display: grid; grid-template-columns: minmax(340px, 400px) 1fr; gap: 22px; align-items: start; }
.dialer { padding: 26px; display: grid; gap: 18px; }
.dial-display { position: relative; }
.dial-display input { width: 100%; height: 64px; border: 0; border-bottom: 2px solid var(--line); background: transparent; text-align: center; font-size: 32px; font-weight: 700; letter-spacing: 1px; direction: ltr; color: var(--text); }
.dial-display input:focus { outline: none; border-color: var(--orange); }
.dial-display input::placeholder { color: #b8c7d6; font-weight: 500; font-size: 20px; letter-spacing: 0; }
.dial-display .icon-btn { position: absolute; left: 0; top: 14px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; direction: ltr; }
.key { height: 64px; border-radius: 18px; border: 0; background: #f2f6fa; display: grid; place-content: center; gap: 0; transition: background .12s, transform .08s; }
.key:hover { background: #e7eef6; }
.key:active { transform: scale(.96); background: #dde8f2; }
.key b { font-size: 24px; font-weight: 600; line-height: 1; }
.key small { font-size: 10px; letter-spacing: 2px; color: var(--muted); font-weight: 600; margin-top: 3px; min-height: 12px; }
.call-btn { height: 60px; border-radius: 18px; border: 0; color: #fff; font-size: 17px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, #22c05f, var(--green)); box-shadow: 0 10px 24px rgba(22, 163, 74, .3); }
.call-btn svg { width: 24px; height: 24px; }
.call-btn:disabled { background: #b9c6d2; box-shadow: none; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--orange-soft); color: #9a3b00; font-size: 13.5px; font-weight: 500; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice.blue { background: var(--blue-soft); color: var(--navy-700); }

.in-call { padding: 30px 26px 26px; display: grid; gap: 22px; justify-items: center; text-align: center; color: #fff; border: 0;
  background: radial-gradient(circle at 50% 0, rgba(17, 112, 196, .5), transparent 60%), linear-gradient(180deg, var(--navy-700), var(--navy-900)); }
.ring-avatar { position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--orange), #ff9a4d); }
.ring-avatar svg { width: 40px; height: 40px; color: #fff; }
.ring-avatar.pulse::before, .ring-avatar.pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 154, 77, .7); animation: pulse 1.8s ease-out infinite; }
.ring-avatar.pulse::after { animation-delay: .9s; }
@keyframes pulse { from { transform: scale(1); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.in-call .peer { font-size: 28px; font-weight: 800; direction: ltr; }
.in-call .peer-name { color: rgba(255, 255, 255, .7); font-size: 14px; margin-top: -16px; }
.in-call .status { color: #ffb27d; font-weight: 700; font-size: 15px; }
.in-call .timer { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .9); }
.call-actions { display: grid; grid-template-columns: repeat(4, 66px); gap: 18px 14px; justify-content: center; }
.transfer-list { display: grid; gap: 8px; max-height: 280px; overflow: auto; }
.transfer-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; text-align: right; }
.transfer-opt:hover:not(:disabled) { border-color: var(--orange); background: var(--orange-soft); }
.transfer-opt:disabled { opacity: .5; cursor: not-allowed; }
.transfer-opt .who { flex: 1; min-width: 0; }
.transfer-opt .who b { display: block; }
.transfer-opt .who small { color: var(--muted); font-size: 12px; }
.transfer-opt .st { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.call-actions button { display: grid; justify-items: center; gap: 6px; background: none; border: 0; color: rgba(255, 255, 255, .85); font-size: 12.5px; font-weight: 600; }
.call-actions button i { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); transition: background .15s; }
.call-actions button i svg { width: 24px; height: 24px; }
.call-actions button:hover i { background: rgba(255, 255, 255, .2); }
.call-actions button.on i { background: #fff; color: var(--navy-800); }
.hangup { width: 72px; height: 72px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: var(--red); box-shadow: 0 10px 26px rgba(229, 56, 59, .45); }
.hangup svg { width: 30px; height: 30px; transform: rotate(135deg); }
.in-call .pad { width: 100%; }
.in-call .key { background: rgba(255, 255, 255, .1); color: #fff; }
.in-call .key small { color: rgba(255, 255, 255, .5); }
.in-call .key:hover { background: rgba(255, 255, 255, .18); }
.dtmf-line { font-size: 18px; letter-spacing: 3px; direction: ltr; min-height: 27px; color: rgba(255, 255, 255, .8); }

.recent-list { display: grid; }
.recent { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid #eef3f8; }
.recent:last-child { border-bottom: 0; }
.recent .info { flex: 1; min-width: 0; }
.recent .info b { display: block; font-size: 15px; }
.recent .info small { color: var(--muted); font-size: 12.5px; }
.recent .icon-btn { color: var(--green); }
.recent .icon-btn:hover { background: var(--green-soft); color: var(--green); }

/* incoming call */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(4, 33, 59, .55); backdrop-filter: blur(6px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.incoming { width: min(380px, 100%); border-radius: 28px; box-shadow: var(--shadow-lg); animation: rise .25s ease-out; }
@keyframes rise { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.incoming .kind { color: rgba(255, 255, 255, .7); font-weight: 600; letter-spacing: .5px; }
.incoming .btns { display: flex; gap: 46px; justify-content: center; margin-top: 6px; }
.incoming .btns button { display: grid; justify-items: center; gap: 8px; background: none; border: 0; color: rgba(255, 255, 255, .85); font-weight: 600; font-size: 13px; }
.incoming .btns i { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; }
.incoming .btns i svg { width: 28px; height: 28px; color: #fff; }
.incoming .answer i { background: var(--green); box-shadow: 0 10px 26px rgba(22, 163, 74, .45); animation: wiggle 1.2s infinite; }
.incoming .decline i { background: var(--red); }
.incoming .decline i svg { transform: rotate(135deg); }
@keyframes wiggle { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-12deg); } 80% { transform: rotate(12deg); } 90% { transform: rotate(-8deg); } }

/* clock */
.clock-card { padding: 28px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; color: #fff; border: 0;
  background: radial-gradient(circle at 0 100%, rgba(255, 101, 0, .35), transparent 45%), linear-gradient(135deg, var(--navy-800), var(--blue)); }
.clock-card .big { font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; direction: ltr; }
.clock-card .lbl { color: rgba(255, 255, 255, .7); margin-bottom: 6px; font-weight: 600; }
.clock-card .spacer { flex: 1; }
.clock-card .btn { height: 52px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn-white { background: #fff; color: var(--navy-800); }
.btn-white:hover { background: #f0f5fa; }
.clock-btn { height: 36px; border-radius: 99px; padding: 0 14px; font-size: 13.5px; }
.clock-btn.in { background: var(--green-soft); color: var(--green); }
.clock-btn.out { background: var(--orange); color: #fff; }

/* modal */
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 20px 24px 6px; }
.modal-head h3 { margin: 0; font-size: 19px; font-weight: 800; flex: 1; }
.modal-body { padding: 14px 24px 8px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-start; padding: 12px 24px 22px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.lines-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; padding: 2px; }
.line-opt { display: flex; flex-direction: column; gap: 8px; padding: 10px 11px; border: 1.5px solid var(--line); border-radius: 11px; font-size: 13.5px; background: var(--card); }
.line-opt.on { border-color: var(--orange); background: var(--orange-soft); }
.line-opt.taken { opacity: .5; }
.line-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.line-top .num { font-weight: 700; }
.line-top small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-flags { display: flex; gap: 5px; flex-wrap: wrap; }
.line-flags .lf { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.line-flags .lf input { margin: 0; width: 14px; height: 14px; accent-color: var(--orange); }
.line-flags .lf.yes { border-color: #b7e4c7; background: var(--green-soft); color: var(--green); }
.line-flags .lf.warn { border-color: #f7d48a; background: #fff6e0; color: #a86400; }
.line-flags .lf:disabled, .line-opt.taken .lf { cursor: not-allowed; }

.toast { position: fixed; bottom: 24px; left: 24px; z-index: 200; display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-radius: 14px; background: var(--navy-900); color: #fff; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; }
.toast.err { background: #b42318; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(7, 86, 154, .2); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { min-height: 100vh; display: grid; place-items: center; }

.settings-row { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-bottom: 1px solid #eef3f8; }
.settings-row:last-child { border-bottom: 0; }
.settings-row .txt { flex: 1; }
.settings-row .txt b { display: block; }
.settings-row .txt small { color: var(--muted); }

/* ---------------------------------------------------------------- contacts & recents (dialer) */
.cav { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; background-size: cover; background-position: center; }
.cav svg { width: 20px; height: 20px; }
.cav.photo { font-size: 0; }
.cav.photo svg { display: none; }
.cav.sm { width: 36px; height: 36px; font-size: 13px; }
.cav.lg { width: 56px; height: 56px; font-size: 19px; }
.cav.xl { width: 84px; height: 84px; font-size: 30px; }
.cav.add { background: var(--blue-soft) !important; color: var(--blue); }
.ring-avatar .cav.ring { width: 100%; height: 100%; font-size: 34px; }
.list-card { overflow: hidden; }
.day-h { display: flex; align-items: center; gap: 6px; padding: 14px 20px 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.day-h svg { width: 14px; height: 14px; color: var(--amber); }
.day-h.letter { color: var(--blue); font-size: 13px; }
.rc { display: flex; align-items: center; gap: 4px; padding: 0 10px 0 14px; }
.rc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 9px 8px; border: 0; background: none; text-align: right; border-radius: 14px; }
.rc-main:hover { background: #f4f8fc; }
.rc-txt, .ct-txt, .sugg-txt { min-width: 0; flex: 1; display: grid; }
.rc-txt b, .ct-txt b, .sugg-txt b { font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-txt b.num { justify-self: start; }
.rc-txt small, .ct-txt small, .sugg-txt small { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.sugg-txt small { justify-self: start; }
.rc.miss .rc-txt b { color: var(--red); }
.cnt { color: var(--muted); font-weight: 500; }
.dir-i { display: inline-grid; color: var(--blue); }
.dir-i svg { width: 14px; height: 14px; }
.dir-i.in { color: var(--green); }
.dir-i.miss { color: var(--red); }
.rc-call { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: transparent; color: var(--green); flex: none; }
.rc-call:hover { background: var(--green-soft); }
.rc-call svg { width: 21px; height: 21px; }
.favs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 14px; scrollbar-width: none; }
.fav { display: grid; justify-items: center; gap: 6px; width: 76px; flex: none; padding: 8px 2px; border: 0; background: none; border-radius: 16px; font-size: 12.5px; font-weight: 600; }
.fav:hover { background: #fff; }
.fav span:last-child { max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 12px; background: #e6eef6; border-radius: 99px; }
.seg button { border: 0; background: none; height: 32px; padding: 0 16px; border-radius: 99px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--navy-800); box-shadow: 0 1px 4px rgba(6, 47, 82, .12); }
.search-bar { position: sticky; top: 78px; z-index: 5; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 16px; margin-bottom: 12px; background: #fff; border-radius: 99px; box-shadow: var(--shadow); }
.search-bar > svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-bar input { flex: 1; min-width: 0; border: 0; background: none; height: 100%; font-size: 15.5px; }
.search-bar input:focus { outline: none; }
.search-bar .btn { border-radius: 99px; }
.ct { display: flex; align-items: center; gap: 14px; width: 100%; padding: 9px 20px; border: 0; background: none; text-align: right; }
.ct:hover { background: #f4f8fc; }
.ct-star { color: var(--amber); display: grid; }
.ct-star svg { width: 16px; height: 16px; }
.dial-sugg { display: grid; gap: 2px; margin: -8px 0 -4px; }
.dial-sugg:empty { display: none; }
.sugg { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border: 0; background: none; border-radius: 14px; text-align: right; }
.sugg:hover { background: #f4f8fc; }
.sugg i { color: var(--green); display: grid; }
.sugg i svg { width: 19px; height: 19px; }
.sugg.add b { color: var(--blue); font-weight: 700; }

/* details sheet (a bottom sheet on phones) */
.sheet .modal { width: min(460px, 100%); }
.sheet-head { position: relative; display: grid; justify-items: center; gap: 6px; padding: 30px 24px 10px; text-align: center; }
.sheet-head h3 { margin: 6px 0 0; font-size: 22px; font-weight: 800; }
.sheet-head h3.num { direction: ltr; }
.sheet-x { position: absolute; top: 12px; left: 12px; }
.sheet-body { padding: 6px 18px 22px; }
.pl { display: flex; align-items: center; gap: 6px; padding: 10px 6px; border-bottom: 1px solid #eef3f8; }
.pl-txt { flex: 1; min-width: 0; display: grid; }
.pl-txt b { font-size: 17px; justify-self: start; }
.pl-txt small { color: var(--muted); font-size: 12.5px; }
.pl-btn { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.pl-btn svg { width: 19px; height: 19px; }
.pl-btn.green { background: var(--green); color: #fff; }
.pl-btn.wa { background: #e7f8ee; color: #128c4b; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 6px; }
.sheet-actions button { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: 13.5px; }
.sheet-actions button svg { width: 17px; height: 17px; }
.sheet-actions button.on { color: #b45309; border-color: #fcd9a5; background: #fff8eb; }
.sheet-actions button.danger { color: var(--red); }
.sheet-note { margin: 12px 4px 0; padding: 10px 14px; border-radius: 12px; background: #f6f9fc; color: var(--text); font-size: 14px; white-space: pre-wrap; }
.sheet-sec { margin: 16px 4px 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.hl { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 13.5px; }
.hl .spacer { flex: 1; }
.save-to { display: grid; gap: 8px; margin-bottom: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.check:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.check input { margin-top: 4px; accent-color: var(--orange); }
.check b { display: block; font-size: 14px; }
.check small { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .phone-layout { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: auto 0 0 0; top: auto; height: auto; z-index: 50; flex-direction: row; padding: 6px; }
  .side-brand, .side-foot { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .nav button { flex-direction: column; gap: 3px; font-size: 11px; padding: 7px 2px; text-align: center; }
  .nav button.active { box-shadow: inset 0 3px 0 var(--orange); }
  .nav button { position: relative; }
  .nav .badge { position: absolute; top: 2px; left: calc(50% - 22px); margin: 0; font-size: 10px; padding: 0 5px; min-width: 17px; text-align: center; }
  .topbar { padding: 0 16px; min-height: 60px; }
  .content { padding: 14px 12px 100px; }
  .row2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  /* phone: the keypad page is just the dialer, like a mobile phone app */
  .side-recents { display: none; }
  .dialer { background: transparent; box-shadow: none; border: 0; padding: 4px 6px; gap: 14px; }
  .dial-display input { height: 58px; border-bottom: 0; font-size: 34px; }
  .key { height: 62px; background: transparent; border-radius: 50%; width: 74px; justify-self: center; }
  .key:active { background: #dde8f2; }
  .pad { gap: 8px 4px; }
  .call-btn { width: 68px; height: 68px; border-radius: 50%; justify-self: center; font-size: 0; gap: 0; }
  .call-btn svg { width: 28px; height: 28px; }
  .search-bar { top: 66px; }
  .rc { padding: 0 4px 0 6px; }
  .ct { padding: 9px 14px; }
  .sheet { align-items: end; padding: 0; }
  .sheet .modal { width: 100%; border-radius: 26px 26px 0 0; max-height: 88vh; animation: sheetUp .22s ease-out; }
  .sheet .modal::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 99px; background: #d5e0ea; margin: 10px auto 0; }
  .toast { left: 12px; right: 12px; bottom: 84px; justify-content: center; }
}
.line-tag { margin-bottom: -14px; padding: 3px 12px; border-radius: 99px; background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .85); font-size: 12.5px; font-weight: 600; }
.out-pick { display: flex; align-items: center; justify-content: center; gap: 6px; margin: -6px auto -8px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--blue-soft); color: var(--navy-700); font-size: 13px; font-weight: 600; width: fit-content; }
.out-pick svg { width: 15px; height: 15px; }
.out-pick select { border: 0; background: transparent; font-weight: 700; color: var(--navy-800); direction: ltr; cursor: pointer; }
.topbar h1 { white-space: nowrap; }
@keyframes sheetUp { from { transform: translateY(40%); opacity: .6; } }
.top-w { display: flex; gap: 10px; align-items: center; }
.lbl-short { display: none; }

/* call log: search, filter chips, today's numbers; do-not-disturb */
.rec-search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; margin-bottom: 10px; border-radius: 99px; background: #fff; border: 1.5px solid var(--line); }
.rec-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.rec-search input { flex: 1; min-width: 0; border: 0; background: none; height: 100%; }
.rec-search input:focus { outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 10px; border: 1.5px solid #d6e1ec; background: #fff; color: var(--text); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.chips button svg { width: 15px; height: 15px; }
.chips button.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.rec-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rec-stats div { display: grid; justify-items: center; padding: 10px 4px; border-radius: 14px; background: #fff; border: 1px solid #e6edf4; }
.rec-stats b { font-size: 19px; font-weight: 800; line-height: 1.2; }
.rec-stats span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.rec-stats .bad b { color: var(--red); }
.dnd-row { display: flex; align-items: center; gap: 12px; margin: 14px 2px 0; padding: 12px 14px; border-radius: 16px; background: #f3f6fa; cursor: pointer; }
.dnd-row .txt { flex: 1; display: grid; }
.dnd-row .txt small { color: var(--muted); font-size: 12.5px; }
.dnd-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #e3e9f2; color: var(--navy-700); }
.dnd-ico svg { width: 19px; height: 19px; }
.dnd-row.on { background: #fdecec; }
.dnd-row.on .dnd-ico { background: var(--red); color: #fff; }

/* voicemail */
.vm { border-bottom: 1px solid #eef3f8; padding-bottom: 10px; }
.vm:last-child { border-bottom: 0; }
.vm-top { display: flex; align-items: center; gap: 4px; padding: 0 10px 0 14px; }
.vm.new .rc-txt b { font-weight: 800; }
.vm-new { color: var(--orange-600); }
.vm-text { margin: 0 70px 8px 18px; padding: 9px 12px; border-radius: 12px; background: #f3f7fb; font-size: 13.5px; color: #33506b; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vm.open .vm-text { display: block; }
.vm-full { display: none; }
.vm.open .vm-full { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d6e1ec; color: var(--muted); }
.vm-player { display: flex; align-items: center; gap: 10px; margin: 0 70px 0 18px; }
.vm-play { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.vm-play svg { width: 22px; height: 22px; }
.vm-play svg:last-child, .vm.playing .vm-play svg:first-child { display: none; }
.vm.playing .vm-play svg:last-child { display: block; }
.vm.playing .vm-play { background: var(--blue); color: #fff; }
.vm-bar { flex: 1; height: 6px; border-radius: 99px; background: #e3ebf3; overflow: hidden; cursor: pointer; display: flex; }
.vm-bar i { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--orange); transition: width .2s linear; }
.vm-player .num { font-size: 12.5px; color: var(--muted); min-width: 36px; }
.vm-player .icon-btn { width: 34px; height: 34px; }
.vm-boxes { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.vm-boxes svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- phone app (Google-dialer style) */
.m-head, .fab, .call-row .back-btn, .call-row > span { display: none; }
.call-row { display: grid; }
@media (max-width: 860px) {
  :root { --nav-h: 76px; --top-h: 64px; --surface: #f7f9fc; }
  body { background: var(--surface); overscroll-behavior: none; }
  .key small { letter-spacing: .6px; }

  /* ---- top: search bar + my initials (agent); the title stays for the owner */
  .topbar { min-height: var(--top-h); padding: 0 12px; gap: 8px; background: var(--surface); border-bottom: 0; backdrop-filter: none; }
  .role-agent .topbar h1, .role-agent .topbar > .spacer, .role-agent #topWidgets { display: none; }
  .role-agent .m-head { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
  body:not(.role-agent) .m-head { display: flex; align-items: center; }
  #callBar:empty { display: none; }
  #callBar .pill { height: 40px; }
  .m-search { flex: 1; min-width: 0; height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 0; border-radius: 99px; background: #e9eff6; color: var(--muted); font-size: 15px; text-align: right; }
  .m-search svg { width: 20px; height: 20px; flex: none; color: var(--navy-700); }
  .m-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-me { position: relative; width: 42px; height: 42px; flex: none; margin: 0 4px; border-radius: 50%; border: 0; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff;
    background: linear-gradient(135deg, var(--orange), #ff9a4d); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px #9fb3c6; }
  .m-me.owner { background: linear-gradient(135deg, var(--navy-700), var(--blue)); }
  .m-me.st-green { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--green); }
  .m-me.st-amber { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--amber); }
  .m-me.st-red { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--red); }
  .m-me.st-dnd { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--red); }
  .m-dnd { position: absolute; bottom: -5px; left: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--red); border: 2.5px solid var(--surface); display: grid; place-items: center; color: #fff; }
  .m-dnd svg { width: 11px; height: 11px; }
  .rec-search { background: #e9eff6; border: 0; height: 46px; }
  .m-shift { position: absolute; bottom: -4px; left: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--green); border: 3px solid var(--surface); }
  .shift-box { display: flex; align-items: center; gap: 14px; margin: 16px 2px 4px; padding: 16px; border-radius: 18px; background: #eef3f8; }
  .shift-box > div { flex: 1; display: grid; }
  .shift-box small { color: var(--muted); font-weight: 600; }
  .shift-box b { font-size: 26px; font-weight: 800; justify-self: start; }
  .shift-box.on { background: linear-gradient(135deg, var(--navy-800), var(--blue)); color: #fff; }
  .shift-box.on small { color: rgba(255, 255, 255, .7); }

  /* ---- bottom bar: light, a tinted pill behind the active icon */
  .sidebar { padding: 8px 4px calc(10px + env(safe-area-inset-bottom)); background: #fff; color: var(--text); box-shadow: 0 -1px 0 #e3eaf2; }
  .role-agent .nav [data-page="phone"] { display: none; }
  .nav button, .nav button:hover, .nav button.active { background: none; box-shadow: none; }
  .nav button { padding: 0; gap: 4px; font-size: 12px; font-weight: 600; color: #4a6178; }
  .nav button svg { width: 64px; height: 32px; padding: 6px 22px; border-radius: 99px; transition: background .2s; }
  .nav button.active { color: var(--navy-900); font-weight: 800; }
  .nav button.active svg { background: #ffe1cc; color: #c24e00; }
  .nav .badge { top: -2px; left: calc(50% - 28px); }

  /* ---- keypad button, like Google's (bottom corner, above the bar) */
  .role-agent .fab { display: grid; place-items: center; position: fixed; z-index: 40; left: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border: 0; border-radius: 20px;
    background: linear-gradient(180deg, #ff7a1f, var(--orange)); color: #fff; box-shadow: 0 8px 22px rgba(255, 101, 0, .38); }
  .fab svg { width: 26px; height: 26px; }
  body[data-page="phone"] .fab, body[data-page="settings"] .fab, body[data-page="attendance"] .fab { display: none; }

  /* ---- pages */
  .content { padding: 4px 12px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
  .list-card { background: transparent; box-shadow: none; border: 0; border-radius: 0; margin: 0 -12px; }
  .rc { padding: 0 6px 0 10px; }
  .rc-main { padding: 10px 6px; gap: 16px; }
  .rc-main:active, .ct:active { background: #e9eff6; }
  .cav { width: 44px; height: 44px; }
  .day-h { padding: 16px 18px 4px; }
  .ct { padding: 10px 18px; gap: 16px; }
  .favs { padding: 4px 0 10px; }
  .fav { width: 80px; }
  .seg { background: #e9eff6; }
  .search-bar { top: var(--top-h); box-shadow: none; background: #e9eff6; height: 48px; }
  .contacts-page .search-bar .btn span { display: none; }
  /* the contacts page's own search takes the place of the top search bar */
  body[data-page="contacts"] .m-search { visibility: hidden; }
  .contacts-page .search-bar { position: fixed; z-index: 25; top: 8px; right: 12px; left: 72px; margin: 0; padding: 0 6px 0 14px; }
  .contacts-page .search-bar .btn { width: 38px; height: 38px; padding: 0; }
  .ct .chip { display: none; }

  /* ---- keypad page: number on top, keypad + call at the bottom, nothing scrolls */
  body[data-page="phone"] .content { padding: 0; }
  body[data-page="phone"] .phone-layout { display: block; }
  body[data-page="phone"] #phoneCard { height: calc(100dvh - var(--top-h) - var(--nav-h) - env(safe-area-inset-bottom)); }
  .dialer, body[data-page="phone"] .dialer { height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 6px 24px 14px; background: transparent; box-shadow: none; border: 0; }
  .dialer .notice { font-size: 12.5px; padding: 9px 12px; }
  .dial-display { padding-top: 8px; }
  .dial-display .icon-btn { display: none; }
  .dial-display input { height: 60px; border: 0; font-size: 34px; font-weight: 500; letter-spacing: 1px; caret-color: var(--orange); }
  .dial-display input::placeholder { font-size: 17px; font-weight: 400; letter-spacing: 0; color: #9fb0c2; }
  .dial-sugg { margin: 0 -10px; max-height: 172px; overflow: auto; }
  .dialer .pad { margin-top: auto; gap: 6px 0; }
  .key { width: 80px; height: 62px; border-radius: 31px; background: transparent; justify-self: center; }
  .key:hover { background: transparent; }
  .key:active { background: #e3ebf3; transform: none; }
  .key b { font-size: 30px; font-weight: 400; color: var(--navy-900); }
  .key small { font-size: 9.5px; margin-top: 1px; color: #6b8197; font-weight: 600; }
  .call-row { grid-template-columns: 1fr 1fr 1fr; align-items: center; direction: ltr; margin-top: 6px; }
  .call-row > span { display: block; }
  .call-row .call-btn { justify-self: center; }
  .call-row .back-btn { display: grid; justify-self: center; width: 56px; height: 56px; border-radius: 50%; color: #4a6178; }
  .call-row .back-btn svg { width: 26px; height: 26px; }
  .call-btn { width: 68px; height: 68px; border-radius: 50%; font-size: 0; gap: 0; flex: none; }
  .call-btn svg { width: 28px; height: 28px; }
  .out-pick { margin: 0 auto; }

  /* ---- a call fills the screen */
  body[data-page="phone"] .in-call { height: 100%; border-radius: 0; align-content: space-evenly; padding: 20px 18px; }
  .in-call .call-actions { grid-template-columns: repeat(3, 72px); gap: 20px 26px; }
  #incoming { padding: 0; }
  #incoming .incoming { width: 100%; height: 100%; border-radius: 0; align-content: space-evenly; }
  #incoming .incoming .btns { gap: 90px; }
  .line-tag { margin-bottom: 0; }

  /* ---- nothing may be wider than the screen */
  html, body { overflow-x: hidden; }
  .shell, .main, .content { max-width: 100vw; min-width: 0; }
  .card-head h3 { white-space: nowrap; }
  .card-head { padding: 14px 16px; flex-wrap: wrap; }
  td, th { padding: 10px 8px; }
  td { font-size: 14px; }
  /* attendance */
  .clock-card { padding: 20px; gap: 14px; }
  .clock-card .big { font-size: 40px; }
  .clock-card .btn { width: 100%; }
  .grid.stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; }
  .stats .stat { flex-direction: column; text-align: center; padding: 12px 6px; gap: 6px; }
  .stats .stat .ico { width: 36px; height: 36px; border-radius: 11px; }
  .stats .stat .ico svg { width: 18px; height: 18px; }
  .stats .stat b { font-size: 20px; }
  .stats .stat span { font-size: 12px; }
  .settings-row { padding: 14px 16px; flex-wrap: wrap; }
  .settings-row select.input { max-width: 100% !important; }
}

/* ---------------------------------------------------------------- every screen size */
/* tablets (and big phones held sideways) in the phone layout: keep the dialer and lists at a
   comfortable width in the middle instead of stretching across the screen */
@media (min-width: 600px) and (max-width: 860px) {
  .content > * { max-width: 680px; margin-inline: auto; }
  body[data-page="phone"] .dialer { max-width: 440px; margin: 0 auto; }
  .m-head { max-width: 680px; margin-inline: auto; }
  .role-agent .fab { left: max(18px, calc(50% - 340px + 18px)); }
  .sheet .modal { max-width: 560px; border-radius: 26px; margin-bottom: 20px; }
  .sheet { align-items: end; justify-items: center; }
  .rec-stats b { font-size: 22px; }
  .key { width: 100px; height: 82px; border-radius: 41px; }
  .key b { font-size: 38px; }
  .key small { font-size: 11px; }
  .call-btn, .call-row .call-btn { width: 76px; height: 76px; }
  .dial-display input { font-size: 40px; height: 72px; }
}
.out-pick span, .out-pick select { white-space: nowrap; }
/* small phones (narrow, or short screens): a tighter keypad so everything still fits */
@media (max-width: 860px) and (max-height: 700px) {
  .key { height: 54px; }
  .key b { font-size: 26px; }
  .dial-display input { height: 50px; font-size: 30px; }
  .call-btn, .call-row .call-btn { width: 60px; height: 60px; }
  .dial-sugg { max-height: 120px; }
}
@media (max-width: 860px) and (max-height: 600px) {
  .key { height: 46px; }
  .key small { display: none; }
  .dialer .pad { gap: 2px 0; }
  .favs { display: none; }
}
@media (max-width: 360px) {
  .key { width: 68px; }
  .m-search { padding: 0 12px; font-size: 14px; gap: 8px; }
  .rec-stats { gap: 6px; }
  .rec-stats b { font-size: 16px; }
  .rec-stats span { font-size: 10.5px; }
  .nav button { font-size: 11px; }
  .nav button svg { width: 56px; padding: 6px 18px; }
}
/* a phone held sideways: keypad and number side by side */
@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
  .sidebar { padding-block: 4px; }
  .nav button span { display: none; }
  body[data-page="phone"] #phoneCard { height: calc(100dvh - var(--top-h) - 46px); }
  body[data-page="phone"] .dialer { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto; column-gap: 24px; }
  body[data-page="phone"] .dialer > :not(.pad) { grid-column: 1; }
  body[data-page="phone"] .dialer .pad { grid-column: 2; grid-row: 1 / span 4; margin: 0; align-self: center; }
  .key { height: 40px; }
  .key small { display: none; }
}


/* ---------------------------------------------------------------- guided tour */
#tour { position: fixed; inset: 0; z-index: 300; }
#tour.center { background: rgba(4, 33, 59, .62); display: grid; place-items: center; padding: 20px; }
.tour-hole { position: fixed; box-shadow: 0 0 0 9999px rgba(4, 33, 59, .62); border: 2.5px solid #ffb27d; transition: all .25s ease; pointer-events: none; }
.tour-tip { position: fixed; width: min(340px, calc(100vw - 24px)); padding: 18px 18px 14px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); transition: top .25s ease, left .25s ease; animation: rise .2s ease-out; }
#tour.center .tour-tip { position: relative; width: min(380px, 100%); text-align: center; }
.tour-tip h4 { margin: 2px 0 6px; font-size: 18px; font-weight: 800; }
.tour-tip p { margin: 0 0 14px; color: #33506b; font-size: 14.5px; line-height: 1.55; }
.tour-count { font-size: 12px; font-weight: 700; color: var(--orange-600); }
.tour-btns { display: flex; align-items: center; gap: 8px; }
#tour.center .tour-btns { justify-content: center; }
.tour-skip { margin-inline-start: auto; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px; }
#tour.center .tour-skip { margin-inline-start: 8px; }

/* ---------------------------------------------------------------- WhatsApp chat */
.chat-wrap { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 70px - 52px); min-height: 460px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-side { display: flex; flex-direction: column; border-inline-end: 1px solid var(--line); min-height: 0; }
.chat-side-head { display: flex; gap: 8px; align-items: center; padding: 12px; }
.chat-side-head .rec-search { flex: 1; margin: 0; }
.chat-side-head .btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.chat-list { flex: 1; overflow-y: auto; }
.cl { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: right; border-bottom: 1px solid #f0f4f8; }
.cl:hover, .cl.on { background: #f2f6fa; }
.cl-txt { flex: 1; min-width: 0; display: grid; }
.cl-txt b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-txt small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-side { display: grid; justify-items: end; gap: 4px; }
.cl-side small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.cl-un { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--green); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #efeae2 radial-gradient(rgba(6, 47, 82, .05) 1px, transparent 1px) 0 0 / 18px 18px; }
.chat-pick { margin: auto; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.chat-title { flex: 1; min-width: 0; display: grid; }
.chat-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title small { color: var(--muted); font-size: 12.5px; justify-self: start; }
.chat-back { display: none; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 6% 10px; display: flex; flex-direction: column; gap: 4px; }
.day-sep { text-align: center; margin: 10px 0 6px; }
.day-sep span { background: #fff; color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.bub { position: relative; max-width: min(78%, 560px); padding: 6px 10px 4px; padding-inline-end: 26px; border-radius: 10px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); align-self: flex-start; transition: background .3s; }
.bub.me { align-self: flex-end; background: #d9fdd3; }
.bub.flash { background: #fff3c4; }
.bub-t { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.45; }
.bub-t a { color: var(--blue); }
.bub-meta { font-size: 11px; color: #667781; text-align: left; margin-top: 2px; white-space: nowrap; }
.tk { color: #8696a0; letter-spacing: -3px; margin-inline-start: 3px; }
.tk.read { color: #53bdeb; }
.bub-fwd { font-size: 12px; color: #667781; font-style: italic; margin-bottom: 2px; }
.bub-kind { font-size: 13.5px; color: #3b4a54; margin-bottom: 2px; }
.bub-q { display: grid; gap: 1px; margin-bottom: 4px; padding: 5px 9px; border-radius: 7px; background: rgba(6, 47, 82, .06); border-inline-start: 4px solid var(--orange); cursor: pointer; }
.bub-q b { font-size: 12.5px; color: var(--orange-600); }
.bub-q span { font-size: 13px; color: #54656f; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bub-menu { position: absolute; top: 2px; inset-inline-end: 2px; width: 24px; height: 22px; border: 0; border-radius: 6px; background: inherit; color: #8696a0; font-size: 14px; opacity: 0; transition: opacity .15s; }
.bub:hover .bub-menu, .bub-menu:focus { opacity: 1; }
@media (pointer: coarse) { .bub-menu { opacity: .7; } }
.bub-pop { position: fixed; z-index: 250; min-width: 150px; padding: 6px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-lg); display: grid; animation: rise .15s ease-out; }
.bub-pop button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font-weight: 600; text-align: right; }
.bub-pop button:hover { background: #f2f6fa; }
.bub-pop svg { width: 18px; height: 18px; color: var(--muted); }
.reply-bar { display: flex; align-items: center; gap: 8px; margin: 0 10px; padding: 8px 10px; background: #fff; border-radius: 12px 12px 0 0; border-inline-start: 4px solid var(--orange); }
.reply-bar > div { flex: 1; min-width: 0; display: grid; }
.reply-bar b { font-size: 12.5px; color: var(--orange-600); }
.reply-bar span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px 10px; }
.chat-compose textarea { flex: 1; resize: none; border: 0; border-radius: 22px; padding: 11px 16px; font-size: 15px; line-height: 1.4; background: #fff; max-height: 140px; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.chat-compose textarea:focus { outline: none; }
.chat-send { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--green); color: #fff; }
.chat-send svg { width: 20px; height: 20px; transform: scaleX(-1); }
.chat-send:disabled { opacity: .6; }
.fwd-list { display: grid; max-height: 50vh; overflow-y: auto; margin-top: 8px; }
@media (max-width: 860px) {
  body[data-page="chat"] .content { padding: 0; }
  .chat-wrap { grid-template-columns: 1fr; height: calc(100dvh - var(--top-h) - var(--nav-h) - env(safe-area-inset-bottom)); border-radius: 0; box-shadow: none; min-height: 0; }
  .chat-wrap .chat-main { display: none; }
  .chat-wrap.has-open .chat-side { display: none; }
  .chat-wrap.has-open .chat-main { display: flex; }
  .chat-back { display: inline-grid; }
  .chat-msgs { padding: 10px 10px 6px; }
  .bub { max-width: 86%; }
  body[data-page="chat"] .fab { display: none; }
}

/* iPhone (WebKit): a button of the fixed bottom bar sometimes isn't painted after a page change -
   its own compositing layer keeps it drawn */

/* phone: the keypad during a call - light digits on the dark call screen, and it all fits above the bar */
@media (max-width: 860px) {
  .in-call .key, .in-call .key:hover { background: rgba(255, 255, 255, .1); }
  .in-call .key:active { background: rgba(255, 255, 255, .26); }
  .in-call .key b { color: #fff; }
  .in-call .key small { color: rgba(255, 255, 255, .55); }
  body[data-page="phone"] .in-call { overflow-y: auto; }
  body[data-page="phone"] .in-call.pad-open { gap: 10px; align-content: space-between; padding-block: 14px 18px; }
  .in-call.pad-open .ring-avatar, .in-call.pad-open .chip { display: none; }
  .in-call.pad-open .pad { gap: 10px 0; }
  .in-call.pad-open .key { width: 76px; height: 60px; border-radius: 30px; }
  .in-call.pad-open .hangup { width: 64px; height: 64px; }
}
/* round icons: flex centring (iOS gives buttons its own padding and grid centring drifts there) */
.cav, .pl-btn { display: flex; align-items: center; justify-content: center; padding: 0; }
.cav svg, .pl-btn svg { display: block; flex: none; }
.cav.xl svg { width: 38px; height: 38px; }
.cav.lg svg { width: 26px; height: 26px; }

/* microphone level (call screen + settings test) */
.mic-meter { display: flex; align-items: center; gap: 8px; width: min(220px, 70%); margin-top: -8px; }
.mic-meter span { display: grid; color: rgba(255, 255, 255, .75); }
.mic-meter span svg { width: 16px; height: 16px; }
.mic-meter i { display: block; height: 6px; width: 0; border-radius: 99px; background: linear-gradient(90deg, #22c05f, #8be28f); transition: width .15s linear; }
.mic-meter::after { content: ''; }
.mic-meter { position: relative; }
.mic-meter i { position: relative; z-index: 1; }
.mic-meter.light span { color: var(--muted); }
.mic-meter.light { background: #eef3f8; border-radius: 99px; padding: 4px 8px; width: 220px; margin-top: 0; }

/* ---------------------------------------------------------------- press feedback and state changes */
.rpl { position: absolute; z-index: 0; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); pointer-events: none; animation: rpl .55s ease-out forwards; }
@keyframes rpl { to { transform: scale(1); opacity: 0; } }
.call-actions button i { position: relative; transition: background .25s, color .25s, box-shadow .25s, transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.call-actions button i svg { position: relative; z-index: 1; }
.call-actions button { transition: color .2s, opacity .2s; }
.call-actions button:active:not(:disabled) i { transform: scale(.86); }
.call-actions button.on { color: #fff; font-weight: 800; }
.call-actions button.on i { background: #fff; color: var(--navy-800); box-shadow: 0 0 0 5px rgba(255, 255, 255, .16), 0 8px 20px rgba(0, 0, 0, .28); }
.call-actions button[data-act="mute"].on i { background: #ffd9d9; color: #b42318; }
.call-actions button.just i { animation: pop .42s cubic-bezier(.3, 1.6, .5, 1); }
.call-actions button:disabled { opacity: .45; }
@keyframes pop { 0% { transform: scale(.78); } 55% { transform: scale(1.14); } 100% { transform: scale(1); } }
.hangup, .call-btn, .fab, .chat-send, .incoming .btns i { transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s, filter .2s; }
.hangup:active, .call-btn:active:not(:disabled), .fab:active, .chat-send:active, .incoming .btns button:active i { transform: scale(.9); filter: brightness(.95); }
.key { transition: background .15s, transform .12s cubic-bezier(.3, 1.6, .5, 1); }
.key:active { transform: scale(.9); }
.key b, .key small { position: relative; z-index: 1; }
.btn { transition: transform .12s, background .15s, box-shadow .15s, filter .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.nav button svg { transition: background .25s, color .25s, transform .15s; }
.nav button:active svg { transform: scale(.9); }
.chips button, .seg button { transition: background .2s, color .2s, border-color .2s, transform .12s; }
.chips button:active, .seg button:active { transform: scale(.95); }
.rc-main, .ct, .cl, .sugg { transition: background .2s; }
@media (prefers-reduced-motion: reduce) {
  .rpl, .call-actions button.just i { animation: none; }
  .call-actions button i, .key, .btn, .hangup, .call-btn, .fab { transition: none; }
}
/* styled dropdown (recording retention in settings) */
.dd-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fbfdff; color: var(--text); font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap; transition: border-color .15s, box-shadow .15s, background .15s; }
.dd-btn > svg:first-child { width: 17px; height: 17px; color: var(--blue-500); }
.dd-btn .dd-chev { width: 16px; height: 16px; color: var(--muted); margin-inline-start: 2px; transition: transform .18s; }
.dd-btn:hover { border-color: #c6d8ea; background: #fff; }
.dd-btn:focus-visible, .dd-btn.open { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(17, 112, 196, .12); background: #fff; }
.dd-btn.open .dd-chev { transform: rotate(180deg); }
.dd-pop { position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 36px rgba(4, 33, 59, .18); padding: 6px; display: flex; flex-direction: column; gap: 2px; animation: dd-in .14s ease-out; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dd-pop button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 10px; font: inherit; font-size: 14.5px; color: var(--text); text-align: start; cursor: pointer; }
.dd-pop button:hover:not([disabled]), .dd-pop button:focus-visible { outline: none; background: var(--blue-soft); }
.dd-pop button.on { color: var(--blue); font-weight: 700; }
.dd-pop button[disabled] { cursor: not-allowed; color: #9aaec2; }
.dd-mark { width: 18px; height: 18px; flex-shrink: 0; color: var(--blue-500); }
.dd-mark svg { width: 18px; height: 18px; display: block; }
.dd-l { flex: 1; }
.dd-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--orange-600); background: var(--orange-soft); padding: 2px 8px; border-radius: 999px; }
.dd-tag svg { width: 12px; height: 12px; }
/* every <select> keeps its look - only the list that opens is styled (dd.js) */
select.dd-open { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(17, 112, 196, .12); }
.dd-pop { overflow-y: auto; overscroll-behavior: contain; }
.dd-pop .dd-group { padding: 8px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
