:root {
  --ink: #17201d;
  --muted: #68736f;
  --subtle: #8d9693;
  --canvas: #f5f7f6;
  --panel: #ffffff;
  --line: #dfe5e2;
  --line-strong: #cdd6d2;
  --green: #176b50;
  --green-dark: #10523e;
  --green-soft: #e8f4ef;
  --blue: #315d9d;
  --blue-soft: #edf3fb;
  --amber: #a66814;
  --amber-soft: #faf1df;
  --red: #a34040;
  --red-soft: #f9eaea;
  --purple: #675090;
  --purple-soft: #f0ebf7;
  --sidebar: 216px;
  --phone-width: 250px;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(49, 93, 157, .18); outline-offset: 1px; }
[hidden] { display: none !important; }

.v2-signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, #eef6f2 0, var(--canvas) 42%); }
.signin-card { width: min(100%, 420px); display: grid; gap: 28px; padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 24px 70px rgba(30, 43, 38, .12); }
.signin-brand { display: flex; align-items: center; gap: 11px; }
.signin-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.signin-brand small { margin-top: 4px; color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.signin-card h1 { margin-bottom: 8px; font-size: 28px; }
.signin-card > div:nth-child(2) > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.signin-card form { display: grid; gap: 16px; }
.signin-card form label { display: grid; gap: 7px; color: #48534f; font-size: 12px; font-weight: 700; }
.signin-card input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; }
.signin-card form button { margin-top: 4px; }
.signin-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 12px; }
.signin-note { margin: 0; color: var(--subtle); font-size: 11px; line-height: 1.5; }

.preview-data-banner { min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 7px 20px; border-bottom: 1px solid #ead6a9; background: #fff8e8; color: #75551e; font-size: 11px; }
.preview-data-banner a { color: inherit; font-weight: 700; }
.signout-button { padding: 8px; white-space: nowrap; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 22px 14px 16px; background: var(--panel); border-right: 1px solid var(--line); z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 10px 20px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #f9c94c; background: #1c211f; font-size: 20px; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 4px; color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.main-nav { display: grid; gap: 4px; padding: 18px 0; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: #56615d; cursor: pointer; text-align: left; font-weight: 600; }
.nav-item span { width: 18px; display: inline-grid; place-items: center; color: #8b9591; }
.nav-item:hover { color: var(--ink); background: #f4f6f5; }
.nav-item.active { color: var(--green-dark); background: var(--green-soft); }
.nav-item.active span { color: var(--green); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 11px 0; border-top: 1px solid var(--line); }
.sidebar-foot > span:last-child { display: flex; flex-direction: column; }
.sidebar-foot strong { font-size: 12px; }
.sidebar-foot small { color: var(--subtle); font-size: 10px; margin-top: 2px; }
.health-dot, .status-dot { width: 9px; height: 9px; flex: none; border-radius: 99px; background: #31b87e; box-shadow: 0 0 0 4px #e8f6f0; }

.main-area { min-height: 100vh; margin-left: var(--sidebar); padding-bottom: 28px; }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15; }
.eyebrow { margin: 0 0 4px; color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; line-height: 1.1; letter-spacing: -.025em; }
h2 { font-size: 18px; letter-spacing: -.02em; }
h3 { font-size: 15px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.availability-control { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.availability-control select { min-width: 88px; border: 0; background: transparent; color: var(--ink); font-weight: 700; cursor: pointer; }
.status-dot.paused { background: #c98b31; box-shadow: 0 0 0 4px #fbf2e4; }
.status-dot.break { background: #7f8a86; box-shadow: 0 0 0 4px #eef1f0; }
.icon-button { width: 40px; height: 40px; position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.notice-dot { position: absolute; top: 9px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.account-button { min-width: 154px; height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; text-align: left; }
.account-button > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.account-button strong { font-size: 12px; }
.account-button small { margin-top: 1px; color: var(--subtle); font-size: 10px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; }

.page { display: none; padding: 20px 28px 0; }
.page.active { display: block; }
button.primary, button.secondary { min-height: 40px; padding: 0 16px; border-radius: 9px; cursor: pointer; font-weight: 700; }
button.primary { border: 1px solid var(--green); background: var(--green); color: #fff; }
button.primary:hover { background: var(--green-dark); }
button.primary:disabled { border-color: #cbd6d2; background: #dbe3e0; color: #88928e; cursor: default; }
button.secondary { border: 1px solid var(--line-strong); background: var(--panel); color: #46514d; }
button.secondary:hover { border-color: #aebbb6; background: #f9faf9; }
button.compact { min-height: 34px; padding-inline: 12px; font-size: 12px; }
button.full { width: 100%; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--blue); cursor: pointer; font-weight: 700; font-size: 12px; }
.close-button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: #f0f3f1; cursor: pointer; font-size: 20px; }

.call-state-bar { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -20px -28px 18px; padding: 8px 28px; background: var(--panel); border-bottom: 1px solid var(--line); }
.call-state-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.call-state-copy strong { font-size: 12px; }
.call-state-copy > span:last-child { overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.state-pulse { width: 8px; height: 8px; flex: none; border-radius: 99px; background: #c98b31; box-shadow: 0 0 0 4px #fbf2e4; }
.call-state-bar.ready .state-pulse, .call-state-bar.dialing .state-pulse { background: #31b87e; box-shadow: 0 0 0 4px #e8f6f0; }
.call-state-bar.ringing .state-pulse { background: #315d9d; box-shadow: 0 0 0 4px #eaf0f9; animation: pulse 1.2s infinite; }
.call-state-bar.connected .state-pulse { background: #31b87e; box-shadow: 0 0 0 4px #e8f6f0; }
.call-state-bar.wrap .state-pulse { background: #a66814; box-shadow: 0 0 0 4px #fbf2e4; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .65; } }
.dial-toolbar { display: flex; gap: 8px; flex: none; }
.playlist-popover { position: fixed; top: 118px; right: 155px; width: 350px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 16px 44px rgba(30,43,38,.14); z-index: 30; }
.popover-head { display: flex; justify-content: space-between; margin-bottom: 10px; }
.popover-head > div { display: flex; flex-direction: column; }
.popover-head strong { font-size: 14px; }
.popover-head small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.playlist-option { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 9px; padding: 10px 8px; border-radius: 8px; cursor: pointer; }
.playlist-option:hover { background: #f6f8f7; }
.playlist-option > span { display: flex; flex-direction: column; }
.playlist-option strong { font-size: 12px; }
.playlist-option small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.playlist-option b { padding: 3px 6px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: 9px; }

.resource-state { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 24px; color: var(--muted); text-align: center; }
.resource-state > span:first-child { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #eef2f0; color: var(--subtle); font-weight: 800; }
.resource-state strong { color: var(--ink); font-size: 13px; }
.resource-state small { max-width: 420px; font-size: 11px; line-height: 1.45; }
.resource-state > div { display: flex; gap: 8px; margin-top: 5px; }
.resource-state.error > span:first-child { background: var(--red-soft); color: var(--red); }
.loading-spinner { border: 3px solid #dfe7e3; border-top-color: var(--green) !important; border-radius: 50% !important; background: transparent !important; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#playlistResourceState .resource-state { min-height: 120px; padding: 12px 8px; }
#playlistResourceState .resource-state > div { flex-wrap: wrap; justify-content: center; }
.campaign-picker { min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 700; }
.campaign-picker select { max-width: 220px; border: 0; background: transparent; color: var(--ink); font-weight: 700; }
.table-card.resource-loading .table-wrap { opacity: .32; pointer-events: none; }

.dial-workspace { min-height: calc(100vh - 166px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-right: calc(var(--phone-width) + 14px); }
.outcome-rail, .lead-rail { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dial-workspace[data-call-state="connected"], .dial-workspace[data-call-state="wrap"] { grid-template-columns: 188px minmax(360px, 1fr) 248px; padding-right: calc(var(--phone-width) + 14px); }
.dial-workspace[data-call-state="connected"] .outcome-rail, .dial-workspace[data-call-state="connected"] .lead-rail, .dial-workspace[data-call-state="wrap"] .outcome-rail, .dial-workspace[data-call-state="wrap"] .lead-rail { display: block; }
.conversation-panel { min-width: 0; min-height: 560px; position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.workspace-tabs { min-height: 40px; display: flex; align-items: end; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.workspace-tabs button, .script-tabs button { min-height: 36px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.workspace-tabs button.active, .script-tabs button.active { border-bottom-color: var(--green); color: var(--ink); }
.script-tabs { min-height: 39px; display: flex; align-items: end; gap: 3px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.script-tabs .script-edit { margin-left: auto; color: var(--blue); }
.workspace-content { display: none; }
.workspace-content.active { display: block; }
.script-document { min-height: 470px; padding: 24px 28px 90px; color: #26312d; font-size: 16px; line-height: 1.7; }
.script-document p { max-width: 790px; margin: 0 0 24px; }
.script-document[contenteditable="true"] { background: #fffdf6; box-shadow: inset 0 0 0 2px #e5c16c; }
.idle-message { position: absolute; inset: 80px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; background: var(--panel); text-align: center; }
.dial-workspace:not([data-call-state="idle"]):not([data-call-state="ready"]):not([data-call-state="dialing"]):not([data-call-state="ringing"]) .idle-message { display: none; }
.idle-mark { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 16px; background: var(--green-soft); color: var(--green); font-size: 26px; }
.idle-message h2 { margin-bottom: 7px; font-size: 21px; }
.idle-message > p { max-width: 530px; margin-bottom: 22px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.idle-selection { min-width: 430px; display: flex; align-items: center; gap: 11px; margin-bottom: 18px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfa; text-align: left; }
.idle-selection > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--green-soft); color: var(--green); font-weight: 700; }
.idle-selection > div { display: flex; flex-direction: column; }
.idle-selection strong { font-size: 12px; }
.idle-selection small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.empty-state { min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.empty-state h2 { margin: 12px 0 6px; }
.empty-state p { max-width: 470px; color: var(--muted); font-size: 12px; }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 24px; }
.transcript-feed { padding: 20px 24px; }
.transcript-feed > div { position: relative; padding: 0 48px 16px 82px; }
.transcript-feed b { position: absolute; left: 0; color: var(--muted); font-size: 11px; }
.transcript-feed p { margin: 0; font-size: 14px; line-height: 1.5; }
.transcript-feed time { position: absolute; right: 0; top: 0; color: var(--subtle); font-size: 10px; }
.history-list { padding: 22px 26px 8px; }
.history-list article { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding-bottom: 22px; }
.history-list article:not(:last-child)::after { content: ""; position: absolute; top: 11px; left: 4px; bottom: 0; width: 1px; background: var(--line); }
.timeline-dot { width: 9px; height: 9px; margin-top: 3px; border-radius: 50%; background: var(--green); }
.history-list strong { font-size: 12px; }
.history-list p { margin: 3px 0; color: var(--muted); font-size: 12px; }
.history-list small { color: var(--subtle); font-size: 10px; }
.notes-field { display: grid; gap: 7px; padding: 0 26px 24px; font-size: 11px; font-weight: 700; }
.notes-field textarea { min-height: 110px; resize: vertical; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.map-placeholder { height: 390px; position: relative; overflow: hidden; background: #eef1ed; }
.map-grid { position: absolute; inset: -20px; background-image: linear-gradient(#d7ded8 1px, transparent 1px), linear-gradient(90deg, #d7ded8 1px, transparent 1px); background-size: 42px 42px; transform: rotate(4deg); }
.map-grid::before, .map-grid::after { content: ""; position: absolute; background: #fff; border: 1px solid #cfd8d1; }
.map-grid::before { width: 120%; height: 34px; top: 130px; left: -20px; transform: rotate(-18deg); }
.map-grid::after { width: 38px; height: 120%; top: -20px; left: 54%; transform: rotate(8deg); }
.map-pin { position: absolute; top: 44%; left: 50%; color: var(--red); font-size: 32px; text-shadow: 0 4px 8px rgba(0,0,0,.2); }
.map-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px; }

.rail-heading { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.rail-heading p { margin: 0; }
.required-pill, .live-pill, .verified { padding: 3px 7px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 700; }
.result-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; }
.result-buttons button { min-height: 54px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; text-align: left; font-size: 10px; font-weight: 700; }
.result-buttons button:hover, .result-buttons button.active { border-color: var(--green); background: var(--green-soft); }
.result-icon { font-size: 13px; }
.result-icon.gray { color: #7e8985; } .result-icon.blue { color: var(--blue); } .result-icon.green { color: var(--green); } .result-icon.amber { color: var(--amber); } .result-icon.purple { color: var(--purple); } .result-icon.red { color: var(--red); }
.followup-form { min-height: 112px; padding: 10px; border-top: 1px solid var(--line); }
.followup-form p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.followup-form label { display: grid; gap: 5px; margin-bottom: 9px; font-size: 9px; font-weight: 700; }
.followup-form input, .followup-form select, .followup-form textarea { width: 100%; min-height: 34px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 10px; }
.outcome-rail > .primary { width: calc(100% - 20px); margin: 0 10px 12px; min-height: 38px; padding: 0 7px; font-size: 10px; }
.lead-head { min-height: 70px; display: flex; align-items: flex-start; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--line); }
.lead-head h2 { margin: 0; font-size: 16px; }
.lead-section { padding: 13px 14px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 11px; }
.lead-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.lead-fields label { min-width: 0; display: grid; gap: 3px; color: var(--subtle); font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.lead-fields label.wide { grid-column: 1 / -1; }
.lead-fields input { min-width: 0; width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 10px; font-weight: 600; text-transform: none; }
.lead-fields input:not([readonly]) { padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px; background: #fffdf6; }
.lead-actions { display: grid; grid-template-columns: 1fr; gap: 7px; padding: 12px 14px; }
.lead-actions button { min-height: 36px; font-size: 10px; }

.phone-dock { position: fixed; right: 18px; bottom: 18px; width: var(--phone-width); max-height: calc(100vh - 110px); border: 1px solid var(--line-strong); border-radius: 13px; background: var(--panel); box-shadow: 0 12px 34px rgba(27,41,35,.16); overflow: hidden; z-index: 18; }
.phone-header { width: 100%; min-height: 48px; display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 9px; padding: 8px 12px; border: 0; background: var(--panel); cursor: pointer; text-align: left; }
.phone-state-icon { color: #32b77e; font-size: 11px; }
.phone-header > span:nth-child(2) { display: flex; flex-direction: column; }
.phone-header strong { font-size: 11px; }
.phone-header small { margin-top: 1px; color: var(--muted); font-size: 9px; }
.phone-chevron { color: var(--subtle); }
.phone-body { display: grid; gap: 8px; max-height: 0; padding: 0 10px; overflow: hidden; border-top: 0 solid var(--line); transition: max-height .2s ease, padding .2s ease, border-width .2s ease; }
.phone-dock.open .phone-body { max-height: 510px; padding: 10px; border-top-width: 1px; }
.phone-dock.open .phone-chevron { transform: rotate(180deg); }
.phone-number-row { display: grid; grid-template-columns: 1fr 34px; gap: 5px; }
.phone-number-row input, .phone-number-row button { min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.phone-number-row input { padding: 0 10px; font-size: 11px; }
.phone-number-row button { cursor: pointer; }
.phone-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.phone-keypad button { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.phone-keypad button small { display: block; color: var(--subtle); font-size: 6px; letter-spacing: .12em; }
.phone-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.phone-tools button { min-width: 0; height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; cursor: pointer; color: var(--muted); font-size: 7px; font-weight: 700; }
.phone-tools button span { color: var(--ink); font-size: 12px; }
.phone-tools button.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.call-button, .end-call-button { min-height: 38px; border: 0; border-radius: 9px; color: #fff; cursor: pointer; font-weight: 700; }
.call-button { background: var(--green); }
.end-call-button { background: var(--red); }
.phone-dock[data-phone-state="ringing"] .phone-state-icon { color: var(--blue); animation: pulse 1.1s infinite; }
.phone-dock[data-phone-state="connected"] .phone-state-icon { color: var(--green); }
.phone-dock[data-phone-state="wrap"] .phone-state-icon { color: var(--amber); }

.page-actions { min-height: 44px; display: flex; justify-content: flex-end; gap: 9px; margin-bottom: 14px; }
.search-field { min-width: 320px; height: 40px; display: flex; align-items: center; gap: 8px; margin-right: auto; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.search-field span { color: var(--subtle); }
.search-field input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; }
.filter-chips { display: flex; gap: 7px; margin-bottom: 14px; }
.filter-chips button { min-height: 28px; padding: 0 9px; border: 1px solid #cbd9d3; border-radius: 99px; background: var(--green-soft); color: var(--green-dark); cursor: pointer; font-size: 10px; font-weight: 700; }
.filter-chips .clear-chip { border-color: transparent; background: transparent; color: var(--muted); }
.table-card, .settings-card, .schedule-list, .day-summary, .import-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card-heading { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-heading h2 { margin: 0 0 3px; }
.card-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.view-actions { display: flex; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--subtle); background: #fafbfa; font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
td { color: #414b47; font-size: 11px; }
td strong { color: var(--ink); }
td small { display: block; margin-top: 2px; color: var(--subtle); }
.status-tag { display: inline-flex; min-height: 23px; align-items: center; padding: 0 7px; border-radius: 99px; background: #eef2f0; color: #596560; font-size: 9px; font-weight: 700; }
.status-tag.green { background: var(--green-soft); color: var(--green); }
.status-tag.blue { background: var(--blue-soft); color: var(--blue); }
.status-tag.amber { background: var(--amber-soft); color: var(--amber); }
.row-action { width: 30px; height: 30px; border: 0; border-radius: 7px; background: #f2f4f3; cursor: pointer; }
.pagination { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 15px; color: var(--muted); font-size: 10px; }
.pagination label { display: flex; align-items: center; gap: 7px; }
.pagination select { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.pagination > div { display: flex; gap: 4px; }
.pagination button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.pagination button.active { border-color: var(--green); background: var(--green); color: #fff; }

.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.metric-strip article { min-height: 104px; display: flex; flex-direction: column; justify-content: center; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.metric-strip small { color: var(--muted); font-size: 10px; }
.metric-strip strong { margin: 6px 0 2px; font-size: 24px; letter-spacing: -.04em; }
.metric-strip span { color: var(--subtle); font-size: 9px; }
.campaign-list { display: grid; }
.campaign-row { min-height: 76px; display: grid; grid-template-columns: 1.4fr .7fr .7fr .7fr auto; align-items: center; gap: 18px; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.campaign-row:last-child { border-bottom: 0; }
.campaign-row:hover { background: #fafbfa; }
.campaign-row > div { display: flex; flex-direction: column; }
.campaign-row strong { font-size: 12px; }
.campaign-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.campaign-row .metric { color: var(--subtle); font-size: 9px; }
.campaign-row .metric b { margin-bottom: 3px; color: var(--ink); font-size: 13px; }

.import-layout { display: grid; grid-template-columns: 230px minmax(0, 720px); gap: 14px; justify-content: center; }
.step-list { align-self: start; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.step-list button { width: 100%; min-height: 60px; display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 9px; padding: 8px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; }
.step-list button.active { background: var(--green-soft); }
.step-list b { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 10px; }
.step-list button.active b { border-color: var(--green); background: var(--green); color: #fff; }
.step-list span { display: flex; flex-direction: column; }
.step-list strong { font-size: 11px; }
.step-list small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.import-card { min-height: 520px; }
.import-step { display: none; padding: 30px; }
.import-step.active { display: block; }
.import-step h2 { margin-bottom: 7px; font-size: 22px; }
.import-step > p:not(.eyebrow) { color: var(--muted); font-size: 12px; }
.drop-zone { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 24px; border: 1px dashed #aebbb6; border-radius: 12px; background: #fafcfb; cursor: pointer; }
.drop-zone span { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 14px; background: var(--green-soft); color: var(--green); font-size: 24px; }
.drop-zone strong { font-size: 13px; }
.drop-zone small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.drop-zone input { display: none; }
.import-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 24px; }
.mapping-list { display: grid; margin-top: 22px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mapping-list > div { min-height: 55px; display: grid; grid-template-columns: 1fr 30px 1fr; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.mapping-list > div:last-child { border-bottom: 0; }
.mapping-list span { font-size: 11px; font-weight: 700; }
.mapping-list b { color: var(--subtle); text-align: center; }
.mapping-list select, .form-grid input, .form-grid select { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 24px; }
.form-grid label { display: grid; gap: 6px; font-size: 10px; font-weight: 700; }
.review-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 22px; }
.review-grid article { min-height: 90px; display: flex; flex-direction: column; justify-content: center; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.review-grid article.good { border-color: #bdd8cc; background: var(--green-soft); }
.review-grid strong { font-size: 20px; }
.review-grid span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.review-notice { display: flex; gap: 10px; margin-top: 18px; padding: 13px; border: 1px solid #ead4ac; border-radius: 9px; background: var(--amber-soft); }
.review-notice > span { width: 24px; height: 24px; display: grid; place-items: center; flex: none; border-radius: 50%; background: #fff; color: var(--amber); font-weight: 700; }
.review-notice p { margin: 0; font-size: 10px; line-height: 1.5; }
.success-state { min-height: 440px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.success-state > span { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 24px; }
.success-state p { max-width: 430px; color: var(--muted); font-size: 12px; }

.segmented { display: flex; margin-right: auto; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #eef2f0; }
.segmented button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.segmented b { display: inline-grid; min-width: 18px; height: 18px; place-items: center; margin-left: 4px; border-radius: 99px; background: #e6ece9; font-size: 8px; }
.schedule-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 12px; }
.schedule-item { min-height: 74px; display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.schedule-item:last-child { border-bottom: 0; }
.schedule-item time { color: var(--green); font-size: 13px; font-weight: 700; }
.schedule-item > div { display: flex; flex-direction: column; }
.schedule-item strong { font-size: 12px; }
.schedule-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.day-summary { align-self: start; padding: 16px; }
.day-summary h3 { margin-bottom: 15px; }
.day-summary > div { min-height: 39px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.day-summary strong { color: var(--ink); }
.day-summary button { margin-top: 14px; }

.user-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; }
.user-card { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.user-card header { display: flex; align-items: center; gap: 10px; }
.user-card .avatar { width: 38px; height: 38px; }
.user-card header > span:nth-child(2) { display: flex; flex-direction: column; }
.user-card strong { font-size: 12px; }
.user-card small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.user-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 16px 0; }
.user-card dt { color: var(--subtle); font-size: 8px; text-transform: uppercase; }
.user-card dd { margin: 3px 0 0; font-size: 11px; font-weight: 700; }
.user-card footer { display: flex; justify-content: space-between; align-items: center; }

.settings-layout { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 12px; }
.settings-nav { align-self: start; display: grid; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.settings-nav button { min-height: 42px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: 11px; font-weight: 700; }
.settings-nav button.active { background: var(--green-soft); color: var(--green-dark); }
.script-settings-list article { min-height: 76px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 13px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.script-settings-list article > div { display: flex; flex-direction: column; }
.script-settings-list strong { font-size: 12px; }
.script-settings-list p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.script-settings-list article > span { padding: 4px 7px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 700; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(18,27,24,.28); z-index: 39; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 92vw); display: flex; flex-direction: column; background: var(--panel); box-shadow: -18px 0 48px rgba(24,35,31,.18); transform: translateX(105%); transition: transform .22s ease; z-index: 40; }
.drawer.open { transform: translateX(0); }
.drawer header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer header h2 { margin: 0; }
.drawer-content { flex: 1; overflow-y: auto; padding: 20px; }
.drawer footer { min-height: 68px; display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); }
.drawer-section { margin-bottom: 22px; }
.drawer-section h3 { margin-bottom: 10px; }
.drawer-section p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.condition-builder { display: grid; gap: 8px; }
.condition-row { display: grid; grid-template-columns: 1fr .8fr 1.2fr 28px; gap: 6px; }
.condition-row select, .condition-row input, .drawer-form input, .drawer-form select, .drawer-form textarea { width: 100%; min-height: 38px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 11px; }
.condition-row button { border: 0; border-radius: 7px; background: #f0f3f1; cursor: pointer; }
.drawer-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.drawer-form label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.drawer-form label.wide { grid-column: 1 / -1; }
.drawer-form textarea { min-height: 95px; resize: vertical; }
.matching-count { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding: 11px 12px; border-radius: 8px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; }
.matching-count strong { font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; min-width: 310px; display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid #bdd8cc; border-radius: 10px; background: #f0faf5; box-shadow: 0 10px 30px rgba(0,0,0,.12); transform: translateX(-50%); z-index: 60; }
.toast > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-size: 11px; }
.toast p { flex: 1; margin: 0; font-size: 11px; font-weight: 700; }
.toast button { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 10px; font-weight: 700; }

@media (max-width: 1320px) {
  :root { --sidebar: 196px; --phone-width: 228px; }
  .page { padding-inline: 20px; }
  .call-state-bar { margin-inline: -20px; padding-inline: 20px; }
  .dial-workspace[data-call-state="connected"], .dial-workspace[data-call-state="wrap"] { grid-template-columns: 172px minmax(330px,1fr) 220px; }
  .script-document { padding-inline: 22px; font-size: 15px; }
  .result-buttons { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  :root { --sidebar: 176px; --phone-width: 220px; }
  .nav-item { padding-inline: 10px; }
  .dial-workspace[data-call-state="connected"], .dial-workspace[data-call-state="wrap"] { grid-template-columns: 166px minmax(320px,1fr); }
  .dial-workspace[data-call-state="connected"] .lead-rail, .dial-workspace[data-call-state="wrap"] .lead-rail { grid-column: 1 / -1; display: grid; grid-template-columns: 170px 1fr 1fr 180px; align-items: stretch; }
  .lead-head, .lead-section { border-right: 1px solid var(--line); border-bottom: 0; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .user-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  :root { --sidebar: 72px; --phone-width: 220px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > span:last-child, .nav-item:not(.active) > span + *, .nav-item { font-size: 0; }
  .brand-mark { flex: none; }
  .nav-item { justify-content: center; }
  .nav-item span { font-size: 15px; }
  .sidebar-foot > span:last-child { display: none; }
  .sidebar-foot { justify-content: center; }
  .account-button { min-width: 42px; width: 42px; }
  .account-button > span:not(.avatar) { display: none; }
  .dial-workspace { padding-right: 0; padding-bottom: 72px; }
  .dial-workspace[data-call-state="connected"], .dial-workspace[data-call-state="wrap"] { grid-template-columns: 1fr; padding-right: 0; }
  .outcome-rail, .lead-rail { grid-column: auto !important; }
  .phone-dock { width: calc(100vw - var(--sidebar) - 28px); right: 14px; bottom: 12px; }
  .metric-strip, .user-grid, .schedule-layout, .settings-layout, .import-layout { grid-template-columns: 1fr; }
  .step-list { display: flex; overflow-x: auto; }
  .step-list button { min-width: 150px; }
}
