:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --panel: #fff;
  --sidebar: #171717;
  --text: #202123;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #10a37f;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  color: #fff;
  background: #0f172a;
  border-bottom: 1px solid #273244;
}

.brand {
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand-mark,
.assistant-avatar {
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.user-actions a,
.link-button {
  color: #dbeafe;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: none;
}

.user-actions form {
  margin: 0;
}

.topbar-left,
.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.main-nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  padding: 18px 4px;
}

.main-nav a:hover {
  color: #fff;
}

.workspace {
  height: calc(100vh - 58px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  min-width: 0;
  padding: 14px 10px;
  color: #ececf1;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.new-task-button {
  border: 1px solid #4b5563;
  border-radius: 9px;
  background: transparent;
  color: #fff;
  padding: 12px;
  text-align: left;
}

.new-task-button:hover {
  background: #292929;
}

.task-filter input {
  width: 100%;
  border: 1px solid #444;
  background: #242424;
  color: #fff;
  border-radius: 8px;
  padding: 9px 10px;
  outline: none;
}

.task-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  padding: 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ececf1;
  text-align: left;
}

.task-item:hover,
.task-item.active {
  background: #2a2b32;
}

.task-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a8a8b3;
  font-size: 11px;
}

.conversation {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--panel);
}

.conversation-header {
  min-height: 74px;
  padding: 13px 26px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.conversation-header h1 {
  font-size: 19px;
  margin: 0 0 5px;
}

.conversation-header p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}

.task-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.task-actions button {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 7px 10px;
}

.task-actions button:hover {
  background: #f3f4f6;
}

.task-actions .danger {
  color: var(--danger);
}

.timeline {
  min-height: 0;
  overflow-y: auto;
  padding: 16px max(16px, calc((100% - 780px)/2));
}

.welcome-card {
  min-height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  color: #374151;
}

.welcome-card h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.welcome-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.assistant-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 11px;
}

.assistant-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
}

.assistant-bubble {
  max-width: 760px;
  padding: 4px 0;
  line-height: 1.4;
  font-size: 13px;
}

.assistant-bubble strong {
  display: block;
  font-weight: 500;
}

.assistant-bubble small {
  display: block;
  color: #9ca3af;
  margin-top: 3px;
  font-size: 10px;
}

.assistant-bubble.error {
  color: #b91c1c;
}

.assistant-bubble.warn {
  color: #92400e;
}

.user-bubble {
  width: fit-content;
  max-width: 72%;
  margin: 8px 0 8px auto;
  padding: 8px 12px;
  border-radius: 12px 12px 4px 12px;
  background: #f1f1f1;
  line-height: 1.4;
  font-size: 13px;
}

.lead-card {
  width: min(720px, calc(100% - 10px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .04);
}

.lead-card-head,
.lead-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lead-card h3 {
  margin: 6px 0;
  font-size: 15px;
}

.lead-card dl {
  margin: 0;
  display: grid;
  gap: 6px;
}

.lead-card dl div {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 6px;
  font-size: 12px;
}

.lead-card dt {
  color: var(--muted);
  font-size: 12px;
}

.lead-card dd {
  margin: 0;
}

.lead-card footer {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.lead-card footer a {
  color: #087f5b;
  font-weight: 600;
  text-decoration: none;
}

.source-badge,
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
}

.source-badge {
  color: #075985;
  background: #e0f2fe;
}

.status {
  color: #475569;
  background: #e2e8f0;
}

.status-running {
  color: #1d4ed8;
  background: #dbeafe;
}

.status-succeeded,
.status-complete {
  color: #047857;
  background: #d1fae5;
}

.status-partialsucceeded,
.status-partial {
  color: #9a3412;
  background: #ffedd5;
}

.status-failed,
.status-blocked {
  color: #b91c1c;
  background: #fee2e2;
}

.status-paused,
.status-cancelled {
  color: #52525b;
  background: #e4e4e7;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 14px max(24px, calc((100% - 850px)/2));
  background: #fff;
}

.composer:not(.search-planning) form {
  border: 1px solid #cbd5e1;
  border-radius: 15px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
  padding: 8px 12px;
}

.composer:not(.search-planning) input[name=keyword] {
  width: 100%;
  padding: 9px 4px;
  border: 0;
  outline: none;
  font-size: 15px;
}

.composer-options {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: #4b5563;
  font-size: 12px;
}

.composer-options label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.number-input {
  width: 56px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px;
}

.number-input.wide {
  width: 72px;
}

.composer-options button,
.auth-card button {
  margin-left: auto;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
  padding: 9px 15px;
  font-weight: 700;
}

.form-error {
  color: #b91c1c;
  font-size: 13px;
  margin-top: 6px;
}

.empty-state {
  color: #9ca3af;
  padding: 18px;
  text-align: center;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef2ff, #ecfdf5);
}

.inline-auth {
  min-height: calc(100vh - 58px);
}

.auth-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px;
  border: 1px solid #dbe2ea;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(15, 23, 42, .12);
}

.auth-brand {
  color: #111827;
  margin-bottom: 6px;
}

.auth-card h1 {
  margin: 0;
  font-size: 24px;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.auth-card input {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
}

.auth-card .checkbox-row {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
}

.auth-card button {
  margin: 4px 0 0;
}

/* ═══════════════════════════════════════════════════════════════
   Search & Care — Right Panels
   Design tokens: Inter 13px base, slate palette, indigo-600 accent
   Spacing rhythm: 20px > 16px > 12px > 8px > 4px
   ═══════════════════════════════════════════════════════════════ */

/* --- Search page layout -------------------------------------------------- */
.search-workspace {
  height: 100%;
  overflow: hidden;
  display: grid !important;
  grid-template-rows: auto 1fr !important;
}

.search-body {
  display: grid;
  grid-template-columns: 1fr 330px;
  min-height: 0;
  overflow: hidden;
}

/* --- Search right panel -------------------------------------------------- */
.search-planning {
  border-left: 1px solid #e2e8f0;
  border-top: 0;
  background: #f8fafc;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.search-planning form {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-config-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.search-config-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(79, 70, 229, .1);
}

.search-config-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.search-config-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: #64748b;
}

/* Keyword input field */
.keyword-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}

.required-star {
  color: #ef4444;
}

.keyword-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.keyword-input-wrap .input-icon {
  position: absolute;
  left: 11px;
  color: #94a3b8;
  pointer-events: none;
}

.keyword-input-wrap input {
  width: 100% !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 9px !important;
  padding: 9px 12px 9px 34px !important;
  font-size: 13px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
  transition: all .15s ease;
}

.keyword-input-wrap input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15) !important;
}

/* Planning option cards */
.planning-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .03);
  transition: border-color .15s, box-shadow .15s;
}

.option-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .05);
}

.option-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #4f46e5;
}

.option-title svg {
  flex-shrink: 0;
}

.option-title strong {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Custom Checkboxes */
.checkbox-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.checkbox-options.mb-2 {
  margin-bottom: 2px;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  display: none;
}

.checkbox-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  transition: all .15s ease;
}

.custom-checkbox input[type="checkbox"]:checked+.checkbox-badge {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
  font-weight: 600;
}

.custom-checkbox:hover .checkbox-badge {
  border-color: #cbd5e1;
}

/* Input with Suffix / Units */
.input-with-suffix {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.input-with-suffix label {
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
}

.number-input-unit {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}

.number-input-unit:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.number-input {
  width: 52px;
  border: 0;
  padding: 5px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  background: transparent;
  outline: none;
  text-align: center;
}

.number-input.wide {
  width: 64px;
}

.unit-tag {
  padding: 5px 9px 5px 2px;
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
  background: transparent;
  user-select: none;
}

/* Delay inputs */
.delay-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Run Search Button */
.btn-run-search {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  box-shadow: 0 3px 10px rgba(79, 70, 229, .25);
  transition: all .18s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-run-search:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
  transform: translateY(-1px);
}

.btn-run-search:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(79, 70, 229, .2);
}

/* --- Care page grid ------------------------------------------------------ */
.care-shell {
  --care-accent: #4f46e5;
  --care-soft: #eef2ff;
  height: calc(100vh - 58px);
  display: grid;
  grid-template-columns: 68px 300px minmax(340px, 1fr) 400px;
  position: relative;
  background: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.care-shell.crm-shell {
  grid-template-columns: 68px 360px minmax(340px, 1fr);
}

.crm-detail-panel {
  padding: 24px;
  overflow-y: auto;
  background: #fff;
}


/* --- Left Icon Sidebar (Pancake Style) ----------------------------------- */
.care-stage-sidebar {
  width: 68px;
  background: #1e293b;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 10px;
  border-right: 1px solid #334155;
  user-select: none;
}

.sidebar-brand {
  color: #38bdf8;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 0 4px;
  flex: 1;
}

.sidebar-item {
  background: transparent;
  border: none;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.sidebar-item.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.sidebar-item .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.sidebar-item .icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
}

.sidebar-item:hover .icon svg {
  transform: scale(1.1);
}

.sidebar-item .label {
  font-size: 9.5px;
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.sidebar-bottom {
  padding: 0 4px;
  width: 100%;
}

.care-shell button,
.care-shell input,
.care-shell select,
.care-shell textarea {
  font: inherit;
}

/* --- Left list panel ----------------------------------------------------- */
.care-list-panel,
.care-profile-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.care-list-panel {
  border-right: 1px solid #e5e7eb;
  height: 100%;
  overflow: hidden;
}

.care-list-header {
  padding: 18px 16px 14px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.care-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.care-panel-title span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.care-panel-title h2 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #0f172a;
}

.care-panel-title b {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  color: #4f46e5;
  background: #e0e7ff;
  font-size: 12px;
  font-weight: 700;
}

.care-search-wrap {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
}

.care-search-wrap span {
  color: #94a3b8;
  font-size: 18px;
}

.care-search-wrap input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: #1e293b;
}

.care-list-header select {
  width: 100%;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  padding: 0 10px;
  color: #1e293b;
  font-size: 13px;
}

/* --- Lead list items ----------------------------------------------------- */
.care-lead-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.care-lead-item {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  text-align: left;
  transition: background .12s;
}

.care-lead-item:hover {
  background: #f9fafb;
}

.care-lead-item.active {
  background: var(--care-soft);
  box-shadow: inset 3px 0 var(--care-accent);
}

.care-lead-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #4f46e5;
  background: linear-gradient(145deg, #e0e7ff, #dbeafe);
  font-size: 14px;
  font-weight: 700;
}

.care-lead-avatar.large {
  width: 40px;
  height: 40px;
}

.presence {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #22c55e;
}

.care-lead-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.care-lead-body strong,
.care-lead-body em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.care-lead-body strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}

.care-lead-body small,
.care-lead-side small {
  color: #94a3b8;
  font-size: 11px;
}

.care-lead-body em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.lead-tags {
  min-height: 14px;
  display: flex;
  gap: 4px;
  overflow: hidden;
}

.lead-tags i {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--tag);
  background: color-mix(in srgb, var(--tag) 12%, white);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.care-lead-side {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
}

.stage,
.agent-mini {
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.stage {
  color: #475569;
  background: #f1f5f9;
}

.agent-mini {
  color: #6d28d9;
  background: #ede9fe;
}

.care-load-more {
  margin: 10px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  padding: 9px;
  color: #475569;
  font-size: 12px;
}

/* --- Chat center panel --------------------------------------------------- */
.care-chat-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #f8fafc;
  height: 100%;
  overflow: hidden;
}

.care-chat-header {
  min-height: 68px;
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
}

.care-contact-heading,
.care-header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.care-contact-heading h1 {
  overflow: hidden;
  margin: 0 0 2px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.care-contact-heading p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.care-header-actions {
  justify-content: flex-end;
}

.care-header-actions .secondary {
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 12px;
  color: #334155;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
}

.care-header-actions .secondary:hover {
  background: #f9fafb;
  border-color: #a5b4fc;
}

.ai-work {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #7c3aed;
  font-size: 11px;
}

.ai-work i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 0 3px #ede9fe;
  animation: care-pulse 1.4s infinite;
}

@keyframes care-pulse {
  50% {
    opacity: .35
  }
}

.agent-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}

.agent-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.agent-toggle span {
  width: 36px;
  height: 20px;
  position: relative;
  border-radius: 999px;
  background: #cbd5e1;
  transition: .2s;
}

.agent-toggle span:after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(100, 116, 139, .3);
  transition: .2s;
}

.agent-toggle input:checked+span {
  background: var(--care-accent);
}

.agent-toggle input:checked+span:after {
  transform: translateX(16px);
}

/* --- Chat messages ------------------------------------------------------- */
.care-messages {
  min-height: 0;
  overflow: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
}

.empty-chat {
  margin: auto;
  display: grid;
  gap: 6px;
  color: #94a3b8;
  text-align: center;
}

.empty-chat b {
  color: #475569;
  font-size: 14px;
}

.empty-chat span {
  font-size: 12px;
}

.care-message {
  max-width: 80%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  align-self: flex-start;
}

.care-message.outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #475569;
  background: #e2e8f0;
  font-size: 9px;
  font-weight: 700;
}

.outgoing .message-avatar {
  color: #fff;
  background: #4f46e5;
}

.draft .message-avatar {
  background: #7c3aed;
}

.message-wrap {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.message-wrap header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 10px;
}

.outgoing .message-wrap header {
  justify-content: flex-end;
}

.message-wrap header b {
  color: #334155;
  font-weight: 600;
}

.message-wrap time {
  color: #94a3b8;
}

.message-bubble {
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 4px 14px 14px;
  color: #1e293b;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.outgoing .message-bubble {
  border-color: #4f46e5;
  border-radius: 14px 4px 14px 14px;
  color: #fff;
  background: #4f46e5;
  box-shadow: 0 1px 3px rgba(79, 70, 229, .2);
}

.outgoing.draft .message-bubble {
  border: 1px dashed #8b5cf6;
  color: #4c1d95;
  background: #f5f3ff;
}

.message-wrap footer {
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: #94a3b8;
  font-size: 10px;
}

.message-wrap footer button {
  border: 0;
  border-radius: 6px;
  padding: 5px 10px;
  color: #fff;
  background: #7c3aed;
  font-size: 10px;
  font-weight: 600;
}

.message-wrap footer button:hover {
  background: #6d28d9;
}

/* --- Composer ------------------------------------------------------------ */
.care-composer {
  padding: 12px 20px 14px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.care-composer textarea {
  width: 100%;
  min-height: 60px;
  max-height: 150px;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  outline: 0;
  color: #1e293b;
  background: #fff;
  font-size: 13px;
  line-height: 1.5;
}

.care-composer textarea:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}

.care-composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 11px;
}

.care-composer-actions select {
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 8px;
  color: #475569;
  background: #fff;
  font-size: 11px;
}

.care-composer-actions span {
  flex: 1;
}

.care-composer button {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  background: #4f46e5;
  font-size: 13px;
  font-weight: 600;
}

.care-composer button:hover {
  background: #4338ca;
}

.care-composer button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   Right Profile Panel (Care)
   ═══════════════════════════════════════════════════════════════ */
.care-profile-panel {
  border-left: 1px solid #e5e7eb;
  overflow-y: auto;
  padding: 16px;
  background: #f9fafb;
}

.care-profile-panel input,
.care-profile-panel select,
.care-profile-panel textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  padding: 8px 10px;
  color: #1e293b;
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}

.care-profile-panel input:focus,
.care-profile-panel select:focus,
.care-profile-panel textarea:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .08);
}

.care-profile-panel button {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  background: #4f46e5;
  font-weight: 600;
  font-size: 13px;
  transition: background .15s;
}

.care-profile-panel button:hover {
  background: #4338ca;
}

/* Empty state */
.empty-profile-state {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-profile-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e0e7ff;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: #4f46e5;
}

.empty-profile-state h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.empty-profile-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
  max-width: 240px;
}

/* Hero card */
.profile-hero-v2 {
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-avatar-v2 {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  border: 2px solid rgba(255, 255, 255, .3);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.hero-presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border: 2px solid #4338ca;
  border-radius: 50%;
  background: #22c55e;
}

.hero-details-v2 {
  min-width: 0;
  flex: 1;
}

.hero-details-v2 h4 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-details-v2 p {
  margin: 0 0 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
}

.hero-stage-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

/* Score gauge */
.hero-score-box {
  background: rgba(0, 0, 0, .12);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.score-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, .8);
  font-weight: 500;
}

.score-num {
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
}

.score-num.score-high {
  color: #6ee7b7;
}

.score-num.score-med {
  color: #fde68a;
}

.score-num.score-low {
  color: #93c5fd;
}

.score-track {
  height: 4px;
  background: rgba(255, 255, 255, .18);
  border-radius: 999px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .4s ease;
}

.score-fill.score-high {
  background: #34d399;
}

.score-fill.score-med {
  background: #fbbf24;
}

.score-fill.score-low {
  background: #60a5fa;
}

/* Tab navigation (Segmented Control style) */
.profile-nav-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  margin-top: 12px;
  margin-bottom: 14px;
  border: 1px solid #e2e8f0;
}

.profile-tab-btn {
  position: relative;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 6px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all .18s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.profile-tab-btn svg {
  flex-shrink: 0;
  display: block;
  width: 14px;
  height: 14px;
  transition: color .18s ease;
}

.profile-tab-btn:hover:not(.active) {
  color: #1e293b;
  background: rgba(255, 255, 255, .65);
}

.profile-tab-btn.active {
  background: #ffffff;
  color: #4f46e5;
  font-weight: 600;
  border-color: rgba(79, 70, 229, .15);
  box-shadow: 0 2px 6px rgba(79, 70, 229, .08), 0 1px 2px rgba(15, 23, 42, .04);
}

.profile-tab-btn.active svg {
  color: #4f46e5;
}

.tab-badge-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 0 2px #ffffff;
}

/* Tab body & cards */
.profile-tab-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.card-header-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.card-header-title h3 {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}

.card-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #eef2ff;
  color: #4f46e5;
  flex-shrink: 0;
}

/* Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
}

.empty-tag-hint {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px !important;
  border: 1px solid color-mix(in srgb, var(--tag) 25%, transparent) !important;
  border-radius: 999px !important;
  color: var(--tag) !important;
  background: color-mix(in srgb, var(--tag) 10%, white) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}

.tag-chip:hover {
  transform: scale(1.03);
}

.tag-chip span {
  font-size: 13px;
  line-height: 1;
  opacity: .6;
}

.tag-chip span:hover {
  opacity: 1;
}

/* Tag form */
.tag-form-v2 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}

.tag-input-row {
  display: grid;
  grid-template-columns: 1fr 34px auto;
  gap: 5px;
  align-items: center;
}

.tag-input-row input[type=text] {
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
}

.tag-input-row input[type=color] {
  width: 34px;
  height: 34px;
  padding: 2px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  cursor: pointer;
  background: #fff;
}

.btn-add-tag {
  border: 0;
  border-radius: 7px;
  padding: 7px 12px;
  background: #4f46e5;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.btn-add-tag:hover {
  background: #4338ca;
}

.color-presets {
  display: flex;
  align-items: center;
  gap: 5px;
}

.color-swatch-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d1d5db;
  cursor: pointer;
  padding: 0;
  transition: transform .1s;
}

.color-swatch-btn:hover {
  transform: scale(1.15);
}

/* Stage form */
.form-group-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
}

.form-group-grid select,
.form-group-grid input,
.form-group-grid textarea {
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
}

.form-group-grid textarea {
  min-height: 52px;
  resize: vertical;
}

.btn-save-stage {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: #4f46e5;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-save-stage:hover {
  background: #4338ca;
}

/* AI Script */
.script-card-v2 {
  gap: 10px;
}

.btn-copy-script {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-copy-script:hover {
  background: #f1f5f9;
  border-color: #a5b4fc;
  color: #4f46e5;
}

.script-meta {
  font-size: 11px;
  color: #94a3b8;
}

.script-container {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #1e293b;
}

.script-pre {
  max-height: 340px;
  overflow-y: auto;
  margin: 0;
  padding: 14px;
  color: #e2e8f0;
  background: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.empty-script-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
  color: #64748b;
}

.empty-script-icon {
  color: #4f46e5;
  display: grid;
  place-items: center;
}

.empty-script-state p {
  margin: 0;
  font-size: 13px;
}

.btn-gen-script-tab {
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  background: #4f46e5;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-gen-script-tab:hover {
  background: #4338ca;
}

/* Sources list */
.sources-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.source-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s;
}

.source-card-item:hover {
  border-color: #c7d2fe;
}

.source-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.source-main strong {
  font-size: 12px;
  font-weight: 600;
  color: #4f46e5;
}

.source-main span {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.source-badge-count {
  font-size: 10px;
  font-weight: 700;
  background: #eef2ff;
  color: #4f46e5;
  padding: 2px 7px;
  border-radius: 999px;
}

.source-meta small {
  font-size: 10px;
  color: #94a3b8;
}

/* Timeline */
.timeline-v2 {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 8px;
  position: relative;
}

.timeline-v2::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #e5e7eb;
  border-radius: 1px;
}

.timeline-item-v2 {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
}

.timeline-dot-v2 {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f46e5;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e0e7ff;
  margin-top: 4px;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-content-v2 {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.timeline-flow-v2 {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}

.stg-from {
  color: #64748b;
}

.stg-arrow {
  color: #94a3b8;
  font-size: 11px;
}

.stg-to {
  color: #4f46e5;
}

.timeline-reason-v2 {
  margin: 2px 0;
  font-size: 11px;
  color: #475569;
  font-style: italic;
  background: #f1f5f9;
  padding: 5px 8px;
  border-radius: 6px;
}

.timeline-time-v2 {
  font-size: 10px;
  color: #94a3b8;
}

.empty-text {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

/* Toast notification */
.care-toast {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  background: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .25);
  font-size: 12px;
  font-weight: 500;
}

.care-toast.error {
  background: #dc2626;
}

@media (max-width:850px) {
  .care-shell {
    grid-template-columns: 240px minmax(320px, 1fr);
  }

  .care-profile-panel {
    display: none;
  }
}

@media (max-width:760px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .conversation-header {
    padding: 12px 16px;
  }

  .timeline {
    padding: 22px 16px;
  }

  .composer {
    padding: 10px;
  }

  .user-actions span,
  .user-actions a {
    display: none;
  }

  .main-nav {
    gap: 10px;
  }

  .main-nav a {
    font-size: 12px;
  }

  .care-shell {
    grid-template-columns: 1fr;
  }

  .care-profile-panel {
    display: none;
  }

  .care-list-panel {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Settings Page Styles
   ═══════════════════════════════════════════════════════════════ */
.settings-workspace {
  height: calc(100vh - 58px);
  display: grid !important;
  grid-template-columns: 280px minmax(0, 1fr) !important;
  background: #f8fafc;
}

.settings-sidebar {
  background: #1e293b;
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid #334155;
}

.settings-sidebar-header h2 {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px 8px;
  letter-spacing: -0.01em;
}

.settings-sidebar-header p {
  color: #94a3b8;
  font-size: 12px;
  margin: 0 0 16px 8px;
}

.settings-tab-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-tab-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 12px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-tab-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.settings-tab-item.active {
  background: #4f46e5;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.tab-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
}

.settings-tab-item.active .tab-item-icon {
  background: rgba(255, 255, 255, 0.2);
}

.tab-item-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-item-text .task-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
}

.tab-item-text .task-meta {
  font-size: 11px;
  opacity: 0.75;
}

/* Main Content Panel */
.settings-main-panel {
  padding: 28px 40px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.settings-header {
  padding: 0 0 20px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.settings-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.settings-header p {
  color: #64748b;
  margin: 0;
  font-size: 13px;
}

.settings-form {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-card {
  background: #ffffff;
  padding: 22px 24px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field-group label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.form-field-group input[type="text"],
.form-field-group input[type="number"],
.form-field-group textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-field-group input:focus,
.form-field-group textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.form-field-group textarea {
  line-height: 1.5;
  resize: vertical;
}

.field-hint {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Custom Switch Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked+.switch-slider {
  background-color: #4f46e5;
}

.switch-toggle input:checked+.switch-slider:before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
}

/* Save Actions Bar */
.settings-actions-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}

.btn-save-settings {
  border: 0;
  border-radius: 10px;
  padding: 11px 24px;
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-save-settings:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.settings-status-badge {
  font-size: 13.5px;
  font-weight: 500;
  transition: opacity 0.25s ease;
}

/* --- Add Lead Button & Modal ------------------------------------------- */
.care-add-lead-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.care-add-lead-btn:hover {
  background: #0e8a68;
}

.care-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.care-modal-overlay[hidden] {
  display: none;
}

.care-modal {
  background: #fff;
  border-radius: 14px;
  width: 420px;
  max-width: 92vw;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.care-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.care-modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.care-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
}

.care-modal-close:hover {
  color: #dc2626;
}

.care-modal-body {
  padding: 18px 20px;
}

.care-form-group {
  margin-bottom: 14px;
}

.care-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #64748b;
}

.care-form-group .required {
  color: #dc2626;
}

.care-form-group input,
.care-form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.care-form-group input:focus,
.care-form-group textarea:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.care-form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.care-form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #4f46e5;
}

.care-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.care-form-error {
  color: #dc2626;
  font-size: 13px;
  flex: 1;
}

.care-modal-submit {
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  background: #4f46e5;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.care-modal-submit:hover {
  background: #4338ca;
}

.care-modal-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}