body:has(.allmsp-login-required),
body:has(.allmsp-sales-portal) {
  background: #f6f7f8;
}

body:has(.allmsp-login-required) .wp-block-navigation,
body:has(.allmsp-login-required) footer,
body:has(.allmsp-sales-portal) .wp-block-navigation,
body:has(.allmsp-sales-portal) footer {
  display: none;
}

body:has(.allmsp-login-required) main,
body:has(.allmsp-sales-portal) main {
  margin-block-start: 0;
}

body:has(.allmsp-login-required) .wp-block-post-title,
body:has(.allmsp-sales-portal) .wp-block-post-title {
  display: none;
}

body:has(.allmsp-login-required) .wp-block-post-content,
body:has(.allmsp-sales-portal) .wp-block-post-content {
  margin-block-start: 0;
  max-width: none;
}

body:has(.allmsp-login-required) .wp-block-post-content {
  align-items: center;
  display: grid;
  min-height: calc(100vh - 160px);
  padding: 32px 16px;
}

.allmsp-login-required {
  background: #ffffff;
  border: 1px solid #dce3df;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(23, 32, 29, 0.08);
  color: #17201d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0 auto;
  max-width: 440px;
  padding: 28px;
  width: 100%;
}

.allmsp-login-required h1 {
  font-size: 28px;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0 0 10px;
}

.allmsp-login-required p {
  color: #68746f;
  margin: 0 0 18px;
}

.allmsp-login-required form p {
  margin-bottom: 14px;
}

.allmsp-login-required label {
  color: #17201d;
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.allmsp-login-required input[type="text"],
.allmsp-login-required input[type="password"] {
  background: #ffffff;
  border: 1px solid #dce3df;
  border-radius: 6px;
  box-sizing: border-box;
  color: #17201d;
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

.allmsp-login-required .login-remember label {
  align-items: center;
  color: #68746f;
  display: inline-flex;
  font-weight: 500;
  gap: 8px;
  margin-bottom: 0;
}

.allmsp-login-required input[type="submit"] {
  background: #1f7a5a;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 42px;
  padding: 0 16px;
  width: 100%;
}

body:has(.allmsp-sales-portal) .wp-block-post-content {
  padding: 0 20px 32px;
}

.allmsp-sales-portal {
  --asp-bg: #f6f7f8;
  --asp-surface: #ffffff;
  --asp-surface-2: #eef3f0;
  --asp-text: #17201d;
  --asp-muted: #68746f;
  --asp-border: #dce3df;
  --asp-accent: #1f7a5a;
  --asp-accent-2: #145f7a;
  --asp-warn: #a45d17;
  --asp-danger: #b93535;
  --asp-radius: 8px;
  color: var(--asp-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  min-height: 78vh;
}

.allmsp-sales-portal * {
  box-sizing: border-box;
}

.asp-header {
  align-items: center;
  background: var(--asp-surface);
  border: 1px solid var(--asp-border);
  border-radius: var(--asp-radius);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 0 0 12px;
  padding: 16px 18px;
}

.asp-header h1,
.asp-detail h2,
.asp-list h2,
.asp-card h3 {
  letter-spacing: 0;
  margin: 0;
}

.asp-header h1 {
  font-size: 24px;
  line-height: 1.1;
}

.asp-kicker {
  color: var(--asp-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.asp-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  min-width: 380px;
}

.asp-stat {
  background: var(--asp-surface-2);
  border: 1px solid var(--asp-border);
  border-radius: 6px;
  padding: 9px 10px;
}

.asp-stat span {
  color: var(--asp-muted);
  display: block;
  font-size: 12px;
}

.asp-stat strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
  margin-top: 3px;
}

.asp-controls {
  align-items: center;
  background: var(--asp-surface);
  border: 1px solid var(--asp-border);
  border-radius: var(--asp-radius);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(220px, 1fr) 180px auto;
  margin-bottom: 12px;
  padding: 10px;
}

.asp-segmented {
  background: var(--asp-bg);
  border: 1px solid var(--asp-border);
  border-radius: 6px;
  display: flex;
  padding: 2px;
}

.asp-segmented button,
.asp-status-button,
.asp-controls select,
.asp-controls input,
.asp-callback input,
.asp-callback button,
.asp-detail button,
.asp-import,
.asp-actions a {
  border-radius: 6px;
  font: inherit;
}

.asp-segmented button {
  background: transparent;
  border: 0;
  color: var(--asp-muted);
  cursor: pointer;
  min-height: 34px;
  padding: 0 12px;
}

.asp-segmented button.active {
  background: var(--asp-surface);
  color: var(--asp-text);
  font-weight: 700;
}

.asp-controls input,
.asp-controls select,
.asp-callback input,
.asp-detail textarea {
  background: #fff;
  border: 1px solid var(--asp-border);
  color: var(--asp-text);
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.asp-import {
  align-items: center;
  background: var(--asp-text);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  min-height: 38px;
  padding: 0 12px;
}

.asp-import input {
  display: none;
}

.asp-shell {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(320px, 0.85fr) minmax(460px, 1.4fr);
}

.asp-list,
.asp-detail,
.asp-card {
  background: var(--asp-surface);
  border: 1px solid var(--asp-border);
  border-radius: var(--asp-radius);
}

.asp-list {
  align-self: start;
  overflow: hidden;
}

.asp-list-head {
  align-items: center;
  border-bottom: 1px solid var(--asp-border);
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.asp-list h2 {
  font-size: 16px;
}

.asp-list-head span {
  color: var(--asp-muted);
  font-size: 13px;
}

.asp-leads {
  max-height: 72vh;
  overflow: auto;
}

.asp-lead-row {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--asp-border);
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  min-height: 74px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.asp-lead-row:hover,
.asp-lead-row.selected {
  background: #eef7f2;
}

.asp-lead-main {
  min-width: 0;
}

.asp-lead-main strong,
.asp-lead-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asp-lead-main small {
  color: var(--asp-muted);
  font-size: 12px;
  margin-top: 2px;
}

.score {
  align-items: center;
  background: #eceff1;
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.score-hot {
  background: #e2f3ea;
  color: #115d3f;
}

.score-good {
  background: #e6f0f7;
  color: #145f7a;
}

.score-mid {
  background: #fff3dc;
  color: var(--asp-warn);
}

.asp-status-pill,
.asp-due {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
}

.asp-status-pill {
  background: #f0f2f3;
  color: #394540;
}

.asp-due {
  background: #fff3dc;
  color: var(--asp-warn);
  grid-column: 2 / 4;
  justify-self: start;
  margin-top: -4px;
}

.asp-detail {
  min-width: 0;
  padding: 16px;
}

.asp-detail-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.asp-detail h2 {
  font-size: 22px;
}

.asp-detail-head p {
  color: var(--asp-muted);
  margin: 5px 0 0;
}

.asp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.asp-actions a,
.asp-detail button,
.asp-callback button {
  background: #fff;
  border: 1px solid var(--asp-border);
  color: var(--asp-text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  min-height: 36px;
  padding: 8px 11px;
  text-decoration: none;
}

.asp-actions a:hover,
.asp-detail button:hover,
.asp-callback button:hover {
  border-color: var(--asp-accent);
  color: var(--asp-accent);
}

.asp-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.asp-status-button.active {
  background: var(--asp-accent);
  border-color: var(--asp-accent);
  color: #fff;
}

.asp-callback {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 280px) auto;
  margin: 0 0 14px;
}

.asp-callback label {
  color: var(--asp-muted);
  display: grid;
  font-size: 13px;
  gap: 4px;
}

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

.asp-form-row label {
  color: var(--asp-muted);
  display: grid;
  font-size: 13px;
  gap: 6px;
}

.asp-detail textarea {
  min-height: 132px;
  resize: vertical;
}

.asp-primary {
  background: var(--asp-accent) !important;
  border-color: var(--asp-accent) !important;
  color: #fff !important;
  margin: 10px 0 14px;
}

.asp-card {
  margin-top: 12px;
  padding: 13px 14px;
}

.asp-card h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.asp-copy {
  color: #26332f;
  font-size: 14px;
}

.asp-muted,
.asp-field em {
  color: var(--asp-muted);
  font-style: normal;
}

.asp-note {
  border-top: 1px solid var(--asp-border);
  padding: 10px 0;
}

.asp-note:first-child {
  border-top: 0;
  padding-top: 0;
}

.asp-note strong {
  display: inline-block;
  margin-right: 8px;
}

.asp-note span {
  color: var(--asp-muted);
  font-size: 12px;
}

.asp-note p {
  margin: 5px 0 0;
}

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

.asp-field {
  border-top: 1px solid var(--asp-border);
  padding-top: 8px;
}

.asp-field span {
  color: var(--asp-muted);
  display: block;
  font-size: 12px;
}

.asp-field strong {
  display: block;
  font-size: 14px;
  margin-top: 2px;
}

.asp-empty,
.asp-empty-detail,
.asp-error {
  color: var(--asp-muted);
  padding: 18px;
}

.asp-error {
  background: #fff0f0;
  border: 1px solid #f0cccc;
  border-radius: var(--asp-radius);
  color: var(--asp-danger);
}

@media (max-width: 980px) {
  .asp-header,
  .asp-controls,
  .asp-shell,
  .asp-form-row,
  .asp-grid-2,
  .asp-meta {
    grid-template-columns: 1fr;
  }

  .asp-header {
    align-items: stretch;
    display: grid;
  }

  .asp-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .asp-controls {
    display: grid;
  }

  .asp-callback {
    grid-template-columns: 1fr;
  }

  .asp-leads {
    max-height: 44vh;
  }
}
