:root {
  --sidebar: #040824;
  --sidebar-muted: #9aa3b2;
  --page: #f5f7fb;
  --panel: #ffffff;
  --ink: #080b2a;
  --text: #20242c;
  --muted: #777d8e;
  --line: #e5e7eb;
  --line-strong: #d7dbe3;
  --surface: #fbfcff;
  --blue: #070b35;
  --blue-soft: #edf2ff;
  --accent: #5b6dff;
  --accent-soft: #eef0ff;
  --green: #168657;
  --green-bg: #e8f6ee;
  --amber: #b36a04;
  --amber-bg: #fff1da;
  --red: #b42318;
  --red-bg: #fee7e5;
  --purple: #6941c6;
  --purple-bg: #f1ebff;
  --card-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: "Inter", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(91, 109, 255, 0.28);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(91, 109, 255, 0.08), rgba(4, 8, 36, 0) 230px),
    var(--sidebar);
  color: #fff;
  padding: 18px 12px;
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 28px;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: #ffffff;
  color: var(--sidebar);
  font-size: 12px;
  font-weight: 600;
}

.topbar-title-group {
  min-width: 0;
}

.brand-title {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.brand-subtitle {
  color: var(--sidebar-muted);
  font-size: 11px;
}

.nav {
  display: grid;
  gap: 3px;
}

.nav-section {
  margin: 18px 10px 7px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 500;
}

.nav-section:first-child {
  margin-top: 0;
}

.nav-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #e4e7ec;
  padding: 8px 9px;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-button.active {
  background: #ffffff;
  color: var(--sidebar);
}

.nav-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  font-weight: 500;
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 5px;
  color: inherit;
  font-size: 9px;
  font-weight: 600;
}

.nav-button.active .nav-icon {
  border-color: #d8dbe4;
}

.nav-count {
  min-width: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 1px 6px;
  font-size: 11px;
  text-align: center;
}

.nav-button.active .nav-count {
  background: #eef0f5;
  color: #4b5565;
}

.sidebar-footer {
  position: absolute;
  right: 12px;
  bottom: 14px;
  left: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 8px 0;
}

.sidebar .company {
  color: #fff;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #ffffff;
  color: var(--sidebar);
  font-size: 10px;
  font-weight: 600;
}

.avatar.dark {
  background: var(--blue);
  color: #fff;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 420px) auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 24px;
  backdrop-filter: blur(12px);
}

.page-title {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
}

.page-copy {
  display: none;
}

.top-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.topbar-search-shell {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfc;
  padding: 0 12px 0 36px;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.topbar-search-shell:focus-within {
  border-color: #bcc5ff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91, 109, 255, 0.1);
}

.search-mark {
  position: absolute;
  left: 13px;
  width: 13px;
  height: 13px;
  border: 2px solid #a7adba;
  border-radius: 999px;
}

.search-mark::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 6px;
  height: 2px;
  border-radius: 999px;
  background: #a7adba;
  transform: rotate(45deg);
  transform-origin: left center;
}

.topbar-search {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.topbar-search::placeholder {
  color: #9aa1af;
}

.content {
  padding: 18px 24px 28px;
}

.dashboard-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  box-shadow: var(--shadow);
}

.dashboard-tab {
  min-height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #74798a;
  padding: 0 12px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease;
}

.dashboard-tab:hover {
  background: #eef0f5;
  color: var(--ink);
}

.dashboard-tab.active {
  background: var(--blue);
  color: #fff;
}

.button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: #252a34;
  padding: 6px 10px;
  font-weight: 500;
  line-height: 1;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.button:hover {
  border-color: #b8beca;
  background: #f9fafb;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 7px 18px rgba(7, 11, 53, 0.12);
}

.button.primary:hover {
  border-color: #101754;
  background: #101754;
}

.button.danger {
  border-color: #f2b8b5;
  color: var(--red);
}

.button.small {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 11px;
}

.button.full {
  width: 100%;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card,
.panel,
.lead-card,
.email-card,
.template-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--card-shadow);
}

.metric-card:hover,
.panel:hover,
.lead-card:hover,
.email-card:hover,
.template-card:hover {
  border-color: #dbe1eb;
}

.metric-card {
  min-height: 106px;
  padding: 17px 18px;
  overflow: hidden;
  position: relative;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: currentColor;
  opacity: 0.18;
}

.metric-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.metric-label {
  color: #73798b;
  font-size: 14px;
  font-weight: 400;
}

.metric-value {
  margin-top: 12px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.metric-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.metric-note span {
  color: var(--green);
  font-weight: 500;
}

.sparkline {
  width: 116px;
  height: 48px;
  flex: 0 0 auto;
  color: #7b86f7;
}

.metric-orange .sparkline {
  color: #f59f00;
}

.metric-blue .sparkline {
  color: #1aa7ec;
}

.metric-green .sparkline {
  color: #2ca66f;
}

.metric-purple .sparkline {
  color: #7b86f7;
}

.queue-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.queue-summary-card {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.queue-summary-card:hover {
  border-color: #d7ddf1;
  background: #fbfcff;
}

.queue-summary-card span {
  min-width: 0;
  color: #5f6675;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-summary-card strong {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #4b63d8;
  font-size: 13px;
  font-weight: 600;
}

.queue-summary-card.is-empty {
  color: var(--muted);
  background: #fbfcfd;
}

.queue-summary-card.is-empty strong {
  background: #edf0f3;
  color: #777d8e;
}

.focus-list {
  display: grid;
}

.focus-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.4fr) auto minmax(220px, auto);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #f0f1f4;
  padding: 11px 16px;
}

.focus-row:last-child {
  border-bottom: 0;
}

.focus-row:hover {
  background: var(--surface);
}

.joined-row {
  grid-template-columns: minmax(180px, 1fr) auto minmax(220px, 1fr) auto;
}

.call-board,
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
}

.call-card,
.team-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.call-card-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.command-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 16px;
}

.command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.command-title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.command-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel {
  margin-bottom: 14px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf0f3;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  padding: 12px 16px;
}

.panel-title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 14px 16px;
}

.queue-table {
  display: grid;
}

.queue-head,
.queue-row {
  display: grid;
  grid-template-columns: 1fr 0.85fr 1.6fr 0.9fr 1.05fr 1.65fr;
  gap: 12px;
  align-items: center;
}

.queue-head {
  border-bottom: 1px solid #edf0f3;
  background: #fafbfc;
  color: #232832;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
}

.queue-row {
  min-height: 48px;
  border-bottom: 1px solid #f0f1f4;
  padding: 8px 16px;
  transition: background 0.16s ease;
}

.queue-row:hover {
  background: #fbfcff;
}

.queue-row:last-child {
  border-bottom: 0;
}

.company {
  min-width: 0;
  color: var(--ink);
  font-weight: 500;
}

.contact,
.message,
.muted {
  color: var(--muted);
}

.message {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-directory .queue-head,
.lead-directory .queue-row {
  grid-template-columns: 1fr 0.95fr 0.62fr 0.5fr 0.85fr 1.2fr 1.1fr;
}

.score-pill {
  display: inline-grid;
  width: 36px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: #eef0ff;
  color: #4b63d8;
  font-size: 12px;
  font-weight: 600;
}

.row-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: #eef2ff;
  color: #4c61d8;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
}

.badge.hot,
.badge.overdue,
.badge.needs-reply {
  background: var(--red-bg);
  color: var(--red);
}

.badge.waiting,
.badge.follow-up {
  background: var(--amber-bg);
  color: var(--amber);
}

.badge.joined,
.badge.positive {
  background: var(--green-bg);
  color: var(--green);
}

.badge.info {
  background: var(--blue-soft);
  color: #4b63d8;
}

.badge.reason,
.badge.objection {
  background: var(--purple-bg);
  color: var(--purple);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.search {
  width: min(380px, 100%);
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #727789;
  padding: 7px 10px;
  font-weight: 500;
}

.filter-tab.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
}

.email-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.email-card {
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.email-card:hover,
.email-card.selected {
  border-color: #c7d0ee;
  background: #fbfcff;
}

.email-card:hover {
  transform: translateY(-1px);
}

.email-subject {
  margin: 5px 0;
  color: var(--ink);
  font-weight: 500;
}

.email-preview,
.timeline-text {
  color: #5f6675;
  line-height: 1.42;
}

.email-detail {
  min-height: 420px;
}

.email-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.email-badges,
.lead-tags {
  margin-top: 10px;
}

.linked-lead-summary {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(110px, 0.65fr) minmax(220px, 1.45fr);
  gap: 10px;
  margin: 16px 0;
}

.summary-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  padding: 10px 12px;
}

.summary-cell span,
.action-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.summary-cell strong,
.action-summary strong {
  min-width: 0;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(9, minmax(218px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.kanban-column {
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f5f9;
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.7);
}

.kanban-list {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.lead-card {
  padding: 10px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.lead-card:hover {
  transform: translateY(-1px);
}

.lead-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.lead-card-title {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.card-meta {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  color: #666d7d;
  font-size: 12px;
}

.score-line {
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr);
  gap: 8px;
  align-items: center;
}

.score-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e7ff;
}

.score-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #7b86f7;
}

.lead-detail-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.78fr) minmax(380px, 1.35fr) minmax(300px, 0.92fr);
  gap: 14px;
  align-items: start;
}

.lead-profile {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #f0f1f4;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.lead-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}

.lead-fields {
  gap: 8px;
}

.field-list {
  display: grid;
  gap: 9px;
}

.field {
  min-width: 0;
  border-bottom: 1px solid #f0f1f4;
  padding-bottom: 8px;
}

.field:last-child {
  border-bottom: 0;
}

.field label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.field div {
  margin-top: 3px;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.timeline {
  display: grid;
  gap: 9px;
}

.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: #d7ddff;
}

.timeline-top {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.collapsed {
  background: #fafbfc;
}

.action-panel {
  position: sticky;
  top: 86px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.action-grid-spaced {
  margin-top: 14px;
}

.action-summary {
  display: grid;
  gap: 8px;
}

.action-summary > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  padding: 10px 12px;
}

.form-block {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.select {
  height: 34px;
  padding: 0 9px;
}

.textarea {
  min-height: 80px;
  padding: 8px;
  resize: vertical;
}

.tasks-grid,
.templates-grid,
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.task-item:hover {
  border-color: #d7ddf1;
  background: #fbfcff;
}

.task-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.template-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.template-card:hover {
  transform: translateY(-1px);
}

.template-top {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.template-title {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.chart-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 46px;
  gap: 9px;
  align-items: center;
  margin: 10px 0;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e8ff;
}

.bar {
  height: 100%;
  border-radius: inherit;
  background: #7b86f7;
}

.bar.warning {
  background: #f59f00;
}

.bar.good {
  background: #2ca66f;
}

.funnel {
  display: grid;
  gap: 9px;
}

.funnel-step {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) 46px;
  gap: 9px;
  align-items: center;
}

.funnel-block {
  height: 28px;
  border-radius: 6px;
  background: #7b86f7;
}

.span-2 {
  grid-column: span 2;
}

.analytics-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #f0f1f4;
  padding: 8px 0;
}

.analytics-row:last-child {
  border-bottom: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.member-row {
  min-height: 52px;
}

.switch {
  width: 40px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: #ccd1dc;
  padding: 3px;
  transition: background 0.16s ease;
}

.switch::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin-left: 0;
  border-radius: 999px;
  background: #fff;
  transition: margin-left 0.16s ease;
}

.switch.active {
  background: var(--blue);
}

.switch.active::before {
  margin-left: 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(8, 11, 42, 0.52);
  padding: 18px;
}

.modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(8, 11, 42, 0.16);
}

.modal-header,
.modal-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
}

.modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal-body {
  padding: 14px 16px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-card {
  display: flex;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}

#toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: min(320px, calc(100vw - 32px));
  border: 1px solid #d4d9f8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(8, 11, 42, 0.12);
  padding: 10px 12px;
  font-weight: 500;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

  .brand {
    padding: 0 8px 12px;
  }

  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-section {
    display: none;
  }

  .nav-button {
    flex: 0 0 auto;
    min-width: 132px;
  }

  .sidebar-footer {
    display: none;
  }

  .metric-grid,
  .tasks-grid,
  .templates-grid,
  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .queue-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .call-board,
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .queue-head {
    display: none;
  }

  .queue-row,
  .lead-directory .queue-row,
  .focus-row,
  .joined-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .lead-detail-layout,
  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .linked-lead-summary {
    grid-template-columns: 1fr;
  }

  .action-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 14px;
  }

  .content {
    padding: 14px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .nav {
    margin-right: -12px;
    padding-right: 12px;
  }

  .metric-grid,
  .queue-summary,
  .call-board,
  .team-grid,
  .tasks-grid,
  .templates-grid,
  .analytics-grid,
  .settings-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .command-strip {
    grid-template-columns: 1fr;
  }

  .command-actions {
    justify-content: flex-start;
  }

  .lead-profile {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .lead-profile .score-pill {
    grid-column: 1 / -1;
    width: 100%;
  }

  .analytics-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
