:root {
  --bg: #eef4ec;
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255,255,255,0.92);
  --bg-input: #f4f8f2;
  --border: rgba(24,78,46,0.10);
  --border-green: rgba(34,150,80,0.25);
  --text: #122119;
  --text-muted: #456252;
  --text-dim: #7a9b8a;
  --green: #1d7c4b;
  --green-light: #22994d;
  --green-glow: rgba(29,124,75,0.10);
  --brand-1: #205b38;
  --brand-2: #2f8b57;
  --brand-3: #89c89e;
  --red: #d63a3a;
  --yellow: #c4880c;
  --shadow: 0 4px 16px rgba(18,56,35,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 12px 28px rgba(18,56,35,0.12);
  --shadow-lg: 0 18px 45px rgba(18,56,35,0.14);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.15;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ================ ANIMATIONS ================ */

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes stagger-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(29,124,75,0.15); }
  50% { box-shadow: 0 0 0 6px rgba(29,124,75,0.06); }
}

/* ================ LAYOUT ================ */

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ================ SIDEBAR ================ */

.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 12px rgba(18,56,35,0.04);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 24px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(32,91,56,0.3);
}

.brand-text { line-height: 1.2; }

.brand-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 150ms, color 150ms, transform 100ms;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(29,124,75,0.06);
  color: var(--text);
  text-decoration: none;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(29,124,75,0.10), rgba(47,139,87,0.06));
  color: var(--green);
  box-shadow: 0 1px 4px rgba(29,124,75,0.08);
}

.nav-icon {
  flex-shrink: 0;
  opacity: 0.55;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-bottom {
  padding: 16px 12px 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d1eddb, #b7ebc9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: var(--brand-1);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(29,124,75,0.15);
}

.user-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.user-email {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* ================ MAIN AREA ================ */

.main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 15% 10%, rgba(209,237,219,0.5) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(207,231,209,0.4) 0%, transparent 40%),
    linear-gradient(165deg, #f7fbf5 0%, #eef4ec 40%, #e3efdf 100%);
  position: relative;
}

.main::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(24,78,46,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24,78,46,0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  pointer-events: none;
  z-index: 0;
}

.main > * {
  position: relative;
  z-index: 1;
}

/* ================ TOPBAR ================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.topbar p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.85);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms, color 150ms, box-shadow 200ms, transform 100ms;
}

.btn-outline:hover {
  border-color: var(--brand-3);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 200ms, transform 100ms;
  box-shadow: 0 4px 14px rgba(32,91,56,0.3);
  background-size: 200% auto;
}

.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(32,91,56,0.35);
  transform: translateY(-1px);
  animation: shimmer 2s linear infinite;
  background-image: linear-gradient(135deg, var(--brand-1), var(--brand-2), var(--brand-3), var(--brand-2), var(--brand-1));
  background-size: 300% auto;
}

.btn-ghost {
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 120ms;
}

.btn-ghost:hover { background: rgba(29,124,75,0.06); }

.btn-tip {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border-green);
  border-radius: 8px;
  background: transparent;
  color: var(--green);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms, box-shadow 200ms, transform 100ms;
}

.btn-tip:hover {
  background: rgba(29,124,75,0.08);
  box-shadow: 0 4px 12px rgba(29,124,75,0.12);
  transform: translateY(-1px);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid rgba(214,58,58,0.3);
  border-radius: 8px;
  background: rgba(254,242,242,0.8);
  color: var(--red);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms, box-shadow 150ms;
}

.btn-danger:hover {
  background: #fef2f2;
  box-shadow: 0 2px 8px rgba(214,58,58,0.15);
}

.full-width { width: 100%; }

/* ================ VIEWS ================ */

.view {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  animation: fade-in 250ms ease-out;
}

/* ================ DASHBOARD GRID ================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.main-col { display: flex; flex-direction: column; gap: 20px; }
.side-col { display: flex; flex-direction: column; gap: 20px; }

/* ================ STAT CARDS ================ */

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand-2);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 200ms, box-shadow 200ms;
  animation: stagger-in 400ms ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 60ms; }
.stat-card:nth-child(3) { animation-delay: 120ms; }
.stat-card:nth-child(4) { animation-delay: 180ms; }

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-label svg { color: var(--green); opacity: 0.6; }

.stat-value {
  font-family: "Fraunces", Georgia, serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-value.green { color: var(--green); }

.stat-change {
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
  margin-top: 6px;
}

.stat-change.down { color: var(--red); }

/* ================ CARDS ================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 200ms, box-shadow 200ms;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header a {
  font-size: 13px;
  font-weight: 600;
}

/* ================ TABLE ================ */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table tr:hover td { background: rgba(29,124,75,0.03); }

.table .lead-name {
  font-weight: 700;
  color: var(--text);
}

.table .lead-phone {
  font-size: 12px;
  color: var(--text-dim);
}

.table .clickable-row { cursor: pointer; }

/* ================ STATUS TAGS ================ */

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.tag-unreached {
  color: #92610a;
  background: #fef7e6;
  border: 1px solid #f5dfaa;
}

.tag-engaged {
  color: #166534;
  background: #ecfdf3;
  border: 1px solid #b7ebc9;
}

.tag-no_response, .tag-no-response {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #f5c5c5;
}

.tag-sms {
  color: #1e5f99;
  background: #eff6ff;
  border: 1px solid #b6d4f0;
}

/* ================ SIMULATE CARD ================ */

.simulate-card {
  border-top: 3px solid var(--brand-2);
}

.simulate-card h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.simulate-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.sim-form {
  display: flex;
  gap: 10px;
}

.sim-form input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

.sim-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,124,75,0.1);
}

.sim-form input::placeholder { color: var(--text-dim); }

/* ================ LIVE FEED ================ */

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(29,124,75,0.15);
  animation: pulse-dot 2s ease-in-out infinite;
}

.feed-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.feed-item:last-child { border-bottom: none; }

.feed-event-type {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.feed-event-detail {
  font-size: 12px;
  color: var(--text-dim);
}

.feed-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.feed-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 24px 0;
}

/* ================ TIP CARD ================ */

.tip-card {
  background: linear-gradient(135deg, rgba(209,237,219,0.7), rgba(183,235,201,0.4));
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 16px rgba(29,124,75,0.1);
  transition: transform 200ms, box-shadow 200ms;
}

.tip-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(29,124,75,0.15);
}

.tip-card h3 {
  font-size: 14px;
  color: var(--brand-1);
  margin-bottom: 6px;
}

.tip-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ================ LEADS VIEW ================ */

#lead-search {
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  width: 260px;
  transition: border-color 150ms, box-shadow 150ms;
}

#lead-search:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,124,75,0.1);
}
#lead-search::placeholder { color: var(--text-dim); }

.stage-select {
  padding: 5px 8px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.stage-select:focus { border-color: var(--green); }

/* ================ AUTOMATIONS VIEW ================ */

.automations-layout {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auto-section-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.auto-section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Follow-up timeline */
.followup-timeline {
  position: relative;
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.followup-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand-3));
  border-radius: 2px;
}

.timeline-step {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: transform 200ms, box-shadow 200ms;
  animation: stagger-in 400ms ease-out both;
}

.timeline-step:nth-child(1) { animation-delay: 0ms; }
.timeline-step:nth-child(2) { animation-delay: 80ms; }
.timeline-step:nth-child(3) { animation-delay: 160ms; }
.timeline-step:nth-child(4) { animation-delay: 240ms; }

.timeline-step:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.timeline-step::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand-2);
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(47,139,87,0.2);
}

.timeline-step.disabled::before {
  background: var(--text-dim);
  box-shadow: 0 0 0 3px rgba(122,155,138,0.15);
}

.step-info {
  flex: 1;
}

.step-timing {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-2);
  margin-bottom: 2px;
}

.timeline-step.disabled .step-timing {
  color: var(--text-dim);
}

.step-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.step-preview {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Automation toggle cards */
.auto-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.auto-toggle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform 200ms, box-shadow 200ms;
  animation: stagger-in 400ms ease-out both;
}

.auto-toggle-card:nth-child(1) { animation-delay: 50ms; }
.auto-toggle-card:nth-child(2) { animation-delay: 100ms; }
.auto-toggle-card:nth-child(3) { animation-delay: 150ms; }
.auto-toggle-card:nth-child(4) { animation-delay: 200ms; }

.auto-toggle-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.auto-toggle-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auto-toggle-icon.green { background: linear-gradient(135deg, #e8f5ee, #d1eddb); color: var(--green); }
.auto-toggle-icon.blue { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; }
.auto-toggle-icon.orange { background: linear-gradient(135deg, #fff7ed, #ffedd5); color: #c2410c; }
.auto-toggle-icon.purple { background: linear-gradient(135deg, #f5f3ff, #ede9fe); color: #7c3aed; }

.auto-toggle-body { flex: 1; }

.auto-toggle-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.auto-toggle-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 10px;
}

/* ================ CAMPAIGNS VIEW ================ */

.campaigns-layout {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.campaigns-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.campaigns-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: transform 200ms, box-shadow 200ms;
  animation: stagger-in 400ms ease-out both;
}

.campaign-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.campaign-info { flex: 1; }

.campaign-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.campaign-meta {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
}

.campaign-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.campaigns-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.campaigns-empty svg { margin-bottom: 12px; opacity: 0.5; }

.campaigns-empty h3 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 6px;
}

.campaigns-empty p {
  font-size: 13px;
  max-width: 36ch;
  margin: 0 auto;
}

/* Campaign modal form */
.campaign-form { display: flex; flex-direction: column; gap: 14px; }

.campaign-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.campaign-form input,
.campaign-form textarea,
.campaign-form select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

.campaign-form input:focus,
.campaign-form textarea:focus,
.campaign-form select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,124,75,0.1);
}

.campaign-form textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* ================ SETTINGS ================ */

.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 200ms, box-shadow 200ms;
}

.settings-section:hover {
  box-shadow: var(--shadow-md);
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(29,124,75,0.04), transparent);
}

.settings-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-section-icon.green {
  background: linear-gradient(135deg, #e8f5ee, #d1eddb);
  color: var(--green);
}

.settings-section-icon.blue {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #2563eb;
}

.settings-section-icon.orange {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #c2410c;
}

.settings-section-icon.purple {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  color: #7c3aed;
}

.settings-section-icon.red {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #dc2626;
}

.settings-section-icon.teal {
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  color: #0d9488;
}

.settings-section-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: "Fraunces", Georgia, serif;
}

.settings-section-header p {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 1px;
}

.settings-section-body {
  padding: 4px 0;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 120ms;
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row:hover {
  background: rgba(29,124,75,0.02);
}

.setting-label {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.setting-label-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
}

.setting-value {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: right;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-value.accent {
  color: var(--green);
  font-weight: 700;
}

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.active {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #b7ebc9;
}

.status-pill.inactive {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #f5c5c5;
}

.status-pill.pending {
  background: #fef7e6;
  color: #92610a;
  border: 1px solid #f5dfaa;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Toggle switches */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  background: #c6d4cc;
  border-radius: 12px;
  cursor: pointer;
  transition: background 200ms;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.toggle-switch.on {
  background: var(--green);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 200ms;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch.on::after {
  transform: translateX(18px);
}

/* Template preview */
.template-preview {
  margin: 0 20px 16px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  position: relative;
}

.template-preview::before {
  content: 'Preview';
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* Plan badge */
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #d1eddb, #b7ebc9);
  border: 1px solid var(--border-green);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-1);
  box-shadow: 0 2px 8px rgba(29,124,75,0.12);
}

.plan-badge svg { flex-shrink: 0; }

/* Editable settings inputs */
.setting-row.editable {
  display: flex;
  align-items: center;
  gap: 16px;
}

.setting-row.editable label {
  flex-shrink: 0;
  min-width: 160px;
}

.setting-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

.setting-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,124,75,0.1);
}

.setting-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 150ms, box-shadow 150ms;
}

.setting-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,124,75,0.1);
}

.template-row {
  flex-direction: column;
  align-items: flex-start !important;
  gap: 6px;
}

.template-hint {
  padding: 8px 20px 4px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

.save-row {
  padding: 12px 20px 16px;
  border-bottom: none !important;
  justify-content: flex-end;
}

.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 200ms, transform 100ms;
  box-shadow: 0 4px 14px rgba(32,91,56,0.25);
}

.btn-save:hover {
  box-shadow: 0 6px 20px rgba(32,91,56,0.3);
  transform: translateY(-1px);
}

.btn-save:active {
  transform: scale(0.97);
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-save.saved {
  background: #166534;
}

/* Settings responsive */
@media (max-width: 600px) {
  .setting-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .setting-row.editable label { min-width: auto; }
  .setting-value { text-align: left; max-width: 100%; }
  .toggle-row { gap: 12px; }
}

/* ================ MODAL ================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18,33,25,0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 150ms ease-out;
}

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  padding: 28px;
  animation: stagger-in 250ms ease-out;
}

.modal.modal-wide {
  max-width: 680px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 120ms, background 120ms;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(29,124,75,0.06);
}

/* Modal header */
.modal-header {
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.modal-header p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Modal lead detail */
.lead-detail-header {
  margin-bottom: 20px;
}

.lead-detail-header h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.lead-detail-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.lead-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.meta-item { font-size: 12px; }

.meta-label {
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
}

.meta-value {
  color: var(--text);
  font-weight: 600;
  margin-top: 2px;
}

.conversation-header {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.convo-msg {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 85%;
}

.convo-outbound {
  background: #ecfdf3;
  border: 1px solid #b7ebc9;
  color: var(--text);
  align-self: flex-end;
  margin-left: auto;
}

.convo-inbound {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  align-self: flex-start;
}

.convo-time {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
}

.convo-direction {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.convo-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 20px 0;
}

/* ================ SUPPORT FORM ================ */

.support-form { display: flex; flex-direction: column; gap: 14px; }

.support-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.support-form input,
.support-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

.support-form input:focus,
.support-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,124,75,0.1);
}

.support-form textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

.support-success {
  text-align: center;
  padding: 20px 0;
}

.support-success svg { margin-bottom: 12px; }

.support-success h3 {
  font-size: 16px;
  color: var(--green);
  margin-bottom: 6px;
}

.support-success p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ================ LOGIN SCREEN ================ */

.login-screen {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(209,237,219,0.6) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(183,235,201,0.4) 0%, transparent 50%),
    linear-gradient(165deg, #f7fbf5 0%, #eef4ec 40%, #e3efdf 100%);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(24,78,46,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24,78,46,0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  position: relative;
  animation: stagger-in 400ms ease-out;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-input);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.login-field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,101,52,0.12);
}

/* ================ ALERT BANNER ================ */

.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  margin: 0 24px 0;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}

.alert-banner a { font-weight: 600; text-decoration: underline; }

.alert-warning {
  background: #fef9e7;
  border: 1px solid #f0d060;
  color: #7a6200;
}

.alert-warning svg { stroke: #b8960a; flex-shrink: 0; }

.alert-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #b8960a;
  padding: 0 4px;
  line-height: 1;
}

/* ================ ONBOARDING CHECKLIST ================ */

.checklist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.checklist-header h3 {
  font-size: 16px;
  margin: 0;
}

.checklist-progress-text {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

.checklist-progress-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}

.checklist-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.checklist-items { display: flex; flex-direction: column; gap: 10px; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.checklist-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.checklist-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.checklist-item.done .checklist-label { color: var(--text-dim); text-decoration: line-through; }

.checklist-label { font-size: 14px; font-weight: 500; }

.checklist-action {
  margin-left: auto;
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
  white-space: nowrap;
}

.checklist-complete {
  text-align: center;
  padding: 12px;
  color: var(--brand-2);
  font-weight: 600;
  font-size: 14px;
}

/* ================ GUARANTEE BADGE ================ */

.guarantee-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  background: linear-gradient(135deg, #f0faf5, #d4edda);
  color: var(--brand-1);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ================ RESPONSIVE ================ */

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .auto-toggles { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
  }
  .view { padding: 16px 20px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .sim-form { flex-direction: column; }
  .sim-form .btn-accent { width: 100%; justify-content: center; }
  .auto-toggles { grid-template-columns: 1fr; }
}
