:root {
  font-family: Manrope, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #15171a;
  background: #f6f7f9;
  font-synthesis: none;
  --brand: #5b5cf0;
  --brand-hover: #494ae0;
  --brand-pressed: #3f40c8;
  --brand-soft: #eeedff;
  --brand-border: #c9c8ff;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --muted: #68707d;
  --line: #e3e6ea;
  --input-border: #d7dbe1;
  --text-tertiary: #9299a5;
  --success-soft: #eaf9ef;
  --warning-soft: #fff6dd;
  --danger-soft: #feecec;
  --panel: #fff;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: #f6f7f9; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button, input, textarea, select { min-height: 42px; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  min-height: 82px;
  padding: max(10px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 10px max(22px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 270px; }
.brand img { width: 50px; height: 50px; object-fit: cover; border-radius: 14px; box-shadow: 0 8px 22px #5b5cf025; }
.brand strong { display: block; letter-spacing: 1.4px; font-size: 16px; line-height: 1.2; }
.brand span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.online { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.dot, .status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.tabs { display: flex; gap: 2px; margin-left: auto; padding: 4px; border-radius: 12px; background: #eceef2; }
.tab { border: 0; background: transparent; color: #4f5661; border-radius: 10px; padding: 10px 20px; font-weight: 500; white-space: nowrap; }
.tab.active { background: var(--brand); color: #fff; box-shadow: 0 5px 14px #5b5cf033; }
.user-menu { display: flex; align-items: center; gap: 10px; margin-left: 4px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #ece9ff; color: var(--brand); font-weight: 500; }
.avatar-photo { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: #ece9ff; }
.avatar.small,.avatar-photo.small { width: 34px; height: 34px; }
.avatar.large,.avatar-photo.large { width: 56px; height: 56px; font-size: 20px; }
.avatar.xlarge,.avatar-photo.xlarge { width: 76px; height: 76px; font-size: 26px; }
.profile-button { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 5px 8px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.profile-button:hover { background: #f3f4f7; }
.user-copy { display: grid; min-width: 80px; font-size: 13px; }
.user-copy small { color: var(--muted); font-size: 11px; }

.ghost, .secondary, .primary, .danger, .call {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 10px 15px;
  background: #fff;
  color: #15171a;
  font-weight: 500;
}
.ghost { padding: 8px 11px; color: var(--muted); }
.presence-control { display:flex; align-items:center; gap:7px; min-height:44px; padding:0 10px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.presence-control select { min-height:32px; border:0; padding:0 18px 0 0; background:transparent; font:inherit; color:var(--text); }
.presence-control .dot { background:#22c55e; }
.presence-control .presence-dnd { background:#f59e0b; }
.presence-control .presence-passive { background:#94a3b8; }
.presence-control .presence-offline { background:#cbd5e1; }
.status-badge.dnd { background:#fff4d6; color:#9a6700; }
.status-badge.passive { background:#eef2f7; color:#64748b; }
.status-badge.offline { background:#f1f3f5; color:#7b8491; }
.campaign-toggle { display:inline-flex; align-items:center; gap:8px; min-height:36px; padding:0 10px; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--muted); cursor:pointer; user-select:none; }
.campaign-toggle input { position:absolute; opacity:0; pointer-events:none; }
.campaign-toggle .toggle-track { position:relative; width:30px; height:18px; border-radius:999px; background:#cbd5e1; transition:.16s ease; }
.campaign-toggle .toggle-track i { position:absolute; top:3px; left:3px; width:12px; height:12px; border-radius:50%; background:#fff; box-shadow:0 1px 3px #64748b66; transition:.16s ease; }
.campaign-toggle input:checked + .toggle-track { background:#22c55e; }
.campaign-toggle input:checked + .toggle-track i { transform:translateX(12px); }
.campaign-toggle input:checked ~ b { color:#16803d; }
.call-drawer { position:fixed; top:16px; right:16px; bottom:16px; z-index:60; width:min(360px,calc(100vw - 32px)); padding:20px; overflow:auto; border:1px solid var(--line); border-radius:18px; background:#fff; box-shadow:0 24px 70px rgba(21,23,26,.22); animation:drawer-in .18s ease-out; }
.call-drawer .dialer { display:flex; flex-direction:column; gap:18px; min-height:100%; }
.call-drawer .dialer-head { display:grid; grid-template-columns:auto 1fr auto; gap:12px; align-items:center; }
.call-drawer .dialer-head .dialer-duration { grid-column:1 / -1; display:flex; justify-content:space-between; padding:12px; border-radius:10px; background:var(--brand-soft); }
.call-drawer .dialer-number { width:100%; font-size:20px; text-align:center; }
.call-drawer .dialpad { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.call-drawer .dialpad button { min-height:54px; font-size:20px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.call-drawer .dialpad button:hover { border-color:var(--brand-border); background:var(--brand-soft); color:var(--brand); }
.call-drawer .dialer-call { width:100%; min-height:50px; }
@keyframes drawer-in { from { transform:translateX(24px); opacity:0; } to { transform:translateX(0); opacity:1; } }
.crm-view-switch { display:flex; gap:8px; align-items:center; }
.crm-view-switch>button:not(.secondary) { min-height:40px; padding:8px 14px; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--muted); }
.crm-view-switch>button.active { border-color:var(--brand); background:var(--brand-soft); color:var(--brand); }
.crm-kanban { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(270px,320px); grid-template-columns:none; gap:14px; overflow-x:auto; overflow-y:hidden; padding:2px 4px 14px; scroll-snap-type:x proximity; }
.crm-column{scroll-snap-align:start}
.crm-column { min-height:360px; padding:12px; border:1px solid var(--line); border-radius:14px; background:#f6f7f9; }
.crm-column:nth-child(4n+1){border-top:3px solid #5b5ce2;background:linear-gradient(180deg,#f0efff 0,#f8f8fb 120px)}
.crm-column:nth-child(4n+2){border-top:3px solid #19b7a5;background:linear-gradient(180deg,#eafbf8 0,#f8f8fb 120px)}
.crm-column:nth-child(4n+3){border-top:3px solid #f4a340;background:linear-gradient(180deg,#fff6e8 0,#f8f8fb 120px)}
.crm-column:nth-child(4n+4){border-top:3px solid #e66a8d;background:linear-gradient(180deg,#fff0f4 0,#f8f8fb 120px)}
.crm-column header { display:flex; justify-content:space-between; align-items:center; padding:6px 4px 12px; }
.crm-column header span { min-width:24px; padding:3px 7px; border-radius:999px; background:#fff; color:var(--muted); text-align:center; }
.crm-lead-card { display:flex; flex-direction:column; gap:8px; margin-bottom:10px; padding:14px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 3px 10px rgba(21,23,26,.05); }
.crm-lead-card:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(38,41,74,.12);border-color:#bfc1ff}
.crm-lead-card{cursor:pointer;transition:.18s ease}
.crm-lead-card.is-dragging,.crm-list-row.is-dragging{opacity:.45}
.crm-column.is-over{outline:2px dashed #5b5ce2;outline-offset:2px;background:#eeedff}
.crm-card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:12px}
.crm-status-pill,.crm-task-badge{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:999px;background:#f0efff;color:#5656d8;font-size:12px;font-weight:700}
.crm-note{margin:0;padding:8px 10px;border-left:3px solid #c8c8ff;background:#f7f7ff;border-radius:6px;color:#555b70;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-task-badge{background:#eefaf4;color:#198754}
.crm-detail{min-width:min(680px,80vw)}
.crm-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0;padding:14px;border-radius:12px;background:#f6f7fb}
.crm-detail-grid>div{display:flex;flex-direction:column;gap:5px}.crm-detail-body{display:grid;gap:16px}.crm-detail-body section{padding-top:14px;border-top:1px solid var(--line)}
.crm-detail-body h3{margin:0 0 10px}.crm-last-call,.crm-task-list>div,.crm-activity-list>div{padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff}.crm-last-call span,.crm-task-list span,.crm-activity-list span{display:block;color:var(--muted);font-size:12px;margin-top:4px}.crm-last-call p,.crm-activity-list p{margin:7px 0 0}.crm-task-list,.crm-activity-list{display:grid;gap:8px}
.crm-list-row{cursor:pointer}.crm-list-row:hover{background:#f7f7ff}
.campaign-status-editor textarea{min-height:130px;line-height:1.55}
.crm-lead-head { display:flex; flex-direction:column; gap:3px; }
.crm-lead-head span,.crm-lead-card>small,.crm-card-foot small { color:var(--muted); font-size:12px; }
.crm-phone { color:var(--brand); font-weight:600; text-decoration:none; }
.crm-phone:hover { text-decoration:underline; }
.crm-card-foot { display:flex; justify-content:space-between; gap:8px; padding-top:8px; border-top:1px solid var(--line); font-size:12px; }
.crm-list { overflow:auto; }
.crm-list-row { display:grid; grid-template-columns:1.2fr 1fr 1fr 1fr; gap:14px; align-items:center; padding:14px 16px; border-bottom:1px solid var(--line); }
.crm-list-head { background:#f6f7f9; color:var(--muted); font-size:13px; }
@media(max-width:1000px){.crm-kanban{grid-auto-columns:minmax(250px,82vw);}.crm-list-row{min-width:720px;}}
.status-dot.is-off { background:#cbd5e1; }
.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.primary:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.primary:active { border-color: var(--brand-pressed); background: var(--brand-pressed); }
.danger { color: #fff; border-color: var(--red); background: var(--red); }
.call { min-width: 142px; color: #fff; border-color: var(--green); background: var(--green); }
.call:disabled, .primary:disabled { opacity: .38; cursor: not-allowed; }
.content { width: 100%; flex: 1; padding: 24px max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }

.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: radial-gradient(circle at 15% 10%,#e8e9ff,transparent 35%),radial-gradient(circle at 85% 85%,#e8f9ff,transparent 35%),#f6f7f9; }
.login-card { width: min(430px,100%); background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px,6vw,36px); box-shadow: 0 30px 80px #32355a1a; }
.login-logo { width: 116px; height: 116px; display: block; margin: 0 auto 16px; object-fit: cover; border-radius: 25px; }
.login h1 { text-align: center; margin: 0; font-size: 28px; }
.login p { text-align: center; color: var(--muted); margin: 7px 0 26px; }
.field { display: grid; gap: 7px; margin-bottom: 15px; min-width: 0; }
.field label, .label { font-size: 12px; font-weight: 500; color: var(--muted); }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid #dfe2e7; border-radius: 10px; background: #fff; padding: 11px 12px; color: #17191c; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #9394fa; box-shadow: 0 0 0 3px #5b5cf018; }
textarea { resize: vertical; min-height: 110px; }
.login .primary { width: 100%; padding: 13px; margin-top: 8px; }
.error { color: var(--red); font-size: 13px; margin-top: 12px; overflow-wrap: anywhere; }

.lead-layout { width: min(1540px,100%); margin: 0 auto; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; align-items: start; }
.card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px #20243c0a; }
.card-pad { padding: clamp(18px,2.1vw,28px); }
.callbar { grid-column: 1/-1; min-height: 112px; display: flex; align-items: center; gap: 14px; padding: 18px 22px; }
.callstate { display: flex; align-items: center; gap: 12px; flex: 1 1 310px; min-width: 240px; }
.call-icon { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: #e7f8eb; color: var(--green); font-size: 20px; }
.callstate strong { display: block; font-size: 17px; }
.callstate small { display: block; max-width: 420px; margin-top: 4px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.sip-switch { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.switch { position: relative; width: 46px; height: 26px; min-height: 26px; border-radius: 20px; background: #cbd0d8; border: 0; padding: 0; }
.switch:after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; left: 3px; top: 3px; background: #fff; transition: .2s; box-shadow: 0 1px 5px #0003; }
.switch.on { background: var(--green); }
.switch.on:after { left: 23px; }
.icon-button { width: 44px; flex: 0 0 44px; border: 1px solid var(--line); background: #f4f5f7; border-radius: 10px; }
.dial-field { flex: 1 1 300px; min-width: 220px; }
.dial-field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.call-number { font-size: 16px; }
.callbar .danger { min-width: 142px; }

.lead-card, .workflow-card { min-height: 720px; }
.lead-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.lead-meta { flex-wrap: wrap; min-width: 0; }
.lead-meta > span:last-child { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-chip { display: inline-flex; align-items: center; max-width: 100%; min-height: 28px; padding: 5px 10px; overflow: hidden; text-overflow: ellipsis; border-radius: 999px; background: #eaf2ff; color: var(--brand); font-size: 12px; font-weight: 500; white-space: nowrap; }
.lead-head { display: grid; grid-template-columns: minmax(0,1fr) 160px; gap: 14px; align-items: center; margin-top: 10px; }
.lead-head input { min-height: 52px; padding-left: 0; border-color: transparent; background: transparent; font-size: clamp(24px,3vw,36px); font-weight: 500; }
.lead-head input:hover { border-color: var(--line); background: #fff; padding-left: 12px; }
.lead-head select { background-color: #f5f6f8; }
.lead-subtitle { margin: 0 0 22px; color: var(--muted); }
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; font-size: 17px; font-weight: 500; }
.card-config-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.lead-data-section { position: relative; padding-top: 1px; }
.section-config-title > span { flex: 1; }
.section-config-title small { color: var(--orange); font-size: 11px; }
.gear-button,.field-gear { width: 36px; min-height: 36px; border: 0; border-radius: 9px; background: #f1f2f5; color: var(--muted); }
.field-gear { width: 30px; min-height: 30px; margin: 2px 0 0 auto; padding: 0; flex: 0 0 30px; }
.field-label-row { display: flex; align-items: flex-start; min-width: 0; min-height: 34px; gap: 8px; }
.field-label-row label { min-width: 0; padding-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-label-row + input,.field-label-row + select,.field-label-row + textarea,.field-label-row + .inline-field { margin-top: 2px; }
.config-hidden { opacity: .58; outline: 1px dashed #c8ccd4; outline-offset: 3px; border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.wide { grid-column: 1/-1; }
.inline-field { display: flex; gap: 8px; min-width: 0; }
.inline-field input { overflow: hidden; text-overflow: ellipsis; }
.description-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.description-head .muted { font-size: 11px; }
.description { min-height: 180px; line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.next-actions { padding-top: 4px; }

.workflow-tabs { display: flex; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.workflow-tabs::-webkit-scrollbar { display: none; }
.workflow-tab { flex: 0 0 auto; border: 0; background: transparent; padding: 10px 14px; color: var(--muted); font-weight: 500; border-radius: 10px; }
.workflow-tab.active { background: var(--brand); color: #fff; }
.workflow { padding: clamp(18px,2.1vw,28px); }
.workflow-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.workflow-heading h2 { margin: 0; font-size: 22px; }
.workflow-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.scenario-editor { min-height: 320px; line-height: 1.55; }
.script-steps p { white-space: pre-wrap; overflow-wrap: anywhere; }
.workflow-heading p { margin: 4px 0 0; }
.script-steps { display: grid; gap: 0; }
.script-steps article { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 14px; padding: 19px 0; border-bottom: 1px solid var(--line); }
.script-steps article > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #f0f1f4; color: var(--muted); }
.script-steps b { font-size: 15px; font-weight: 500; }
.script-steps p { margin: 6px 0 0; line-height: 1.55; overflow-wrap: anywhere; }
.result-title { justify-content: space-between; }
.result-title small { color: var(--muted); font-weight: 400; }
.results { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 13px 0 18px; }
.result { display: flex; align-items: center; gap: 9px; min-width: 0; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px; text-align: left; overflow-wrap: anywhere; }
.result.selected { border-color: var(--brand); background: #f2f2ff; color: var(--brand); }
.radio { width: 17px; height: 17px; flex: 0 0 auto; border: 2px solid currentColor; border-radius: 50%; }
.result.selected .radio { box-shadow: inset 0 0 0 3px #f2f2ff; background: var(--brand); }
.save-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.workflow-empty { min-height: 410px; display: grid; place-content: center; justify-items: center; text-align: center; }
.workflow-empty b { font-size: 22px; }
.workflow-empty p { max-width: 440px; }

.waiting { min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); display: grid; place-items: center; padding: 30px 16px; text-align: center; }
.waiting img { width: 180px; border-radius: 38px; }
.spinner { width: 32px; height: 32px; border: 3px solid #dedff4; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 22px auto; }
.waiting h2 { font-size: 27px; margin: 0; }
.waiting p { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.page { width: min(1500px,100%); margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.metric { padding: 20px; }
.metric b { font-size: 31px; display: block; margin-top: 8px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.panel-grid { display: grid; grid-template-columns: 360px minmax(0,1fr); gap: 18px; }
.list-item { padding: 15px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:hover { background: #fafaff; }
.list-item.active { background: #f0f0ff; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)); background: #17192566; }
.modal { width: min(600px,100%); max-height: min(86vh,86dvh); overflow: auto; background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 35px 100px #0003; }
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
#toast { position: fixed; right: max(22px,env(safe-area-inset-right)); bottom: max(22px,env(safe-area-inset-bottom)); max-width: min(420px,calc(100vw - 44px)); z-index: 100; padding: 12px 16px; border-radius: 10px; background: #15171a; color: #fff; opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; overflow-wrap: anywhere; }
#toast.show { opacity: 1; transform: none; }
.quick-phone { position: fixed; right: max(24px,env(safe-area-inset-right)); bottom: max(24px,env(safe-area-inset-bottom)); z-index: 35; width: 62px; height: 62px; min-height: 62px; border: 0; border-radius: 50%; background: linear-gradient(145deg,#38d66a,#16b84b); color: #fff; font-size: 25px; box-shadow: 0 16px 36px #22c55e55; transition: transform .18s,box-shadow .18s; }
.quick-phone:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 20px 42px #22c55e66; }
.dialer { max-width: 390px; margin: 0 auto; }
.dialer-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.dialer-head h2,.dialer-head p { margin: 0; }
.dialer-head > div:not(.dialer-duration) { min-width: 0; flex: 1; }
.dialer-duration { margin-left: auto; padding: 9px 12px; border: 1px solid var(--brand-border); border-radius: 10px; background: var(--brand-soft); color: var(--brand); text-align: right; }
.dialer-duration span { display: block; color: var(--muted); font-size: 11px; line-height: 15px; }
.dialer-duration strong { display: block; font-size: 20px; line-height: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dialer-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: #e6f9ec; color: var(--green); font-size: 24px; }
.dialer-number { min-height: 62px; text-align: center; font-size: 25px; font-weight: 500; letter-spacing: .6px; }
.dialpad { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 18px 0; }
.dialpad button { min-height: 58px; border: 1px solid var(--line); border-radius: 15px; background: #f6f7f9; font-size: 21px; font-weight: 500; }
.dialpad button:hover { border-color: #bfc3cc; background: #fff; }
.dialer-call { width: 100%; min-height: 56px; }

.campaign-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 18px; min-height: 680px; }
.campaign-sidebar { overflow: hidden; align-self: start; }
.campaign-item { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 16px; display: flex; align-items: center; justify-content: space-between; text-align: left; }
.campaign-item:hover { background: #fafaff; }
.campaign-item.active { background: #f0f0ff; color: var(--brand); }
.campaign-item span { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.campaign-item small { color: var(--muted); }
.campaign-main { overflow: hidden; }
.campaign-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.campaign-header h2 { margin: 0; overflow-wrap: anywhere; }
.campaign-header p { margin: 6px 0 0; color: var(--muted); }
.status-dot { display: inline-block; margin-right: 7px; }
.campaign-tabs { display: flex; gap: 4px; padding: 10px 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.campaign-tabs button { flex: 0 0 auto; border: 0; background: transparent; padding: 10px 13px; border-radius: 9px; font-weight: 500; color: var(--muted); }
.campaign-tabs button.active { background: #eeefff; color: var(--brand); }
.campaign-content { padding: 22px; min-height: 540px; }
.campaign-content > form { max-width: 920px; }
.campaign-content .field { margin-bottom: 18px; }
.empty-panel { min-height: 600px; display: grid; place-content: center; text-align: center; }
.overview > h2 { margin-top: 0; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.summary-grid div { padding: 15px; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.summary-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.summary-grid span { color: var(--muted); }
.info-card { padding: 15px; border-radius: 12px; background: #eaf8ef; color: #16783a; font-weight: 500; }
.report-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; align-items: end; gap: 12px; margin-bottom: 18px; padding: 16px; }
.report-filters .field { margin: 0; }
.report-scope-note { margin-bottom: 18px; padding: 13px 16px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.report-operators { margin-top: 18px; }
.operator-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.operator-stats button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-align: left; }
.operator-stats button:hover { border-color: var(--brand); background: var(--brand-soft); }
.operator-stats span { display: grid; gap: 3px; }
.operator-stats small { color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.check input { width: auto; }
.schedule-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.schedule-grid { display: grid; grid-template-columns: 42px repeat(24,24px); gap: 4px; align-items: center; overflow: auto; padding: 15px 0; }
.schedule-grid small { text-align: center; font-size: 9px; color: var(--muted); }
.schedule-grid > b { font-size: 11px; }
.slot { width: 24px; height: 28px; min-height: 28px; border: 0; border-radius: 5px; background: #e5e7eb; padding: 0; }
.slot.active { background: var(--brand); }
.contact-actions { margin-top: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; }
.campaign-content .metrics .card { box-shadow: none; }
.employee-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fafbfc; }
.employee-option { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.employee-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.employee-option input { width: 18px; min-height: 18px; }
.employee-option span { display: grid; min-width: 0; }
.employee-option b,.employee-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.employee-option small { color: var(--muted); }
.schema-head,.schema-section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.schema-head h2 { margin: 0; }
.schema-head p { margin: 4px 0 0; }
.schema-sections { display: grid; gap: 12px; margin-top: 20px; }
.schema-sections article { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fafbfc; }
.schema-sections article.dragging { opacity: .45; border-color: var(--brand); }
.schema-section-title { justify-content: flex-start; }
.schema-section-title > div { display: grid; flex: 1; }
.schema-section-title .schema-order { display: flex; flex: 0 0 auto; grid-auto-flow: column; gap: 5px; }
.schema-order .gear-button:disabled { opacity: .35; cursor: not-allowed; }
.schema-section-title small { margin-top: 3px; color: var(--muted); }
.drag-handle { color: #aeb4bd; letter-spacing: -4px; cursor: grab; user-select: none; }
.schema-field-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0 28px; }
.schema-field-chips span,.role-badge,.status-badge { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px; background: #eceeff; color: var(--brand); font-size: 11px; font-style: normal; }
.schema-field-chips .disabled-chip { background: #eef0f2; color: var(--muted); text-decoration: line-through; }
.section-fields-editor { margin-top: 18px; }
.section-fields-editor .section-title { justify-content: space-between; }
.schema-field-row { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; }
.schema-field-row span { display: grid; }
.schema-field-row small { color: var(--muted); }
.field-order-actions { display: flex; gap: 8px; margin-top: 8px; }
.user-metrics { margin-bottom: 18px; }
.user-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.user-card { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 13px; min-height: 150px; padding: 18px; border: 1px solid var(--line); text-align: left; }
.user-card-copy { display: grid; align-content: start; gap: 4px; min-width: 0; }
.user-card-copy b,.user-card-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-copy small { color: var(--muted); }
.status-badge { position: absolute; left: 18px; bottom: 17px; background: #e9f9ee; color: #16833c; }
.status-badge.inactive { background: #f0f1f3; color: var(--muted); }
.edit-user { position: absolute; right: 18px; bottom: 19px; color: var(--brand); font-size: 12px; }
.profile-editor-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.profile-editor-head h2,.profile-editor-head p { margin: 0; }

@media (max-width: 1260px) {
  .topbar { gap: 12px; }
  .brand { min-width: 225px; }
  .online span { display: none; }
  .tab { padding-inline: 13px; }
  .user-copy { display: none; }
  .callbar { flex-wrap: wrap; }
  .callstate { flex-basis: calc(100% - 180px); }
  .dial-field { flex: 1 1 420px; }
}
@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .tab { flex: 1 0 auto; }
  .user-menu { margin-left: auto; }
  .lead-layout { grid-template-columns: 1fr; }
  .callbar { grid-column: auto; }
  .lead-card, .workflow-card { min-height: 0; }
  .campaign-layout, .panel-grid { grid-template-columns: 1fr; min-height: 0; }
  .campaign-sidebar { display: flex; overflow-x: auto; }
  .campaign-item { min-width: 240px; border-right: 1px solid var(--line); }
  .campaign-header { align-items: flex-start; }
  .campaign-header .actions { flex-wrap: wrap; }
  .user-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .topbar { position: relative; padding: max(10px,env(safe-area-inset-top)) 14px 10px; }
  .brand { min-width: 0; flex: 1; }
  .brand img { width: 44px; height: 44px; }
  .brand strong { font-size: 14px; }
  .brand span { display: none; }
  .online { display: none; }
  .user-menu { gap: 6px; }
  .user-menu .ghost { font-size: 0; width: 42px; padding: 0; }
  .user-menu .ghost:after { content: "↪"; font-size: 18px; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 7px max(8px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); border: 1px solid var(--line); border-radius: 0; background: rgba(255,255,255,.97); backdrop-filter: blur(18px); }
  .tab { min-width: 76px; min-height: 46px; padding: 8px 10px; font-size: 12px; }
  .content { padding: 14px 12px calc(78px + env(safe-area-inset-bottom)); }
  .quick-phone { right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 56px; height: 56px; min-height: 56px; }
  .dialer-head { flex-wrap: wrap; }
  .dialer-duration { width: 100%; margin-left: 0; text-align: center; }
  .callbar { gap: 10px; padding: 16px; }
  .callstate { flex-basis: calc(100% - 100px); min-width: 0; }
  .callstate small { font-size: 11px; }
  .sip-switch { margin-left: auto; }
  .dial-field { order: 6; flex-basis: 100%; }
  .callbar .call, .callbar .danger { order: 7; width: 100%; }
  .callbar #mute-button { order: 5; width: 100%; }
  .lead-head { grid-template-columns: 1fr; gap: 6px; }
  .lead-head input { font-size: 28px; }
  .lead-head select { width: 100%; }
  .form-grid, .metrics, .summary-grid, .results { grid-template-columns: 1fr; }
  .employee-picker,.user-grid { grid-template-columns: 1fr; }
  .report-filters,.operator-stats { grid-template-columns: 1fr; }
  .report-filters > button { width: 100%; }
  .wide { grid-column: auto; }
  .inline-field { flex-direction: column; }
  .inline-field .secondary { width: 100%; }
  .description-head { align-items: flex-end; }
  .workflow { padding: 18px; }
  .workflow-heading { align-items: flex-start; }
  .save-row .primary { width: 100%; }
  .page-head, .campaign-header, .schedule-head { align-items: stretch; flex-direction: column; }
  .page-head > .primary, .campaign-header .actions > * { width: 100%; text-align: center; }
  .campaign-content { padding: 16px; }
  .summary-grid div:nth-child(odd) { border-right: 0; }
  .card-pad { overflow-x: auto; }
  .table { min-width: 640px; }
  .modal { padding: 20px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
  input, textarea, select { font-size: 16px; }
}
@media (max-width: 380px) {
  .brand strong { letter-spacing: .6px; font-size: 12px; }
  .avatar { width: 34px; height: 34px; }
  .lead-meta { align-items: flex-start; flex-direction: column; }
  .workflow-tabs { padding-inline: 10px; }
  .workflow-tab { padding-inline: 11px; }
  .script-steps article { grid-template-columns: 30px minmax(0,1fr); gap: 10px; }
  .script-steps article > span { width: 30px; height: 30px; }
}
@media (orientation: landscape) and (max-height: 560px) and (max-width: 980px) {
  .topbar { position: relative; }
  .content { padding-top: 12px; }
  .callbar { min-height: 0; }
  .waiting { min-height: 420px; }
  .waiting img { width: 110px; }
}
@media (pointer: coarse) {
  button, input, select { min-height: 44px; }
  .result { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Campaign workspace — Bulatkin Leads design system */
.lucide{display:inline-block;flex:0 0 auto;vertical-align:-3px}.primary,.secondary,.danger,.danger-outline,.icon-action{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px}.campaigns-page{width:min(1440px,100%);margin:0 auto}.campaign-page-head{margin-bottom:24px}.campaign-page-head h1{margin-bottom:4px;font-size:28px;line-height:36px;font-weight:500}.campaign-layout{grid-template-columns:266px minmax(0,1fr);gap:22px;min-height:680px}.campaign-sidebar{display:grid;align-content:start;gap:12px;overflow:visible}.campaign-item{min-height:112px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--panel);box-shadow:0 4px 16px rgba(21,23,26,.03)}.campaign-item:hover{border-color:var(--brand-border);background:#f0f1f4}.campaign-item.active{border-color:var(--brand);background:var(--brand-soft);color:#15171a;box-shadow:0 4px 16px rgba(91,92,240,.08)}.campaign-item span{align-self:stretch;justify-content:space-between}.campaign-item b{font-size:16px;line-height:24px;font-weight:500}.campaign-item small{padding-top:12px;border-top:1px solid var(--line);font-size:12px;line-height:16px}.campaign-state{width:10px;height:10px;align-self:start;border-radius:50%;background:var(--orange)}.campaign-state.active{background:var(--green)}.campaign-main{overflow:visible}.campaign-header{min-height:104px;padding:18px 20px;border:0;border-radius:16px;background:#f0f1f4}.campaign-header h2{font-size:24px;line-height:32px;font-weight:500}.campaign-header p{display:flex;align-items:center;font-size:13px;line-height:18px}.campaign-header .actions{display:flex;align-items:center;gap:10px}.icon-action{width:44px;padding:0;border:1px solid var(--line);border-radius:10px;background:#fff;color:#15171a}.icon-action:hover{background:#f0f1f4}.campaign-tabs{gap:6px;margin:10px 0 0;padding:0 0 12px;border-bottom:1px solid var(--line)}.campaign-tabs button{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:10px 12px}.campaign-tabs button:hover{background:#f0f1f4;color:#15171a}.campaign-tabs button.active{background:var(--brand-soft);color:var(--brand)}.campaign-content{min-height:540px;padding:20px 0 0}.campaign-content>form{max-width:none}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.section-heading h2{margin:0;font-size:20px;line-height:28px;font-weight:500}.section-heading p{margin:2px 0 0}.mode-badge{padding:6px 10px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:12px;line-height:16px;font-weight:500}.campaign-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}.campaign-metric{min-width:0;min-height:126px;padding:16px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 4px 16px rgba(21,23,26,.05)}.campaign-metric span,.campaign-metric small{display:block;color:var(--muted)}.campaign-metric b{display:block;margin-top:12px;font-size:28px;line-height:36px;font-weight:500}.campaign-metric i{display:block;height:6px;margin-top:10px;overflow:hidden;border-radius:99px;background:#e6e8ec}.campaign-metric em{display:block;height:100%;border-radius:inherit;background:var(--brand)}.settings-stack{display:grid;gap:18px}.settings-card{padding:18px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 4px 16px rgba(21,23,26,.05)}.settings-card>h2,.settings-card>h3{margin:0 0 14px;font-weight:500}.summary-list{padding:18px}.summary-list>div{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:58px;border-bottom:1px solid var(--line)}.summary-list>div:last-child{border-bottom:0}.summary-list span{color:var(--muted)}.summary-list b{font-weight:500;text-align:right;overflow-wrap:anywhere}.history-card{margin-top:18px}.history-item{display:flex;align-items:center;gap:12px;min-height:66px;border-bottom:1px solid var(--line)}.history-item:last-child{border:0}.history-item>span{width:40px;height:40px;display:grid;place-items:center;flex:0 0 auto;border-radius:50%;background:#edf5ff;color:var(--brand)}.history-item div{display:grid;gap:3px;min-width:0}.history-item b{font-weight:500;overflow-wrap:anywhere}.history-item small{color:var(--muted)}.campaign-script{min-height:320px;line-height:1.6}.employee-picker{grid-template-columns:1fr;padding:0;border:0;background:transparent}.employee-option{min-height:62px;padding:10px 12px}.employee-option>input{position:absolute;opacity:0;pointer-events:none}.employee-option span{flex:1}.operator-switch{position:relative;width:46px;height:26px;flex:0 0 auto;border-radius:20px;background:#cbd0d8}.operator-switch:after{content:"";position:absolute;width:20px;height:20px;left:3px;top:3px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0002;transition:.2s}.employee-option input:checked+.operator-switch{background:var(--brand)}.employee-option input:checked+.operator-switch:after{left:23px}.danger-zone{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px;border:1px solid #fecaca;border-radius:14px;background:var(--danger-soft)}.danger-zone h2{margin:0 0 4px;color:#b91c1c;font-size:18px;font-weight:500}.danger-zone p{margin:0;color:#9f3a3a}.danger-actions{display:flex;gap:10px;flex:0 0 auto}.danger-outline{padding:10px 15px;border:1px solid var(--red);border-radius:10px;background:#fff;color:var(--red);font-weight:500}.danger-outline:hover{background:var(--danger-soft)}.save-confirmation{position:fixed;z-index:60;top:max(18px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:12px;min-width:min(420px,calc(100% - 32px));padding:13px 16px;border:1px solid #bbebc9;border-radius:12px;background:var(--success-soft);color:#16783a;box-shadow:0 12px 36px #16281d20}.save-confirmation span{display:grid}.save-confirmation small{color:#3d7f53}.schema-panel .schema-head{margin-bottom:8px}
@media(max-width:980px){.campaign-layout{grid-template-columns:1fr}.campaign-sidebar{display:flex;padding-bottom:4px;overflow-x:auto;scroll-snap-type:x mandatory}.campaign-item{min-width:240px;scroll-snap-align:start}}
@media(max-width:700px){.campaign-page-head h1{font-size:24px;line-height:32px}.campaign-page-head>.primary{min-height:48px}.campaign-header{align-items:stretch;padding:16px}.campaign-header .actions{display:grid;grid-template-columns:1fr 48px}.campaign-header .actions>*{width:auto;min-height:48px}.campaign-tabs{margin-top:8px;padding-bottom:8px;scroll-snap-type:x mandatory}.campaign-tabs button{min-height:48px;font-size:16px;scroll-snap-align:start}.campaign-content{padding-top:16px}.section-heading{align-items:stretch;flex-direction:column}.section-heading>.primary{width:100%;min-height:48px}.campaign-metrics{grid-template-columns:1fr}.campaign-metric{min-height:112px}.summary-list>div{align-items:flex-start;flex-direction:column;gap:5px;padding:12px 0}.summary-list b{text-align:left}.danger-zone,.danger-actions{align-items:stretch;flex-direction:column}.danger-actions button{width:100%;min-height:48px}.schedule-head>div:last-child{display:grid;gap:8px}.schedule-head button{width:100%;min-height:48px}.campaign-content input,.campaign-content textarea,.campaign-content select,.campaign-content button{font-size:16px}}

/* Global application components — the same system as Campaigns */
body{color:#15171a;background:#f6f7f9;font-weight:400}.topbar{min-height:80px;border-color:var(--line);box-shadow:0 2px 12px rgba(21,23,26,.03)}.brand strong{font-weight:500}.online{padding:8px 11px;border-radius:999px;background:var(--success-soft);color:#16783a}.tabs{gap:4px;padding:4px;background:#f0f1f4}.tab{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;color:var(--muted)}.tab:hover{background:#fff;color:#15171a}.tab.active{background:var(--brand);color:#fff;box-shadow:0 5px 14px rgba(91,92,240,.2)}.profile-button{border:1px solid transparent}.profile-button:hover{border-color:var(--line);background:#fff}.ghost,.secondary,.primary,.danger,.call{min-height:44px;border-radius:10px;font-size:14px;line-height:20px;font-weight:500;transition:background-color .16s,border-color .16s,color .16s,transform .12s}.ghost:hover,.secondary:hover{border-color:var(--brand-border);background:var(--brand-soft);color:var(--brand)}.ghost:active,.secondary:active,.primary:active,.danger:active,.call:active{transform:translateY(1px)}.danger:hover{border-color:#dc2626;background:#dc2626}.call:hover{border-color:#1eae4e;background:#1eae4e}.card{border-color:var(--line);border-radius:14px;box-shadow:0 4px 16px rgba(21,23,26,.05)}.card-pad{padding:24px}input,textarea,select{min-height:44px;border-color:var(--input-border);border-radius:10px;background:#fff;color:#15171a}input:hover,textarea:hover,select:hover{border-color:#bfc5cf}input:focus,textarea:focus,select:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(91,92,240,.22)}.field label,.label{color:var(--muted);font-weight:500}.page-head h1{font-size:28px;line-height:36px;font-weight:500}.page-head p{margin:4px 0 0}.callbar{border-radius:16px;box-shadow:0 4px 16px rgba(21,23,26,.05)}.call-icon{background:var(--success-soft)}.callstate strong{font-weight:500}.lead-card,.workflow-card{border-radius:16px}.lead-head input{font-weight:500}.section-title{font-weight:500}.gear-button,.field-gear{border:1px solid transparent;background:#f0f1f4}.gear-button:hover,.field-gear:hover{border-color:var(--brand-border);background:var(--brand-soft);color:var(--brand)}.workflow-tabs{gap:6px;padding:12px 16px}.workflow-tab{display:inline-flex;align-items:center;min-height:44px}.workflow-tab:hover{background:#f0f1f4;color:#15171a}.workflow-tab.active{background:var(--brand-soft);color:var(--brand);box-shadow:none}.workflow-heading h2{font-size:20px;line-height:28px;font-weight:500}.script-steps article{border-radius:12px}.result{min-height:48px;border-color:var(--input-border);border-radius:10px}.result:hover{border-color:var(--brand-border);background:#fafaff}.result.selected{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}.result.selected .radio{box-shadow:inset 0 0 0 3px var(--brand-soft);background:var(--brand)}.waiting>div{width:min(480px,100%);padding:32px;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:0 4px 16px rgba(21,23,26,.05)}.waiting img{width:150px;border-radius:32px}.waiting h2{font-size:24px;line-height:32px;font-weight:500}.spinner{border-color:#dedfff;border-top-color:var(--brand)}.metrics{gap:14px}.metric{min-height:126px;padding:18px;border-radius:14px}.metric b{font-size:28px;line-height:36px;font-weight:500}.table{border:1px solid var(--line);border-radius:12px;border-collapse:separate;border-spacing:0;overflow:hidden}.table th{padding:13px 14px;background:#f6f7f9;color:var(--muted);font-weight:500}.table td{padding:13px 14px}.table tbody tr:hover{background:#fafaff}.report-filters{border-radius:14px;box-shadow:0 4px 16px rgba(21,23,26,.05)}.report-scope-note{border:1px solid var(--brand-border);border-radius:10px}.operator-stats button{min-height:68px;border-radius:10px}.operator-stats button:hover{border-color:var(--brand-border);background:var(--brand-soft)}.user-card{border-radius:14px;box-shadow:0 4px 16px rgba(21,23,26,.05)}.user-card:hover{border-color:var(--brand-border);background:#fafaff;transform:translateY(-1px)}.role-badge{background:var(--brand-soft)}.status-badge{background:var(--success-soft)}.modal-backdrop{background:rgba(21,23,26,.46);backdrop-filter:blur(6px)}.modal{border:1px solid var(--line);border-radius:16px;padding:24px;box-shadow:0 30px 90px rgba(21,23,26,.22)}.modal h2{font-size:20px;line-height:28px;font-weight:500}.modal-actions{padding-top:18px;border-top:1px solid var(--line)}.login-card{border-radius:16px;box-shadow:0 24px 70px rgba(21,23,26,.12)}.login h1{font-weight:500}.quick-phone{display:grid;place-items:center;border:0;background:var(--brand);box-shadow:0 10px 28px rgba(91,92,240,.32)}.quick-phone:hover{background:var(--brand-hover)}.dialer-icon{background:var(--brand-soft);color:var(--brand)}.dialpad button{border-color:var(--line);border-radius:10px}.toast{border-radius:10px}
@media(max-width:700px){.topbar{box-shadow:0 2px 10px rgba(21,23,26,.04)}.tab{gap:4px}.tab .lucide{width:16px;height:16px}.page-head h1{font-size:24px;line-height:32px}.card-pad{padding:18px}.waiting{padding:20px 12px}.waiting>div{padding:24px 18px}.waiting img{width:120px}.modal{padding:20px}.metric{min-height:110px}.table th,.table td{padding:11px 12px}.quick-phone{bottom:calc(78px + env(safe-area-inset-bottom))}}

/* Lead workspace, notifications and tasks — unified Bulatkin Leads system */
.notification-button{position:relative;width:44px;height:44px;min-height:44px;display:grid;place-items:center;padding:0;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--muted)}
.notification-button:hover{border-color:var(--brand-border);background:var(--brand-soft);color:var(--brand)}
.notification-button>span{position:absolute;top:-5px;right:-5px;min-width:20px;height:20px;display:grid;place-items:center;padding:0 5px;border:2px solid #fff;border-radius:99px;background:var(--danger);color:#fff;font-size:10px;font-weight:500}
.lead-card{display:grid;align-content:start;gap:16px}.lead-meta{margin-bottom:-4px}.lead-head{margin-top:0}.lead-subtitle{margin:-12px 0 0}.card-config-row{margin:0}.dynamic-card-sections{display:grid;gap:16px}
.lead-data-section{padding:18px;border:1px solid var(--line);border-radius:14px;background:#f6f7f9;box-shadow:0 4px 16px rgba(21,23,26,.025)}
.lead-data-section .section-title{margin:0 0 14px;font-size:18px;line-height:26px}.lead-data-section .form-grid{gap:14px}.lead-data-section .field{margin:0}.lead-data-section input,.lead-data-section textarea,.lead-data-section select{background:#fff}.lead-data-section .description{min-height:150px}
.next-actions{padding:18px;border:1px solid var(--line);border-radius:14px;background:#f6f7f9}.next-actions .section-title{margin:0 0 14px;font-size:18px}.next-actions .secondary{background:#fff}
.workflow-card{padding:16px}.workflow-tabs{width:max-content;max-width:100%;gap:4px;margin:0 0 2px;padding:4px;border:0;border-radius:12px;background:#f0f1f4}
.workflow-tab{gap:7px;min-height:44px;padding:10px 14px}.workflow-tab.active{background:var(--brand);color:#fff;box-shadow:0 5px 14px rgba(91,92,240,.18)}.workflow-tab>b{min-width:19px;height:19px;display:grid;place-items:center;padding:0 5px;border-radius:99px;background:var(--brand);color:#fff;font-size:10px}.workflow-tab.active>b{background:#fff;color:var(--brand)}
.workflow{padding:20px 4px 4px}.workflow-heading{align-items:flex-start}.workflow-heading h2{font-size:20px;line-height:28px}.script-steps article{padding:18px 12px}.script-steps article:hover{background:#fafaff}.result-title{margin-top:20px}
.activity-list,.task-list{display:grid;gap:10px;margin-top:16px}.activity-list>article,.task-card{display:flex;align-items:flex-start;gap:12px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff}.activity-icon,.task-icon{width:40px;height:40px;display:grid;place-items:center;flex:0 0 auto;border-radius:50%;background:var(--brand-soft);color:var(--brand)}.activity-list article>div,.task-copy{min-width:0;flex:1}.activity-list b,.task-copy b{font-weight:500}.activity-list p,.task-copy p{margin:5px 0;line-height:1.45;overflow-wrap:anywhere}.activity-list small,.task-copy small{color:var(--muted);overflow-wrap:anywhere}
.task-copy>div:first-child{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.task-status{padding:4px 8px;border-radius:999px;background:var(--warning-soft);color:#9a6300;font-size:11px;white-space:nowrap}.status-accepted .task-status{background:var(--brand-soft);color:var(--brand)}.status-done .task-status{background:var(--success-soft);color:#16783a}.status-declined{opacity:.65}.status-declined .task-status{background:var(--danger-soft);color:#b91c1c}.task-actions{display:flex;gap:8px;margin-top:12px}.task-actions button{min-height:38px}.empty-state{min-height:280px;display:grid;place-content:center;justify-items:center;gap:8px;padding:24px;text-align:center;color:var(--muted)}.empty-state svg{color:var(--brand)}.empty-state b{color:var(--text);font-size:18px;font-weight:500}.empty-state p{max-width:400px;margin:0}
.notification-head,.modal-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.notification-head h2,.notification-head p,.modal-title-row h2,.modal-title-row p{margin:0}.notification-head .primary{flex:0 0 auto}.notification-tabs{display:flex;margin:16px 0 4px}.task-counter{padding:6px 10px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:12px;font-weight:500}.notification-list{max-height:58vh;overflow:auto;padding-right:4px}.created-tasks-title{display:flex;align-items:center;justify-content:space-between;margin-top:10px;padding:14px 0 4px;border-top:1px solid var(--line)}.created-tasks-title span{padding:4px 8px;border-radius:99px;background:#f0f1f4;color:var(--muted);font-size:11px}
@media(max-width:700px){.notification-button{width:42px;height:42px;min-height:42px}.lead-card{gap:14px}.lead-data-section,.next-actions{padding:14px}.workflow-card{padding:12px}.workflow-tabs{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible}.workflow-tab{width:100%;min-width:0;justify-content:center;gap:4px;min-height:48px;padding:9px 5px;font-size:13px}.workflow-tab .lucide{width:16px;height:16px}.workflow{padding:16px 2px 2px}.workflow-heading{flex-direction:column}.workflow-heading>.primary{width:100%}.task-copy>div:first-child{flex-direction:column}.task-actions{flex-direction:column}.task-actions button{width:100%;min-height:48px}.notification-head{flex-direction:column}.notification-head .primary{width:100%}.activity-list>article,.task-card{padding:12px}.user-menu .notification-button{display:grid}}
 .registration-requests,.enterprise-grid{margin:18px 0;padding:20px}.registration-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-top:1px solid var(--line)}.registration-row span,.enterprise-card span,.enterprise-card small{display:block;color:var(--muted);font-size:13px;margin-top:4px}.enterprise-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}.enterprise-card{padding:16px}.login-card .secondary{width:100%;margin-top:10px}
 .accept-user{margin-left:auto;min-height:34px;padding:7px 13px;font-size:12px}
 .crm-filters{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 16px;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fff}.crm-filters input,.crm-filters select{min-height:38px;padding:0 10px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--text)}.crm-filters input[type=date]{width:145px}.crm-filters input:not([type=date]){min-width:210px}
 .crm-filter-shell{margin:14px 0 18px;padding:0;border:0;background:transparent}.crm-main-toolbar{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid #d9dbea;border-radius:16px;background:linear-gradient(135deg,#fff,#f6f7ff);box-shadow:0 8px 24px rgba(54,58,120,.08)}.crm-main-toolbar select{height:44px;min-width:190px;padding:0 14px;border:0;border-radius:12px;background:#eeedff;color:#5355d9;font-weight:600}.crm-search-box{display:flex;align-items:center;gap:8px;flex:1;height:44px;padding:0 13px;border:1px solid #d9dbea;border-radius:12px;background:#fff}.crm-search-box span{font-size:25px;line-height:1;color:#767b91}.crm-search-box input{width:100%;min-width:0;border:0;outline:0;background:transparent}.crm-filter-toggle{height:44px;white-space:nowrap}.crm-filter-panel{display:none;align-items:end;flex-wrap:wrap;gap:10px;margin-top:10px;padding:14px;border:1px solid #e0e2ed;border-radius:14px;background:#fff;box-shadow:0 8px 20px rgba(54,58,120,.06)}.crm-filter-panel.is-open{display:flex}.crm-filter-panel select{height:40px;min-width:180px;padding:0 10px;border:1px solid var(--line);border-radius:9px;background:#fff}.crm-filter-panel label{display:grid;gap:5px;color:var(--muted);font-size:12px}.crm-filter-panel input{height:40px;padding:0 10px;border:1px solid var(--line);border-radius:9px}
 .chat-enterprise-select{min-height:42px;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:#fff}.chat-card{display:grid;grid-template-rows:1fr auto;min-height:62vh;padding:18px;border:1px solid var(--line);border-radius:18px;background:linear-gradient(180deg,#f8f8ff,#fff);box-shadow:0 10px 30px rgba(45,48,94,.08)}.chat-messages{display:grid;align-content:start;gap:10px;max-height:58vh;overflow:auto;padding:8px}.chat-message{max-width:72%;padding:11px 14px;border:1px solid #e0e2ed;border-radius:14px 14px 14px 4px;background:#fff}.chat-message.mine{justify-self:end;border-color:#c9c8ff;border-radius:14px 14px 4px 14px;background:#f0efff}.chat-message b{display:block}.chat-message small{display:block;color:var(--muted);font-size:11px}.chat-message p{margin:7px 0;white-space:pre-wrap;overflow-wrap:anywhere}.chat-message a{display:inline-block;margin-top:5px;color:var(--brand);overflow-wrap:anywhere}.chat-attach-row{display:flex;gap:10px;align-items:end;margin-top:14px}.chat-attach-row textarea{flex:1;min-height:58px;resize:vertical;padding:12px;border:1px solid var(--line);border-radius:12px}.chat-attach-row input[type=file]{max-width:180px}.chat-attach-row button{min-height:58px}.chat-attachment{padding:6px 0;font-size:12px}
 .chat-fab{position:fixed;left:22px;bottom:24px;z-index:20;width:56px;height:56px;display:grid;place-items:center;border:0;border-radius:50%;background:#19b7a5;color:#fff;box-shadow:0 10px 25px rgba(25,183,165,.35);cursor:pointer}.chat-fab span{position:absolute;top:-4px;right:-4px;min-width:20px;height:20px;display:grid;place-items:center;padding:0 5px;border:2px solid #fff;border-radius:99px;background:#e05276;color:#fff;font-size:10px;font-weight:700}
 .enterprise-edit-list{display:grid;gap:10px;max-height:48vh;overflow:auto}.enterprise-edit-row{display:flex;gap:8px}.enterprise-edit-row input,.new-enterprise-form input{flex:1;min-height:40px;padding:0 10px;border:1px solid var(--line);border-radius:9px}.enterprise-edit-row button,.new-enterprise-form button{min-height:40px}.new-enterprise-form{display:flex;gap:8px;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
