* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #14213d;
  background:
    radial-gradient(circle at top left, rgba(22, 163, 74, 0.14), transparent 30%),
    linear-gradient(180deg, #f5f7fb 0%, #eaf0f5 100%);
}

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 14px 36px;
}

.hero {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5b6473;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 0.98;
}

.hero-copy {
  margin: 0;
  color: #657084;
  font-size: 14px;
  line-height: 1.45;
  max-width: 560px;
}

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

.stat-card {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #e4eaf0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.stat-label {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
}

.stat-card strong {
  font-size: 18px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #e5ebf1;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.toolbar-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-wrap input {
  width: 100%;
  border: 1px solid #d5dde7;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  color: #111827;
  background: #ffffff;
}

.category-select {
  position: relative;
}

.category-trigger {
  width: 100%;
  border: 1px solid #d5dde7;
  border-radius: 14px;
  background: #ffffff;
  color: #14213d;
  padding: 12px 40px 12px 14px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.category-trigger::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-60%) rotate(45deg);
  transition: transform 0.18s ease;
}

.category-trigger[aria-expanded="true"]::after {
  transform: translateY(-30%) rotate(225deg);
}

.category-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e5ebf1;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  z-index: 12;
}

.category-menu.is-open {
  display: flex;
}

.category-option {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #334155;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.category-option.is-selected {
  background: #eef2ff;
  color: #1e3a8a;
}

.category-option:hover {
  background: #f8fafc;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  flex: 0 0 auto;
  border: 1px solid #d4dde6;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.filter-btn.is-active {
  background: #14213d;
  border-color: #14213d;
  color: #ffffff;
}

.lead-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-card {
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e7edf3;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.lead-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.lead-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.28;
}

.lead-phone {
  margin: 0;
  color: #556070;
  font-size: 13px;
}

.lead-category {
  display: inline-flex;
  align-items: center;
  margin: 8px 0 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f3f6fa;
  border: 1px solid #dde5ee;
  color: #344054;
  font-size: 11px;
  font-weight: 700;
}

.lead-head-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-wrap {
  position: relative;
  width: fit-content;
  min-width: 126px;
  border-radius: 999px;
}

.status-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.status-wrap[data-status="new"] {
  background: #ecfdf3;
  color: #166534;
}

.status-wrap[data-status="called"] {
  background: #eff6ff;
  color: #1d4ed8;
}

.status-wrap[data-status="follow-up"] {
  background: #fff7ed;
  color: #c2410c;
}

.status-trigger {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 7px 34px 7px 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
  cursor: pointer;
  text-align: left;
}

.status-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 170px;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e5ebf1;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  z-index: 8;
}

.status-menu.is-open {
  display: flex;
}

.status-option {
  border: none;
  background: transparent;
  color: #1f2937;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.status-option:hover,
.status-option.is-selected {
  background: #f3f6fb;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #d7e0e8;
  background: #ffffff;
  color: #14213d;
}

.action-btn-profile {
  background: #f8fafc;
  border-color: #dbe4ee;
  color: #334155;
}

.action-btn-website {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}

.action-btn-call {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.action-btn-whatsapp {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
}

.info-chip-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #a16207;
}

.action-icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
}

.action-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.lead-address,
.lead-date {
  margin: 0 0 8px;
  color: #556070;
  font-size: 13px;
  line-height: 1.45;
}

.lead-date strong {
  color: #14213d;
}

.lead-link-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.lead-link-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #d7e0e8;
  background: #ffffff;
  color: #14213d;
}

.lead-link-btn-profile {
  background: #f8fafc;
  border-color: #dbe4ee;
  color: #334155;
}

.lead-link-btn-website {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}

.lead-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 6px;
}

.lead-expand-btn {
  border: 1px solid #d7e0e8;
  background: #ffffff;
  color: #526071;
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  flex: 0 0 auto;
}

.lead-expand-icon {
  width: 14px;
  height: 14px;
  color: #98a2b3;
  transition: transform 0.2s ease;
}

.lead-expand-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lead-expand-btn[aria-expanded="true"] .lead-expand-icon {
  transform: rotate(180deg);
}

.editor-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.24s ease, opacity 0.18s ease;
}

.editor-panel.is-open {
  max-height: 420px;
  opacity: 1;
}

.editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8edf3;
}

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

.field label {
  font-size: 12px;
  font-weight: 600;
  color: #667085;
}

.field textarea {
  width: 100%;
  min-height: 86px;
  border: 1px solid #d6dde6;
  border-radius: 14px;
  background: #ffffff;
  color: #14213d;
  padding: 11px 12px;
  font-size: 13px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  resize: vertical;
}

.save-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(21, 128, 61, 0.18);
}

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

.save-state {
  margin: 2px 0 0;
  font-size: 12px;
  color: #166534;
}

.save-state.error {
  color: #b42318;
}

.empty-state {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

@media (min-width: 720px) {
  .shell {
    padding: 28px 18px 42px;
  }

  .hero {
    margin-bottom: 16px;
  }

  .toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .toolbar-top {
    flex: 1 1 520px;
    flex-direction: row;
    align-items: center;
  }

  .search-wrap {
    flex: 1 1 420px;
    max-width: 460px;
  }

  .category-wrap {
    flex: 0 0 220px;
  }

  .lead-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .lead-head-right {
    align-items: flex-end;
    width: 280px;
  }

  .action-row {
    width: 100%;
    justify-content: flex-end;
  }

  .action-btn {
    flex: 0 0 auto;
  }

  .lead-meta-row {
    align-items: flex-start;
  }

  .editor {
    display: grid;
    grid-template-columns: 1fr 140px;
    align-items: end;
  }
}
