/* =========================
   SPCRM Base Containers
========================= */

.spcrm-app, .spcrm-login, .spcrm-no-access {
  border: 1px solid #ddd;
  padding: 16px;
  border-radius: 10px;
  background: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.spcrm-login {
  max-width: 460px;
  margin: 80px auto;
  padding: 34px 36px 36px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.spcrm-login h2 {
  margin: 0 0 18px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .2px;
}

#spcrm-loginform p {
  margin-bottom: 12px;
}

#spcrm-loginform label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

#spcrm-loginform input[type="text"],
#spcrm-loginform input[type="password"] {
  width: 100%;
  border: 1px solid #dadada;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  transition: border .2s ease, box-shadow .2s ease;
  box-sizing: border-box;
}

#spcrm-loginform .input {
  width: 100%;
}

.spcrm-login-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #e3b9b9;
  border-radius: 10px;
  background: #fff5f5;
  color: #8f1f1f;
  font-size: 14px;
  line-height: 1.4;
}

#spcrm-loginform input[type="text"]:focus,
#spcrm-loginform input[type="password"]:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34,113,177,.15);
  outline: none;
}

#spcrm-loginform input[type="submit"] {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: #2271b1;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}

#spcrm-loginform input[type="submit"]:hover {
  background: #1b5c8e;
}

#spcrm-loginform input[type="submit"]:active {
  transform: translateY(1px);
}
.spcrm-pass-wrap {
  position: relative;
}

.spcrm-pass-wrap input[type="password"],
.spcrm-pass-wrap input[type="text"] {
  padding-right: 44px !important;
}

.spcrm-pass-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display:flex;
align-items:center;
justify-content:center;
color:#444;
transition:opacity .2s ease;
}

.spcrm-pass-toggle:hover svg {
  stroke:#000;
}

.spcrm-pass-toggle svg {
  pointer-events:none;
}

.spcrm-pass-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,0,0,.12);
  border-radius: 6px;
}

.spcrm-login-links {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
}

.spcrm-login-links a {
  color: #2271b1;
  text-decoration: none;
}

.spcrm-login-links a:hover {
  text-decoration: underline;
}

body {
  background:#f4f6f8;
}

.spcrm-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

#spcrm-entries {
  margin-top: 12px;
}

/* =========================
   Tabs + Views
========================= */

#spcrm-app .spcrm-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 0 14px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 12px;
}

#spcrm-app .spcrm-tab {
  border: 1px solid #ddd !important;
  background: #fff !important;
  padding: 10px 14px !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

#spcrm-app .spcrm-tab.is-active {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}

#spcrm-app .spcrm-view { display: none; }
#spcrm-app .spcrm-view.is-active { display: block; }

/* =========================
   Split Dashboard Layout
========================= */

#spcrm-app .spcrm-split {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 1100px) {
  #spcrm-app .spcrm-split { grid-template-columns: 1fr; }
}

#spcrm-app .spcrm-pane {
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

#spcrm-app .spcrm-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

#spcrm-app .spcrm-toolbar input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  box-sizing: border-box;
}

#spcrm-app .spcrm-toolbar select {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  box-sizing: border-box;
}

#spcrm-app select {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  box-sizing: border-box;
}

/* =========================
   Buttons (scoped, theme-proof)
========================= */

#spcrm-app .spcrm-btn,
#spcrm-app button,
#spcrm-app input[type="button"],
#spcrm-app input[type="submit"] {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #cfcfcf !important;
  background: #ffffff !important;
  color: #111 !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.03) !important;
  opacity: 1 !important;
  filter: none !important;
  text-decoration: none !important;
}

#spcrm-app .spcrm-btn:hover,
#spcrm-app button:hover {
  background: #f6f6f6 !important;
}

#spcrm-app .spcrm-btn:active,
#spcrm-app button:active {
  transform: translateY(1px);
}

#spcrm-app .spcrm-btn:focus,
#spcrm-app button:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(0,0,0,.12) !important;
}

/* Primary */
#spcrm-app .spcrm-btn-primary {
  background: #111 !important;
  border-color: #111 !important;
  color: #fff !important;
}

#spcrm-app .spcrm-btn-primary:hover {
  background: #000 !important;
}

/* Small buttons */
#spcrm-app .spcrm-btn-small {
  padding: 8px 12px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
}

/* Disabled */
#spcrm-app .spcrm-btn:disabled,
#spcrm-app button:disabled {
  opacity: .5 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Ensure Create Entry never LOOKS disabled unless it is disabled */
#spcrm-app #spcrm-create-entry {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* =========================
   Entry Cards
========================= */

#spcrm-app .spcrm-entry-card {
  padding: 14px !important;
  border: 1px solid #eee !important;
  border-radius: 12px !important;
  margin-bottom: 10px !important;
  background: #fff !important;
  position: relative !important;
  overflow: hidden !important;

  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

#spcrm-app .spcrm-entry-card-top {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px !important;
}

#spcrm-app .spcrm-entry-meta {
  margin-top: 6px !important;
  font-size: 12px !important;
  opacity: .7 !important;
}

#spcrm-app .spcrm-entry-card:hover {
  background: rgba(0,0,0,.03) !important;
  border-color: rgba(0,0,0,.18) !important;
}

#spcrm-app .spcrm-entry-card:active {
  transform: translateY(1px);
}

#spcrm-app .spcrm-entry-card:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(0,0,0,.12) !important;
}

#spcrm-app .spcrm-entry-card.is-selected {
  border-color: rgba(0,0,0,.25) !important;
  background: rgba(0,0,0,.03) !important;
}

#spcrm-app .spcrm-entry-card-needs-info {
  border-color: #f0c36d !important;
  background: #fffaf0 !important;
}

#spcrm-app .spcrm-entry-card-has-reminder::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 18px solid #f59e0b;
  border-left: 18px solid transparent;
}

#spcrm-app .spcrm-reminder-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: #fff7e6;
  color: #9a6700;
  border: 1px solid #f2c46d;
  white-space: nowrap;
}

#spcrm-app .spcrm-needs-info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: #fff3cd;
  color: #8a5a00;
  border: 1px solid #f0c36d;
  white-space: nowrap;
}

#spcrm-app .spcrm-contact-alert {
  border: 1px solid #f0c36d;
  background: #fff8e5;
  color: #5f4400;
  border-radius: 12px;
  padding: 12px 14px;
}

#spcrm-app .spcrm-contact-alert-inline {
  margin: 10px 0 14px;
}

#spcrm-app .spcrm-contact-alert-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

#spcrm-app .spcrm-contact-alert-text {
  font-size: 13px;
  line-height: 1.45;
}

/* =========================
   Detail Pane
========================= */

#spcrm-app .spcrm-detail-empty {
  padding: 12px;
  opacity: .8;
}

.spcrm-detail-row {
  font-size: 14px;
  margin-bottom: 8px;
}

.spcrm-detail-content {
  margin-top: 12px;
}

.spcrm-detail-label {
  font-weight: 700;
  margin-bottom: 6px;
}

.spcrm-detail-box {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  white-space: pre-wrap;
  min-height: 80px;
}

#spcrm-app .spcrm-detail-notes {
  margin-top: 14px;
  border-top: 1px solid #eee;
  padding-top: 14px;
}

/* =========================
   Forms
========================= */

.spcrm-form label {
  display: block;
  margin-bottom: 12px;
}

.spcrm-form label > span {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.spcrm-form input[type="text"],
.spcrm-form input[type="datetime-local"],
.spcrm-form textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  box-sizing: border-box;
}

#spcrm-app select {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  box-sizing: border-box;
}

.spcrm-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  opacity: .75;
}

.spcrm-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.spcrm-form-status {
  margin-top: 10px;
  font-size: 13px;
}

/* Entry modal: 2-column read-only contact info grid */
#spcrm-app .spcrm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 900px) {
  #spcrm-app .spcrm-grid-2 { grid-template-columns: 1fr; }
}

/* =========================
   Modal (viewport-safe, scrollable)
========================= */

.spcrm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 99990 !important;
}

.spcrm-modal {
  position: fixed;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: min(820px, calc(100vw - 24px)) !important;
  max-height: calc(100vh - 24px) !important;
  overflow: auto !important;

  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 14px;
  z-index: 99999 !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

/* Sticky header inside modal */
.spcrm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;

  margin-bottom: 10px;
}

/* =========================
   Notes UI
========================= */

.spcrm-notes-panel {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  background: #fafafa;
  max-height: 70vh;
  overflow: auto;
}

/* =========================
   Detail panel scrollers
   (keeps Contacts/Companies detail panes from getting super long)
========================= */

#spcrm-app #spcrm-detail-notes-list,
#spcrm-app #spcrm-contact-entries,
#spcrm-app #spcrm-company-entries {
  max-height: 320px;
  overflow: auto;
  padding-right: 6px; /* room for scrollbar so content doesn’t feel cramped */
}

/* Optional: if company contacts list gets long, make the whole detail pane scroll */
#spcrm-app #spcrm-company-detail,
#spcrm-app #spcrm-contact-detail,
#spcrm-app #spcrm-entry-detail {
  max-height: calc(100vh - 280px);
  overflow: auto;
}

.spcrm-notes-header h4 {
  margin: 0 0 10px 0;
}

.spcrm-notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.spcrm-note {
  border: 1px solid #e9e9e9;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
}

.spcrm-note-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: .75;
  margin-bottom: 6px;
  gap: 10px;
}

.spcrm-note-body {
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.spcrm-notes-loading,
.spcrm-notes-empty {
  font-size: 13px;
  opacity: .8;
}

.spcrm-note-form textarea {
  width: 100%;
}

.spcrm-note-actions {
  justify-content: flex-end;
}

.spcrm-meta-box {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px;
  background: #fafafa;
  font-size: 13px;
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

/* =========================
   Contact Search Dropdown (card-style, readable)
========================= */

#spcrm-app .spcrm-dropdown {
  border: none;
  margin-top: 8px;
  background: transparent;
  overflow: auto;
  max-height: 360px;
  padding: 4px;
}

/* Individual contact card */
#spcrm-app .spcrm-dd-item,
#spcrm-modals .spcrm-dd-item {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  margin-bottom: 8px;

  transition:
    background 120ms ease,
    border-color 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

#spcrm-app .spcrm-dd-item,
#spcrm-modals .spcrm-dd-item:last-child {
  margin-bottom: 0;
}

#spcrm-app .spcrm-dd-item,
#spcrm-modals .spcrm-dd-item:hover {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.25);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

/* Name + company */
#spcrm-app .spcrm-dd-item,
#spcrm-modals .spcrm-dd-item > div:first-child {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}

/* Email + phone */
#spcrm-app .spcrm-dd-meta {
  font-size: 12px;
  opacity: .85;
  margin-top: 6px;
  line-height: 1.3;
}

/* Empty / no results */
#spcrm-app .spcrm-dropdown em {
  display: block;
  padding: 12px;
  opacity: .7;
  text-align: center;
}
/* =========================
   Contact Search Hover / Focus Overlay (Enhancement)
========================= */

#spcrm-app .spcrm-dd-item,
#spcrm-modals .spcrm-dd-item {
  position: relative;
}

/* Hover feedback */
#spcrm-app .spcrm-dd-item,
#spcrm-modals .spcrm-dd-item:hover {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.35);
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  transform: translateY(-1px);
}

/* Keyboard focus (accessibility) */
#spcrm-app .spcrm-dd-item,
#spcrm-modals .spcrm-dd-item:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(0,0,0,.15),
    0 6px 16px rgba(0,0,0,.12);
}

/* Left accent bar for clear selection */
#spcrm-app .spcrm-dd-item,
#spcrm-modals .spcrm-dd-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 4px;
  background: transparent;
  transition: background 120ms ease;
}

#spcrm-app .spcrm-dd-item,
#spcrm-modals .spcrm-dd-item:hover::before,
#spcrm-app .spcrm-dd-item,
#spcrm-modals .spcrm-dd-item:focus::before {
  background: #111;
}
/* =========================================================
   Contact dropdown is inside #spcrm-modals (NOT #spcrm-app),
   so we must style it there too.
========================================================= */

#spcrm-modals .spcrm-dd-item {
  padding: 10px 12px;   /* or whatever you had before */
  cursor: pointer;
}

/* Hover feedback */
#spcrm-modals .spcrm-dd-item:hover {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.35);
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  transform: translateY(-1px);
}

/* Keyboard focus (if we later add tabindex) */
#spcrm-modals .spcrm-dd-item:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(0,0,0,.15),
    0 6px 16px rgba(0,0,0,.12);
}

/* Left accent bar */
#spcrm-modals .spcrm-dd-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 4px;
  background: transparent;
  transition: background 120ms ease;
}

#spcrm-modals .spcrm-dd-item:hover::before,
#spcrm-modals .spcrm-dd-item:focus::before {
  background: #111;
}
/* CRM layout width control */
#spcrm-app {
  width: 100%;
  max-width: 1550px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}
/* =========================
   Mobile polish
========================= */
@media (max-width: 600px) {

  /* App container spacing */
  .spcrm-app, .spcrm-login, .spcrm-no-access {
    padding: 12px;
    border-radius: 12px;
  }

  /* Header/topbar stacks cleanly */
  .spcrm-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Tabs wrap and fill row */
  #spcrm-app .spcrm-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }
  #spcrm-app .spcrm-tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 10px 12px !important;
    font-size: 13px !important;
  }

  /* Pane padding slightly tighter */
  #spcrm-app .spcrm-pane {
    padding: 12px;
    border-radius: 14px;
  }

  /* Pane headers + toolbars stack */
  #spcrm-app .spcrm-pane-head {
    flex-direction: column;
    align-items: stretch;
  }

  /* Forms/buttons become easier to tap */
  .spcrm-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .spcrm-form-actions button,
  .spcrm-form-actions .spcrm-btn,
  #spcrm-app .spcrm-btn,
  #spcrm-app button {
    width: 100%;
  }

  /* Report preview table: allow horizontal scroll instead of squish */
  #spcrm-app table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Modals: slightly tighter top spacing */
  .spcrm-modal {
    top: 8px;
    width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 16px) !important;
  }
}

/* Hide WordPress theme layout for CRM page */

.page-id-7 .site-header,
.page-id-7 .site-footer,
.page-id-7 .entry-header,
.page-id-7 .entry-title {
  display: none !important;
}

/* Let the CRM page behave like a centered full-width app */
.page-id-7,
.page-id-7 body {
  width: 100%;
  max-width: none;
  overflow-x: hidden;
}

.page-id-7 .site-container,
.page-id-7 .site-inner,
.page-id-7 .wrap,
.page-id-7 .content-sidebar-wrap,
.page-id-7 .content,
.page-id-7 .entry,
.page-id-7 .entry-content {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

.page-id-7 .site-inner {
  min-height: 100vh;
  display: block !important;
  padding-top: 24px !important;
  padding-bottom: 24px !important;
}

.page-id-7 .entry-content {
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
}

/* Let the CRM dashboard breathe while staying centered */
.page-id-7 #spcrm-app {
  width: min(94vw, 1550px) !important;
  max-width: 1550px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* App-style background */
.page-id-7 {
  background: #f4f6f8;
}

/* SPCRM cookie/nonce recovery dialog */
.spcrm-cookie-help {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
}
.spcrm-cookie-help-card {
  width: min(440px, 100%);
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  padding: 24px;
  text-align: left;
}
.spcrm-cookie-help-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
}
.spcrm-cookie-help-card p {
  margin: 0 0 18px;
}
.spcrm-cookie-help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
/* =========================================================
   Robust Contacts / Companies Layout
========================================================= */

#spcrm-app .spcrm-record-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
  margin-bottom: 14px;
}

#spcrm-app .spcrm-record-avatar,
#spcrm-app .spcrm-contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-weight: 800;
  color: #111;
  background: #f28c28;
  border: 1px solid rgba(0,0,0,.08);
}

#spcrm-app .spcrm-company-avatar {
  border-radius: 14px;
}

#spcrm-app .spcrm-record-heading {
  min-width: 0;
  flex: 1;
}

#spcrm-app .spcrm-record-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

#spcrm-app .spcrm-record-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #667085;
  margin-bottom: 3px;
}

#spcrm-app .spcrm-record-subtitle {
  margin-top: 4px;
  color: #667085;
  font-size: 14px;
}

#spcrm-app .spcrm-record-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#spcrm-app .spcrm-record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 14px;
}

#spcrm-app .spcrm-record-section {
  padding: 16px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.035);
}

#spcrm-app .spcrm-record-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #344054;
  margin-bottom: 12px;
}

#spcrm-app .spcrm-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#spcrm-app .spcrm-info-item {
  padding: 12px;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 12px;
  background: #f9fafb;
}

#spcrm-app .spcrm-info-item span {
  display: block;
  font-size: 12px;
  color: #667085;
  margin-bottom: 4px;
}

#spcrm-app .spcrm-info-item strong {
  display: block;
  color: #111827;
  word-break: break-word;
}

#spcrm-app .spcrm-empty-note {
  color: #667085;
  line-height: 1.45;
}

#spcrm-app .spcrm-contact-card-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

#spcrm-app .spcrm-contact-card-body {
  min-width: 0;
  flex: 1;
}

#spcrm-app .spcrm-contact-company-line {
  margin-top: 2px;
  margin-bottom: 5px;
  color: #344054;
  font-size: 13px;
}

#spcrm-app .spcrm-count-pill {
  min-width: 28px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

#spcrm-app .spcrm-related-list {
  display: grid;
  gap: 10px;
}

#spcrm-app .spcrm-related-entry-card,
#spcrm-app .spcrm-company-contact-card {
  margin-top: 0 !important;
  cursor: pointer;
}

@media (max-width: 800px) {
  #spcrm-app .spcrm-record-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #spcrm-app .spcrm-record-actions {
    width: 100%;
  }

  #spcrm-app .spcrm-record-grid,
  #spcrm-app .spcrm-info-grid {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   Robust Layout Corrections
   Prevents detail cards from squeezing into unreadable columns
========================================================= */

#spcrm-app .spcrm-pane {
  min-width: 0;
}

#spcrm-app .spcrm-record-header,
#spcrm-app .spcrm-record-section,
#spcrm-app .spcrm-entry-card {
  min-width: 0;
}

#spcrm-app .spcrm-record-grid {
  grid-template-columns: 1fr !important;
  gap: 14px;
}

#spcrm-app .spcrm-info-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

#spcrm-app .spcrm-record-section-title {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  line-height: 1.25;
}

#spcrm-app .spcrm-info-item,
#spcrm-app .spcrm-info-item span,
#spcrm-app .spcrm-info-item strong,
#spcrm-app .spcrm-empty-note,
#spcrm-app .spcrm-record-subtitle {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word;
}

#spcrm-app .spcrm-record-header {
  align-items: flex-start;
}

#spcrm-app .spcrm-record-heading h2 {
  word-break: normal;
  overflow-wrap: break-word;
}

#spcrm-app .spcrm-contact-alert-inline {
  margin-bottom: 14px;
}

#spcrm-app .spcrm-related-list {
  width: 100%;
}
/* =========================================================
   Pipeline Dashboard
========================================================= */

#spcrm-app .spcrm-dashboard-subtitle {
  margin: 4px 0 0;
  color: #667085;
  font-size: 13px;
}

#spcrm-app .spcrm-pipeline-dashboard {
  display: grid;
  gap: 16px;
}

#spcrm-app .spcrm-pipeline-grid {
  display: grid;
  gap: 12px;
}

#spcrm-app .spcrm-pipeline-grid-cards {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

#spcrm-app .spcrm-pipeline-card,
#spcrm-app .spcrm-pipeline-panel {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.035);
}

#spcrm-app .spcrm-pipeline-card {
  padding: 14px;
}

#spcrm-app .spcrm-pipeline-card-label {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

#spcrm-app .spcrm-pipeline-card-value {
  margin-top: 6px;
  color: #111827;
  font-size: 28px;
  line-height: 1;
  font-weight: 850;
}

#spcrm-app .spcrm-pipeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 18px;
  align-items: start;
}

#spcrm-app .spcrm-pipeline-panel {
  padding: 16px;
  min-width: 0;
  overflow: hidden;
}

#spcrm-app .spcrm-pipeline-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

#spcrm-app .spcrm-pipeline-panel-head h4 {
  margin: 0;
  font-size: 16px;
}

#spcrm-app .spcrm-pipeline-panel-head span {
  color: #667085;
  font-size: 12px;
  text-align: right;
}

#spcrm-app .spcrm-pipeline-stage-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

#spcrm-app .spcrm-pipeline-stage-row-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#spcrm-app .spcrm-pipeline-stage {
  position: relative;
  padding: 12px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid rgba(0,0,0,.07);
}

#spcrm-app .spcrm-pipeline-stage span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

#spcrm-app .spcrm-pipeline-stage strong {
  font-size: 24px;
  line-height: 1;
}

#spcrm-app .spcrm-pipeline-bars {
  display: grid;
  gap: 12px;
}

#spcrm-app .spcrm-pipeline-bar-row {
  display: grid;
  gap: 6px;
}

#spcrm-app .spcrm-pipeline-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

#spcrm-app .spcrm-pipeline-bar-label strong {
  color: #111827;
}

#spcrm-app .spcrm-pipeline-bar-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2f7;
}

#spcrm-app .spcrm-pipeline-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #f28c28;
}

#spcrm-app .spcrm-pipeline-bar-extra,
#spcrm-app .spcrm-pipeline-note {
  color: #667085;
  font-size: 12px;
}

#spcrm-app .spcrm-pipeline-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9fafb;
}

#spcrm-app .spcrm-activity-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

#spcrm-app .spcrm-activity-summary > div {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid rgba(0,0,0,.06);
}

#spcrm-app .spcrm-activity-summary span {
  display: block;
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}

#spcrm-app .spcrm-activity-summary strong {
  font-size: 20px;
  line-height: 1;
}

#spcrm-app .spcrm-activity-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  color: #667085;
  font-size: 12px;
  margin-bottom: 8px;
}

#spcrm-app .spcrm-activity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#spcrm-app .spcrm-activity-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

#spcrm-app .spcrm-legend-total {
  background: #111827;
}

#spcrm-app .spcrm-legend-quotes {
  background: #f28c28;
}

#spcrm-app .spcrm-activity-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(22px, 1fr));
  align-items: end;
  gap: 6px;
  min-height: 230px;
  padding-top: 10px;
  width: 100%;
  min-width: 0;
}

#spcrm-app .spcrm-activity-day {
  display: grid;
  grid-template-rows: 150px auto auto auto;
  gap: 4px;
  align-items: end;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}

#spcrm-app .spcrm-activity-bar-wrap {
  position: relative;
  height: 150px;
  border-radius: 12px;
  background: #f2f4f7;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

#spcrm-app .spcrm-activity-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  min-height: 0;
  border-radius: 12px 12px 0 0;
  background: #111827;
}

#spcrm-app .spcrm-activity-quote-bar {
  position: absolute;
  left: 24%;
  bottom: 0;
  width: 52%;
  min-height: 0;
  border-radius: 999px 999px 0 0;
  background: #f28c28;
  z-index: 2;
}

#spcrm-app .spcrm-activity-day-label,
#spcrm-app .spcrm-activity-day-count,
#spcrm-app .spcrm-activity-quote-count {
  font-size: 10px;
  color: #667085;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
}

#spcrm-app .spcrm-activity-day-count {
  color: #111827;
  font-weight: 800;
}

#spcrm-app .spcrm-activity-quote-count {
  color: #9a5a13;
  font-size: 10px;
}

#spcrm-app .spcrm-pipeline-timeline {
  display: grid;
  gap: 12px;
}

#spcrm-app .spcrm-pipeline-timeline-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
}

#spcrm-app .spcrm-pipeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: #f28c28;
  box-shadow: 0 0 0 4px rgba(242,140,40,.15);
}

#spcrm-app .spcrm-pipeline-timeline-body {
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,.07);
}

#spcrm-app .spcrm-pipeline-timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

#spcrm-app .spcrm-pipeline-timeline-top span {
  color: #667085;
  white-space: nowrap;
}

#spcrm-app .spcrm-pipeline-timeline-title {
  margin-top: 3px;
  color: #111827;
  font-weight: 700;
  word-break: break-word;
}

#spcrm-app .spcrm-pipeline-timeline-meta {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
  word-break: break-word;
}

@media (max-width: 1000px) {
  #spcrm-app .spcrm-pipeline-layout {
    grid-template-columns: 1fr;
  }

  #spcrm-app .spcrm-pipeline-stage-row,
  #spcrm-app .spcrm-pipeline-stage-row-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #spcrm-app .spcrm-activity-chart {
    grid-template-columns: repeat(7, minmax(30px, 1fr));
  }
}

@media (max-width: 620px) {
  #spcrm-app .spcrm-pipeline-stage-row,
  #spcrm-app .spcrm-pipeline-stage-row-three,
  #spcrm-app .spcrm-activity-summary {
    grid-template-columns: 1fr;
  }

  #spcrm-app .spcrm-activity-chart {
    grid-template-columns: repeat(4, minmax(30px, 1fr));
  }
}
/* Final CRM centering fallback */
.page-id-7 #spcrm-app.spcrm-app {
  position: relative;
  left: auto;
  right: auto;
  transform: none;
  display: block;
}

.page-id-7 main,
.page-id-7 article,
.page-id-7 .site-main,
.page-id-7 .content-area,
.page-id-7 .hentry {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}