.editor-shell {
  display: grid;
  gap: 0;
  background: #ffffff;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  overflow: hidden;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #dfe4ea;
}

.editor-header h2 {
  margin: 0 0 4px;
}

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

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  border-bottom: 1px solid #dfe4ea;
  background: #f8fafc;
  overflow-x: auto;
}

.tab {
  appearance: none;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 52px;
  padding: 0 16px;
  white-space: nowrap;
}

.tab.active {
  border-bottom-color: #0f766e;
  color: #115e59;
}

.editor-form {
  max-width: none;
  gap: 0;
}

.tab-panel {
  display: none;
  padding: 22px 20px;
}

.tab-panel.active {
  display: grid;
  gap: 18px;
}

.section-title h3,
.builder-head h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.builder-head.clean {
  border-top: 0;
  padding-top: 0;
}

.publish-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}

.publish-toggle small {
  display: block;
  margin-top: 4px;
  color: #637083;
  font-weight: 400;
}

.embed-panel {
  display: grid;
  gap: 14px;
  max-width: 980px;
}

.embed-panel textarea {
  min-height: 92px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #637083;
  padding: 22px;
  background: #f8fafc;
}

.form-preview {
  width: 100%;
  min-height: 680px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  background: #ffffff;
}

.preview-box {
  display: grid;
  gap: 14px;
  max-width: 620px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 18px;
  background: #f8fafc;
}

.form-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #dfe4ea;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.96);
}

.fields-builder {
  display: grid;
  gap: 12px;
  overflow-x: auto;
}

.field-row {
  display: grid;
  grid-template-columns: 1.1fr 140px 150px 0.9fr 0.9fr 0.8fr 80px 118px 118px 86px;
  gap: 10px;
  align-items: end;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  min-width: 1120px;
  padding: 12px;
  background: #f8fafc;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.lead-card {
  cursor: grab;
}

.content {
  min-width: 0;
  overflow-x: hidden;
}

.kanban-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
}

.kanban-shell .kanban {
  display: grid;
  grid-auto-columns: 280px;
  grid-auto-flow: column;
  gap: 14px;
  min-width: max-content;
  overflow: visible;
  padding-bottom: 0;
}

.kanban-shell .kanban-column {
  min-width: 0;
  width: 280px;
}

.kanban-shell .kanban-list {
  min-height: 320px;
}

.lead-card.dragging {
  opacity: 0.55;
}

.kanban-list.drop-ready {
  outline: 2px dashed #0f766e;
  outline-offset: -4px;
  background: #ecfdf5;
}

.stage-creator {
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 16px;
  overflow: hidden;
}

.stage-creator summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 16px;
}

.stage-creator form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 120px 160px auto;
  gap: 12px;
  align-items: end;
  border-top: 1px solid #dfe4ea;
  padding: 14px 16px;
}

.stage-creator input[type="color"] {
  min-height: 34px;
  padding: 4px;
}

.stage-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.stage-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stage-actions button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #dfe4ea;
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.stage-actions button:hover {
  border-color: #0f766e;
  color: #0f766e;
}

.stage-actions .icon-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.stage-edit-panel {
  display: none;
  border-bottom: 1px solid #dfe4ea;
  background: #ffffff;
  padding: 10px 12px;
}

.stage-edit-panel.active {
  display: block;
}

.stage-edit-panel form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.stage-edit-panel input[type="color"] {
  min-height: 34px;
  padding: 4px;
}

.view-pipelines-show {
  background: #15145f;
}

.view-pipelines-show .app-shell {
  background:
    radial-gradient(circle at 78% 18%, rgba(77, 213, 255, 0.35), transparent 28%),
    radial-gradient(circle at 64% 78%, rgba(8, 195, 180, 0.28), transparent 32%),
    linear-gradient(135deg, #32177f 0%, #25268e 45%, #11175f 100%);
}

.view-pipelines-show .sidebar {
  background: rgba(7, 14, 31, 0.82);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.view-pipelines-show .content {
  color: #ffffff;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 180px);
  min-height: 100vh;
}

.view-pipelines-show .topbar {
  align-items: flex-start;
  margin-bottom: 26px;
}

.view-pipelines-show .topbar h1 {
  color: #ffffff;
  font-size: 38px;
  font-weight: 500;
}

.view-pipelines-show .muted {
  color: rgba(255, 255, 255, 0.72);
}

.view-pipelines-show .button {
  border-radius: 14px;
  min-height: 46px;
  padding: 0 18px;
  background: #16a67a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.view-pipelines-show .button.secondary {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  backdrop-filter: blur(14px);
}

.view-pipelines-show .stage-creator {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  backdrop-filter: blur(12px);
}

.view-pipelines-show .stage-creator form {
  border-top-color: rgba(255, 255, 255, 0.16);
}

.view-pipelines-show label {
  color: rgba(255, 255, 255, 0.88);
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.board-search {
  position: relative;
  min-width: min(100%, 420px);
}

.board-search input {
  min-height: 48px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  padding-right: 48px;
  backdrop-filter: blur(16px);
}

.board-search input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.board-search span {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.72);
  font-size: 26px;
}

.date-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-filters label,
.close-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.8);
  padding: 0 14px;
  backdrop-filter: blur(16px);
  font-weight: 700;
}

.date-filters input {
  width: 150px;
  min-height: 34px;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 8px;
}

.close-toggle input {
  width: auto;
}

.view-pipelines-show .kanban-shell {
  padding-bottom: 18px;
}

.view-pipelines-show .kanban-shell .kanban {
  grid-auto-columns: 330px;
  gap: 18px;
}

.view-pipelines-show .kanban-shell .kanban-column {
  width: 330px;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  border-style: dashed;
  border-radius: 0 0 8px 8px;
  backdrop-filter: blur(10px);
}

.view-pipelines-show .kanban-column.stage-hidden {
  display: none;
}

.view-pipelines-show .kanban-heading {
  border-top-width: 0;
  border-bottom: 0;
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 14px 16px;
  color: #111827;
  background: var(--stage-color, #55d5e6);
}

.view-pipelines-show .stage-title .badge {
  background: rgba(255, 255, 255, 0.55);
  color: #334155;
}

.view-pipelines-show .stage-actions button {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.82);
}

.view-pipelines-show .stage-edit-panel {
  margin: 0 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.view-pipelines-show .kanban-list {
  gap: 14px;
  min-height: calc(100vh - 360px);
  padding: 12px;
}

.view-pipelines-show .kanban-empty {
  min-height: 260px;
  border-color: rgba(255, 255, 255, 0.32);
  color: rgba(255, 255, 255, 0.72);
}

.view-pipelines-show .lead-card {
  border: 0;
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 16px 30px rgba(9, 16, 46, 0.2);
}

.view-pipelines-show .lead-card .muted,
.view-pipelines-show .lead-card-meta {
  color: #667085;
}

.view-pipelines-show .lead-card-title {
  font-size: 18px;
  line-height: 1.22;
}

.view-pipelines-show .lead-card .button.secondary {
  min-height: 38px;
  border-color: #dfe4ea;
  background: #ffffff;
  color: #111827;
  box-shadow: none;
}

.lead-card.filtered-out {
  display: none;
}

.view-leads-show .content,
.view-deals-show .content {
  background: #eef3f7;
}

.deal-page {
  display: grid;
  gap: 22px;
}

.deal-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.deal-kicker {
  display: inline-flex;
  color: #64748b;
  border-bottom: 1px dashed #94a3b8;
  margin-bottom: 8px;
}

.deal-hero h2 {
  max-width: 850px;
  margin: 0;
  color: #2f343b;
  font-size: 44px;
  font-weight: 500;
  line-height: 1.1;
}

.deal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: #64748b;
}

.deal-meta span {
  border-radius: 999px;
  background: #ffffff;
  padding: 7px 12px;
}

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

.button.success {
  background: #16a34a;
}

.button.danger {
  background: #dc2626;
}

.button.secondary-danger {
  background: #ffffff;
  border-color: #fecaca;
  color: #b91c1c;
}

.deal-flow {
  display: grid;
  grid-auto-columns: minmax(138px, 1fr);
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.deal-flow form {
  min-width: 138px;
}

.deal-stage {
  position: relative;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 6px 0 0 6px;
  padding: 0 22px 0 13px;
  background: #d4d9df;
  color: #4b5563;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  box-shadow: inset 0 -3px 0 var(--stage-color, #38bdf8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-stage::after {
  content: "";
  position: absolute;
  right: -15px;
  top: 0;
  z-index: 2;
  width: 0;
  height: 0;
  border-top: 21px solid transparent;
  border-bottom: 21px solid transparent;
  border-left: 15px solid #d4d9df;
}

.deal-stage.active {
  background: #ffffff;
  color: #111827;
}

.deal-stage.active::after {
  border-left-color: #ffffff;
}

.deal-stage.closed {
  box-shadow: inset 0 -3px 0 #22c55e;
}

.deal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid #d8e0e7;
}

.deal-tabs span {
  padding: 10px 2px;
  color: #7b8794;
  font-size: 16px;
}

.deal-tabs .active {
  color: #0d6efd;
  border-bottom: 3px solid #38bdf8;
}

.deal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 18px;
}

.deal-card {
  background: #ffffff;
  border: 1px solid #dfe4ea;
  border-radius: 16px;
  padding: 22px;
}

.activity-card {
  grid-row: span 2;
}

.deal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.deal-section-head h3 {
  margin: 0;
  font-size: 22px;
}

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

.deal-details div,
.deal-data-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px;
}

.deal-details dt,
.deal-data-row span {
  color: #7b8794;
  font-size: 13px;
  font-weight: 700;
}

.deal-details dd {
  margin: 6px 0 0;
  font-size: 17px;
}

.note-box {
  margin-top: 16px;
  border-radius: 10px;
  background: #fff7ed;
  padding: 14px;
}

.note-box p {
  margin-bottom: 0;
}

.deal-data-list,
.timeline {
  display: grid;
  gap: 10px;
}

.deal-data-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
}

.compact-button {
  min-height: 34px;
  margin-right: 8px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
}

.timeline-item > span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #38bdf8;
  margin-top: 5px;
}

.timeline-item p {
  margin: 4px 0;
}

.timeline-item small {
  color: #7b8794;
}

.contact-page {
  display: grid;
  gap: 18px;
}

.contact-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.contact-hero h2 {
  margin: 0 0 6px;
  font-size: 30px;
}

.contact-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.contact-meta span {
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  padding: 7px 11px;
  font-weight: 700;
}

.contact-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .field-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .editor-header,
  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .stage-creator form {
    grid-template-columns: 1fr;
  }

  .stage-edit-panel form {
    grid-template-columns: 1fr;
  }

  .board-toolbar,
  .date-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .board-search,
  .date-filters label,
  .close-toggle,
  .date-filters input {
    width: 100%;
  }

  .deal-hero,
  .deal-actions {
    flex-direction: column;
  }

  .deal-hero h2 {
    font-size: 32px;
  }

  .deal-grid,
  .deal-details,
  .deal-data-row,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-hero {
    flex-direction: column;
  }

  .contact-meta {
    justify-content: flex-start;
  }
}
