:root {
  color-scheme: dark;
  --bg-app: #0f1117;
  --bg-sidebar: #11141b;
  --bg-surface: #151821;
  --bg-card: #181c26;
  --bg-elevated: #202532;
  --topbar-bg: rgba(15, 17, 23, 0.92);
  --border: #272d3a;
  --border-bright: #343b4d;
  --text-primary: #f4f7fb;
  --text-secondary: #b8c0d0;
  --text-muted: #7e889c;
  --accent: #00c97f;
  --accent-soft: rgba(0, 201, 127, 0.12);
  --blue: #4f8cff;
  --amber: #f6b44b;
  --red: #ef6461;
  --danger: var(--red);
  --purple: #9b7bff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg-app: #eef2f7;
  --bg-sidebar: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --topbar-bg: rgba(248, 250, 252, 0.92);
  --border: #dbe2ec;
  --border-bright: #c7d0dd;
  --text-primary: #111827;
  --text-secondary: #475569;
  --text-muted: #718096;
  --accent: #00a86b;
  --accent-soft: rgba(0, 168, 107, 0.12);
  --blue: #2563eb;
  --amber: #c47a18;
  --red: #dc2626;
  --danger: var(--red);
  --purple: #7c3aed;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 8px 18px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #07100d;
  font-weight: 800;
}

.brand-logo {
  width: 86px;
  max-height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  font-size: 14px;
  line-height: 1.15;
}

.brand span,
.sidebar-footer p,
.eyebrow,
.muted {
  color: var(--text-muted);
}

.brand span {
  font-size: 11px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-primary);
}

.connection-pill span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 201, 127, 0.1);
}

.sidebar-footer p {
  margin: 8px 0 0;
  font-size: 11px;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-field {
  width: min(320px, 34vw);
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-muted);
}

.search-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
}

.lead-list-search {
  width: min(420px, 100%);
  margin-bottom: 4px;
}

.icon-button,
.theme-toggle,
.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-button {
  width: 38px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.theme-toggle {
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.primary-button {
  padding: 0 14px;
  background: var(--accent);
  color: #06110d;
  font-size: 13px;
  font-weight: 700;
}

.secondary-button {
  padding: 0 13px;
  border: 1px solid var(--border-bright);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
}

.ghost-button {
  padding: 0 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
}

.icon-button:hover,
.theme-toggle:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  opacity: 0.86;
}

.view-root {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 24px 36px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
}

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

.metric-card,
.panel,
.list-card,
.lead-list-card,
.chip-card,
.warmup-card,
.source-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.01);
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 94px;
  padding: 16px;
}

.metric-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}

.metric-card p,
.section-title p,
.campaign-meta,
.table-note,
.form-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
  line-height: 1;
}

.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.panel {
  overflow: hidden;
}

.lead-search-section {
  overflow: visible;
}

.panel-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.section-title h2 {
  margin: 0;
  font-size: 15px;
}

.panel-body {
  padding: 16px;
}

.dense-list {
  display: flex;
  flex-direction: column;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px 120px 120px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

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

.campaign-row {
  grid-template-columns: 30px minmax(220px, 1fr) 120px minmax(110px, 0.6fr) 120px 92px;
}

.list-row.selected,
tr.selected,
.lead-list-card.selected,
.chip-card.selected,
.warmup-card.selected,
.source-card.selected {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 201, 127, 0.28);
}

.row-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.row-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.row-title span {
  color: var(--text-muted);
  font-size: 11px;
}

.panel-actions,
.item-actions,
.card-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-action-row {
  justify-content: space-between;
  padding-top: 2px;
}

.item-actions {
  justify-content: flex-end;
}

.action-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.action-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.action-icon.danger:hover,
.danger-text {
  color: var(--red);
}

.row-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.selection-bar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
}

.selection-bar strong {
  color: var(--text-primary);
  font-size: 13px;
}

.selection-bar > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(620px, calc(100vh - 330px));
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 16px;
}

.lead-list-card {
  overflow: hidden;
}

.lead-list-summary {
  display: grid;
  grid-template-columns: 28px minmax(260px, 1fr) minmax(160px, 0.35fr) 92px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.lead-list-trigger {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.lead-list-trigger strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.lead-list-trigger small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.chevron {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  transition: transform 0.16s ease, color 0.16s ease;
}

.chevron.open {
  transform: rotate(180deg);
  color: var(--accent);
}

.lead-list-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.lead-list-meta span:first-child {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.lead-list-meta .sync-ok {
  color: var(--accent);
  font-weight: 700;
}

.lead-list-meta .sync-error {
  color: var(--danger);
  font-weight: 700;
}

.lead-list-meta .sync-pending {
  color: var(--text-muted);
}

.flow-sync-button {
  width: fit-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-primary);
  padding: 0 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.flow-sync-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.flow-sync-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.flow-sync-button svg {
  width: 14px;
  height: 14px;
}

.lead-list-dropdown {
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.compact-table {
  border-radius: 0;
}

.compact-table table {
  min-width: 860px;
}

.table-empty-state {
  padding: 20px;
  color: var(--text-muted);
  text-align: center;
}

.status-pill,
.source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status-running {
  background: rgba(0, 201, 127, 0.12);
  color: var(--accent);
}

.status-paused {
  background: rgba(246, 180, 75, 0.13);
  color: var(--amber);
}

.status-draft {
  background: rgba(126, 136, 156, 0.15);
  color: var(--text-secondary);
}

.status-error {
  background: rgba(239, 100, 97, 0.14);
  color: var(--red);
}

.source-pill {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-elevated);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.strip-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
}

.strip-item span {
  color: var(--text-muted);
  font-size: 11px;
}

.strip-item strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.chart {
  height: 198px;
  display: flex;
  align-items: end;
  gap: 9px;
  padding: 12px 4px 0;
}

.bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 10px;
}

.bar span:first-child {
  width: 100%;
  min-height: 12px;
  border-radius: 5px 5px 2px 2px;
  background: var(--accent);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
}

.filter-chip.active {
  border-color: rgba(0, 201, 127, 0.38);
  background: var(--accent-soft);
  color: var(--accent);
}

.table-wrap {
  overflow: auto;
}

.import-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid rgba(0, 201, 127, 0.24);
  border-radius: 12px;
  background: var(--accent-soft);
}

.import-alert.error {
  border-color: rgba(239, 100, 97, 0.28);
  background: rgba(239, 100, 97, 0.1);
}

.import-alert .metric-icon {
  width: 34px;
  height: 34px;
}

.import-alert h2 {
  margin: 0;
  font-size: 14px;
}

.import-alert p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.import-alert code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 11px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12px;
}

th {
  color: var(--text-muted);
  font-weight: 600;
}

td {
  color: var(--text-secondary);
}

td strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
}

.rating {
  color: var(--amber);
  font-weight: 700;
}

.campaign-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.6fr);
  gap: 16px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 9px 10px;
  resize: vertical;
}

.field input[readonly] {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.field textarea {
  min-height: 138px;
}

.lead-search-panel {
  display: grid;
  gap: 14px;
}

.search-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.category-field,
.combo-field {
  position: relative;
}

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

.category-dropdown,
.combo-dropdown {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  z-index: 25;
  display: none;
  max-height: 292px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow);
}

.category-field.open .category-dropdown,
.combo-field.open .combo-dropdown {
  display: grid;
  gap: 4px;
}

.combo-option,
.category-option {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.combo-option:hover,
.combo-option:focus,
.category-option:hover,
.category-option:focus {
  background: var(--accent-soft);
  outline: none;
}

.combo-option strong,
.category-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.combo-option span,
.category-option span,
.combo-empty,
.category-empty {
  color: var(--text-muted);
  font-size: 11px;
}

.combo-empty,
.category-empty {
  padding: 10px;
}

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

.search-actions button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.message-variant {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
}

.message-variant + .message-variant {
  margin-top: 10px;
}

.message-variant strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.message-variant p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.chip-grid,
.warmup-grid,
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.chip-card,
.warmup-card,
.source-card {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chip-card header,
.warmup-card header,
.source-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.chip-card h3,
.warmup-card h3,
.source-card h3 {
  margin: 0;
  font-size: 14px;
}

.chip-card p,
.warmup-card p,
.source-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.card-title-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.card-title-line > div {
  min-width: 0;
}

.chip-card .stat-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.warmup-card .stat-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.warming-steps {
  display: grid;
  grid-template-columns: repeat(14, minmax(20px, 1fr));
  gap: 5px;
}

.warm-day {
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 10px;
}

.warm-day.done {
  background: rgba(0, 201, 127, 0.16);
  color: var(--accent);
}

.warm-day.current {
  background: rgba(246, 180, 75, 0.18);
  color: var(--amber);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.56);
}

.campaign-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
}

.modal-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0 24px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.modal-steps span {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.modal-steps .nav-icon {
  width: 14px;
  height: 14px;
}

.modal-steps .active {
  color: var(--accent);
}

.modal-body {
  overflow: auto;
  padding: 22px 24px;
}

.modal-label {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
}

.modal-tabs button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.modal-tabs button:last-child {
  border-right: 0;
}

.modal-tabs button.active {
  background: var(--accent);
  color: #04120d;
}

.modal-list-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-list-option {
  min-height: 48px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  cursor: pointer;
}

.modal-list-option strong,
.modal-list-option small {
  display: block;
}

.modal-list-option small,
.modal-list-option em,
.modal-empty-state p,
.modal-import-panel p {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
}

.modal-import-panel,
.modal-empty-state {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
}

.modal-import-panel h3,
.modal-empty-state h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.modal-import-panel p,
.modal-empty-state p {
  margin: 0;
  line-height: 1.5;
}

.modal-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.empty-state {
  padding: 34px;
  text-align: center;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid rgba(0, 201, 127, 0.25);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow);
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
  font-size: 13px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.hide {
  display: none !important;
}

@media (max-width: 1120px) {
  .grid.metrics,
  .grid.three,
  .chip-grid,
  .warmup-grid,
  .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.two,
  .campaign-builder,
  .search-grid {
    grid-template-columns: 1fr;
  }

  .category-field {
    grid-column: span 1;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .sidebar-footer {
    display: none;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .toolbar,
  .panel-actions,
  .selection-bar,
  .card-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-bar {
    justify-content: flex-start;
  }

  .search-field {
    width: 100%;
  }

  .grid.metrics,
  .grid.three,
  .chip-grid,
  .warmup-grid,
  .source-grid,
  .field-grid,
  .stat-strip {
    grid-template-columns: 1fr;
  }

  .list-row {
    grid-template-columns: 1fr;
  }

  .lead-list-summary {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .lead-list-meta,
  .lead-list-summary .item-actions {
    grid-column: 2;
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 12px;
  }

  .campaign-modal {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .modal-header,
  .modal-footer,
  .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-steps {
    grid-template-columns: 1fr;
    padding: 0 16px 14px;
  }

  .modal-tabs,
  .modal-list-option {
    grid-template-columns: 1fr;
  }
}
