:root {
  --sidebar: #0f1b2d;
  --sidebar-hover: #1a2a42;
  --sidebar-active: #22385a;
  --sidebar-text: #a9b6c9;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --border: #e3e8ef;
  --text: #16202f;
  --muted: #6b7789;
  --blue: #2563eb;
  --blue-soft: #e8f0fe;
  --green: #16a34a;
  --green-soft: #e7f6ec;
  --amber: #d97706;
  --amber-soft: #fdf3e2;
  --red: #dc2626;
  --red-soft: #fdecec;
  --purple: #7c3aed;
  --purple-soft: #f1ebfe;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 14px 10px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.brand-mark { width: 24px; height: 34px; object-fit: contain; flex-shrink: 0; margin: 0 4px 0 3px; }
.brand-mark-lg { width: 30px; height: 42px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--sidebar-text); letter-spacing: .4px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #6b7a90; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--sidebar-text); font-weight: 500; }
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 #3b82f6; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid #1e2d45; margin-top: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #334766; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; position: relative; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--sidebar); }
.me-name { color: #fff; font-weight: 600; font-size: 13px; }
.me-role { font-size: 11px; }
.me button { margin-left: auto; background: none; border: 0; color: var(--sidebar-text); cursor: pointer; padding: 4px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { height: 60px; background: var(--panel); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 20px; flex: none; }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 650; }
.topbar .spacer { flex: 1; }
.search { position: relative; }
.search input { width: 260px; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--muted); }
.search-results { position: absolute; top: 40px; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 30; max-height: 360px; overflow: auto; }
.search-results div { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.search-results div:hover { background: var(--bg); }

.phone-pill { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; }
.status-select { position: relative; }
.status-btn { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 600; }
.status-menu { position: absolute; right: 0; top: 42px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 40; min-width: 170px; padding: 6px; }
.status-menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; }
.status-menu button:hover { background: var(--bg); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.s-available { background: var(--green); } .s-busy { background: var(--red); } .s-ringing { background: var(--purple); }
.s-wrap { background: var(--amber); } .s-away { background: #94a3b8; } .s-offline { background: #cbd5e1; }

.view { flex: 1; overflow: auto; padding: 20px; }
.view.flush { padding: 0; overflow: hidden; }

/* ---------- generic ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 650; }
.card-b { padding: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #15803d; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn svg { width: 16px; height: 16px; }
.input, select.input, textarea.input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.input:focus { outline: 2px solid #bfd3fb; border-color: var(--blue); }
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 10px; align-items: center; }
.grid { display: grid; gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); margin: 0 4px 4px 0; color: #44516a; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.chip.green { background: var(--green-soft); color: var(--green); } .chip.red { background: var(--red-soft); color: var(--red); }
.chip.amber { background: var(--amber-soft); color: var(--amber); } .chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.purple { background: var(--purple-soft); color: var(--purple); } .chip.gray { background: #eef1f5; color: #55627a; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fafbfd; position: sticky; top: 0; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:hover td { background: #fafbfd; }
.tbl td svg { width: 16px; height: 16px; vertical-align: middle; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty svg { width: 40px; height: 40px; color: #c3cbd8; margin-bottom: 8px; }

/* ---------- inbox ---------- */
.split { display: grid; grid-template-columns: 380px 1fr; height: 100%; }
.list-pane { border-right: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 7px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.tabs .n { font-size: 11px; background: var(--bg); border-radius: 999px; padding: 1px 6px; margin-left: 4px; }
.scope { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.scope button { flex: 1; padding: 6px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: #fff; border-radius: 7px; cursor: pointer; color: var(--muted); }
.scope button.active { background: var(--blue-soft); border-color: #bfd3fb; color: var(--blue); }
.items { overflow: auto; flex: 1; }
.item { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.item:hover { background: #fafbfd; }
.item.active { background: var(--blue-soft); }
.item .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.item .ic svg { width: 17px; height: 17px; }
.ic.text { background: var(--blue-soft); color: var(--blue); } .ic.missed_call { background: var(--red-soft); color: var(--red); }
.ic.voicemail { background: var(--purple-soft); color: var(--purple); } .ic.follow_up { background: var(--amber-soft); color: var(--amber); }
.ic.task { background: var(--green-soft); color: var(--green); }
.item-main { min-width: 0; flex: 1; }
.item-top { display: flex; justify-content: space-between; gap: 8px; }
.item-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.item-time.overdue { color: var(--red); font-weight: 600; }
.item-title { font-size: 12.5px; color: #44516a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-body { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.detail { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.detail-h { background: var(--panel); border-bottom: 1px solid var(--border); padding: 14px 18px; display: flex; align-items: center; gap: 14px; }
.detail-h .avatar { width: 42px; height: 42px; background: var(--blue-soft); color: var(--blue); font-size: 15px; }
.detail-h h2 { font-size: 17px; margin: 0; }
.actionbar { background: #fff; border-bottom: 1px solid var(--border); padding: 9px 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actionbar .item-banner { font-size: 12.5px; color: #44516a; margin-right: auto; }
.timeline { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 70%; padding: 9px 13px; border-radius: 14px; box-shadow: var(--shadow); white-space: pre-wrap; word-wrap: break-word; }
.bubble.in { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.out { background: var(--blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble .meta { font-size: 10.5px; opacity: .7; margin-top: 3px; }
.event { align-self: center; font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; display: flex; align-items: center; gap: 8px; }
.event svg { width: 14px; height: 14px; }
.event audio { height: 26px; }
.composer { background: #fff; border-top: 1px solid var(--border); padding: 12px 18px; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; }
.side-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.side-facts b { color: var(--text); font-weight: 600; }

/* ---------- kpis ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 16px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.3px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; height: 100%; }
.bars .b .stack { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; }
.bars .b span { font-size: 10px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.hbar .name { width: 150px; flex: none; }
.hbar .track { flex: 1; background: var(--bg); border-radius: 4px; height: 10px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--blue); }

/* ---------- live ---------- */
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.agent { padding: 14px; display: flex; gap: 12px; align-items: center; }
.agent .avatar .dot { border-color: #fff; }

/* ---------- dialer ---------- */
.lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.power-banner { background: linear-gradient(90deg, #0f1b2d, #1e3a6b); color: #fff; border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { padding: 12px; font-size: 18px; font-weight: 600; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; }
.keypad button:hover { background: var(--bg); }

/* ---------- softphone dock ---------- */
.dock { position: fixed; right: 22px; bottom: 22px; width: 320px; background: var(--sidebar); color: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; }
.dock-h { padding: 14px 16px 10px; }
.dock-status { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #8fb0e3; display: flex; align-items: center; gap: 7px; }
.dock-name { font-size: 18px; font-weight: 700; margin-top: 4px; }
.dock-sub { color: var(--sidebar-text); font-size: 12.5px; }
.dock-timer { font-variant-numeric: tabular-nums; font-size: 13px; color: #cbd8ec; }
.dock-actions { display: flex; gap: 8px; padding: 10px 16px 16px; }
.round { width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: #22385a; color: #fff; }
.round:hover { background: #2c4772; }
.round.on { background: #fff; color: var(--sidebar); }
.round.red { background: var(--red); margin-left: auto; }
.round svg { width: 20px; height: 20px; }
.dock .keypad { padding: 0 16px 14px; }
.dock .keypad button { background: #1a2a42; color: #fff; border-color: #22385a; padding: 8px; font-size: 16px; }
.disclosure-tip { margin: 0 16px 12px; font-size: 12px; background: #22385a; border-radius: 8px; padding: 8px 10px; color: #dbe6f7; }

/* ---------- modals ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 27, 45, .55); display: grid; place-items: center; z-index: 60; }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 440px; max-width: calc(100vw - 32px); max-height: calc(100vh - 40px); overflow: auto; }
.modal-h { padding: 18px 20px 6px; font-size: 17px; font-weight: 700; }
.modal-b { padding: 8px 20px 18px; }
.modal-f { padding: 12px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; }
.incoming { text-align: center; padding: 28px 24px 24px; }
.incoming .ring { width: 74px; height: 74px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 14px; animation: pulse 1.4s infinite; box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); }
.incoming .ring svg { width: 32px; height: 32px; }
.incoming h3 { margin: 0; font-size: 22px; }
.incoming .btns { display: flex; gap: 12px; margin-top: 22px; }
.incoming .btns .btn { flex: 1; padding: 13px; font-size: 15px; border-radius: 12px; }
.dispos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.dispos button { padding: 10px; border: 1px solid var(--border); background: #fff; border-radius: 9px; cursor: pointer; font-weight: 600; text-align: left; }
.dispos button.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--sidebar); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 520px; }
.toast.err { background: var(--red); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--sidebar); }
.login-card { width: 380px; background: #fff; border-radius: 16px; padding: 30px; box-shadow: var(--shadow-lg); }

@media (max-width: 900px) {
  .app { grid-template-columns: 64px 1fr; }
  .brand span, .nav a span, .nav-section, .me > div, .nav .badge { display: none; }
  .split { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .search input { width: 150px; }
}

/* ---------- transfers ---------- */
.parties { margin: 0 16px 12px; background: #1a2a42; border-radius: 10px; padding: 10px; }
.party { display: flex; align-items: center; gap: 10px; padding: 6px 2px; font-size: 13px; }
.party-x { background: none; border: 1px solid #3a5480; color: #dbe6f7; border-radius: 6px; font-size: 12px; padding: 3px 8px; cursor: pointer; }
.party-x:hover { background: var(--red); border-color: var(--red); color: #fff; }
.round:disabled { cursor: not-allowed; }
.xfer-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; }
.xfer-rep { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; font-weight: 600; }
.xfer-rep:disabled { opacity: .45; cursor: not-allowed; }
.xfer-rep.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.xfer-help { background: var(--bg); border-radius: 8px; padding: 10px 12px; line-height: 1.55; }

/* ---------- inbox cap ---------- */
.capbar { display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px; font-size: 12px; color: #44516a; background: var(--blue-soft); border-bottom: 1px solid var(--border); }
.item.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { 0% { background: #fff7d6; box-shadow: inset 3px 0 0 var(--amber); } 100% { background: transparent; box-shadow: inset 3px 0 0 transparent; } }

/* ---------- GHL ---------- */
.ghl-badge { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .5px; padding: 1px 5px; border-radius: 4px; background: #eef1f5; color: #55627a; vertical-align: 1px; }
.bubble.out.ghl { background: #4b5d7a; }
.bubble.out .ghl-badge { background: rgba(255,255,255,.2); color: #fff; }
.ghl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; }
.ghl-grid .chip { margin-top: 4px; }
code { font-size: 11.5px; background: var(--bg); padding: 1px 5px; border-radius: 4px; word-break: break-all; }

/* ---------- setup ---------- */
.setup-steps { display: flex; flex-direction: column; gap: 16px; max-width: 1100px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; cursor: pointer; transition: .15s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; 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(18px); }
.switch input:disabled + span { opacity: .5; }

/* ---------- calling rules ---------- */
.rule { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: #fcfdff; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 18px; margin-top: 12px; }
.rule-grid .row { margin: 3px 0; }

/* ---------- coaching ---------- */
.coach-modes { display: flex; gap: 6px; padding: 0 16px 10px; }
.coach-modes button { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid #2c4772; background: #1a2a42; color: #dbe6f7; font-weight: 600; cursor: pointer; }
.coach-modes button.on { background: #fff; color: var(--sidebar); border-color: #fff; }
.ic.appointment { background: var(--blue-soft, #e6effc); color: var(--blue, #2463eb); }

/* tab row: fit six tabs */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs { gap: 0; padding-left: 6px; padding-right: 6px; }
.tabs button { padding-left: 6px; padding-right: 6px; font-size: 13.5px; flex-shrink: 0; }
.tabs .n { margin-left: 3px; padding: 1px 5px; }

/* state calling rules table */
.state-rules td, .state-rules th { padding: 5px 6px; }
.state-rules .input { padding: 5px 7px; min-width: 0; width: 72px; }

/* callbacks, alerts, templates */
.ic.callback { background: #fdecec; color: var(--red, #dc2626); }
.quick-times { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-times button { border: 1px solid var(--border, #e5e7eb); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer; }
.quick-times button.on { background: var(--blue, #2463eb); color: #fff; border-color: var(--blue, #2463eb); }
.toast.alert { background: #1e3a8a; cursor: pointer; font-weight: 600; }
.composer .tpl { width: auto; max-width: 130px; flex: 0 0 auto; padding: 6px 8px; font-size: 13px; }
.tpl-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 6px; align-items: start; margin-bottom: 6px; }

/* scheduled calls on the contact card */
.sched { background: #fff; border-bottom: 1px solid var(--border); padding: 10px 18px; }
.sched-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.sched-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.sched-row + .sched-row { border-top: 1px dashed var(--border); }
.sched-main { flex: 1; min-width: 0; font-size: 13.5px; }
.sched-row .ic svg { width: 15px; height: 15px; }
#schedBtn svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- calendar ---------- */
.cal { display: flex; flex-direction: column; gap: 12px; }
.cal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.cal-nav span { min-width: 190px; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--blue-soft, #e6effc); color: var(--blue, #2463eb); }
.cal-legend { margin-left: auto; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.cal-legend i.appointment { background: #64748b; } .cal-legend i.callback { background: #f1f5f9; border: 1.5px dashed #64748b; border-left-width: 3px; border-left-style: solid; }
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.swatches button.on { box-shadow: 0 0 0 2px var(--text, #111); }
.swatches input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid #d0d5dd; border-radius: 6px; background: none; cursor: pointer; }
.cal-grid { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cal-head { display: grid; grid-template-columns: 64px repeat(var(--days), 1fr); border-bottom: 1px solid var(--border); }
.cal-tz { font-size: 10.5px; color: var(--muted); padding: 8px 4px; text-align: center; line-height: 1.2; }
.cal-day-h { padding: 10px; text-align: center; color: var(--muted); border-left: 1px solid var(--border); font-size: 13.5px; }
.cal-day-h b { font-size: 18px; color: var(--text); margin-left: 4px; }
.cal-day-h.today, .cal-day-h.today b { color: var(--blue, #2463eb); }
.cal-body { display: grid; grid-template-columns: 64px repeat(var(--days), 1fr); max-height: calc(100vh - 230px); overflow-y: auto; position: relative; }
.cal-hours div { font-size: 11.5px; color: var(--muted); text-align: right; padding: 0 8px; transform: translateY(-7px); }
.cal-col { position: relative; border-left: 1px solid var(--border); }
.cal-col.today { background: #fafcff; }
.cal-slot { border-top: 1px solid #eef1f5; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #e0464e; z-index: 3; }
.cal-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #e0464e; }
.cal-ev { position: absolute; border-radius: 6px; padding: 3px 6px; color: #fff; font-size: 11.5px; line-height: 1.3; overflow: hidden; cursor: pointer; z-index: 2; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cal-ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev span { display: block; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* each event takes its rep's color (--c); appointments are solid, callbacks are a light tint with a solid edge */
.cal-ev.appointment { background: var(--c, #1d9bf0); border-left: 4px solid color-mix(in srgb, var(--c, #1d9bf0) 70%, #000); }
.cal-ev.callback { background: color-mix(in srgb, var(--c, #1d9bf0) 18%, #fff); color: color-mix(in srgb, var(--c, #1d9bf0) 60%, #000); border: 1.5px dashed var(--c, #1d9bf0); border-left: 4px solid var(--c, #1d9bf0); }
.cal-ev.callback.late { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e0464e; }
.cal-ev.done { background: #c9ced6; border-left-color: #9aa1ad; color: #3b4252; }
.cal-ev:hover { filter: brightness(1.05); }
