/* Misty-Land - CRM feature styles extracted from style.css */
/* ── CRM Table (customer list) ── */

/* ── CRM v2 (New Flow Shell) ─────────────────────────────────────────────── */
.crm-v2,
.crm-v2 *{
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
}

.crm-v2{
  --crm-border: rgba(224, 201, 138, 0.92);
  /* Base surfaces (what you called "how it was properly") */
  --crm-cream-1: #fbf7ef; /* panel surface */
  --crm-cream-2: #f5ede0; /* pill surface (stepper) */
  --crm-cream-3: #fffdf8; /* inner work surface */
  /* Accents (dropdown + action buttons in your design are more yellow) */
  --crm-cream-accent: #f4e5bf;
  --crm-text: #2b2320;
  --crm-sub: #8c7a63;
  --crm-accent: #6b1e2a;
}

.crm-v2-card{
  /* Keep breathing room so inner panels don't touch the outer card border */
  padding: 16px 18px 12px;
  min-height: calc(100% - 8px);
}

.crm-v2-grid{
  display: grid;
  grid-template-columns: 286px 1fr;
  gap: 16px;
  height: 100%;
  min-height: calc(100vh - 120px);
}

.crm-v2-left{
  border: 1px solid var(--crm-border);
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(rgba(251, 247, 239, 0.88), rgba(251, 247, 239, 0.88)),
    url("../../assets/background2.jpg") center/220px auto repeat;
  /* Avoid the "double border" look from inset shadows */
  box-shadow: none;
  display: flex;
  flex-direction: column;
  /* Center contents as a single unit (dropdown + avatar + info group) */
  align-items: center;
  gap: 0;
}

.crm-v2-selectWrap{
  border: 1px solid var(--crm-border);
  border-radius: 18px;
  /* Thicker pill like your Figma */
  padding: 14px 14px;
  background: var(--crm-cream-2);
  width: 100%;
  align-self: stretch;
  position: relative;
}

.crm-v2-selectLabel{
  font-size: .74rem;
  color: var(--crm-sub);
  margin-bottom: 6px;
}

.crm-v2-select{
  width: 100%;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--crm-text);
  outline: none;
  appearance: none;
  padding-right: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238c7a63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

/* Custom customer dropdown (replaces native <select>) */
.crm-v2-custBtn{
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--crm-text);
}
.crm-v2-custBtn:focus-visible{
  outline: 2px solid rgba(224,201,138,.95);
  outline-offset: 3px;
  border-radius: 12px;
}
.crm-v2-custChev{
  display: grid;
  place-items: center;
  color: var(--crm-sub);
  flex: 0 0 auto;
}
.crm-v2-custChev svg{ width: 18px; height: 18px; }
.crm-v2-custMenu{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 50;
  border: 1px solid var(--crm-border);
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 14px 34px rgba(0,0,0,.14);
  overflow: auto;
  max-height: 320px;
  padding: 6px;
}
.crm-v2-custOpt{
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 10px 10px;
  cursor: pointer;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-weight: 500;
  color: var(--crm-text);
  font-size: .94rem;
}
.crm-v2-custOpt:hover{
  background: rgba(244,229,191,.55);
  border-color: rgba(224,201,138,.75);
}
.crm-v2-custOpt.is-selected{
  background: rgba(244,229,191,.7);
  border-color: rgba(224,201,138,.95);
}
.crm-v2-custOpt:focus-visible{
  outline: 2px solid rgba(224,201,138,.95);
  outline-offset: 2px;
}

.crm-v2-avatar{
  width: 64px;
  height: 64px;
  border-radius: 999px;
  margin: 16px auto 10px;
  display: grid;
  place-items: center;
  font-weight: 500;
  color: #5a4033;
  background: rgba(217, 193, 154, 0.35);
  border: 1px solid var(--crm-border);
}

.crm-v2-info{
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* Treat all rows as one centered unit directly under the avatar */
  width: 100%;
  max-width: 214px;
  align-items: center;
}

.crm-v2-row{
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 13px;
  /* Figma layout: icon sits centered against the whole text block */
  align-items: center;
  /* Keep each row's text left-aligned within the centered group */
  width: min(204px, 100%);
}

.crm-v2-ico{
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--crm-accent);
}
.crm-v2-ico svg{ width: 18px; height: 18px; }

.crm-v2-k{
  font-weight: 500;
  color: var(--crm-text);
  font-size: .94rem;
}
.crm-v2-v{
  color: #5a4033;
  font-size: .99rem;
  line-height: 1.35;
  margin-top: 2px;
}

.crm-v2-main{
  border: 1px solid var(--crm-border);
  border-radius: 18px;
  padding: 16px;
  background: var(--crm-cream-1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.crm-v2-stageTabs{
  display: flex;
  gap: 0;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  margin-bottom: 12px;
}

.crm-v2-stageTab{
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 0 14px;
  height: 34px;
  border: 1px solid var(--crm-border);
  border-right: none;
  border-radius: 0;
  background: #ede6da;
  color: #6f5f49;
  cursor: pointer;
  position: relative;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.crm-v2-stageTab:first-child{
  border-radius: 8px 0 0 8px;
}

.crm-v2-stageTab:last-child{
  border-radius: 0 8px 8px 0;
  border-right: 1px solid var(--crm-border);
}

.crm-v2-stageTab:hover{
  background: #f0e8d8;
  color: var(--crm-text);
}

.crm-v2-stageTab.active{
  background: #fff;
  color: var(--crm-text);
  border-color: var(--crm-border);
  z-index: 1;
}

.crm-v2-stageTab.active:last-child{
  border-right: 1px solid var(--crm-border);
}

.crm-v2-actions{
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.crm-v2-actions--sidebar{
  width: min(220px, 100%);
  grid-template-columns: 1fr;
  margin-top: auto;
  margin-bottom: auto;
  gap: 14px;
}

.crm-v2-actionBtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  /* Figma: shorter pills */
  padding: 5px 10px;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid var(--crm-border);
  background: var(--crm-cream-accent);
  color: var(--crm-text);
  font-weight: 500;
  font-size: .86rem;
  cursor: pointer;
  min-width: 0;
}
.crm-v2-actionIco{
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.crm-v2-actionIco svg{ width: 16px; height: 16px; color: var(--crm-accent); }
.crm-v2-actionTxt{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-v2-actionBtn:hover{ filter: brightness(1.01); }

.crm-v2-actions--sidebar .crm-v2-actionBtn{
  justify-content: flex-start;
  padding: 8px 12px;
  min-height: 38px;
}

.crm-v2-work{
  margin-top: 0;
  border: 1px solid var(--crm-border);
  border-radius: 30px;
  background: #fff;
  padding: 20px 16px 16px;
  min-height: clamp(680px, 78vh, 940px);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow: hidden;
  box-shadow: none;
}
.crm-v2-work--calc{
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 0 4px;
  overflow: visible;
}
.crm-v2-work--calc .crm-v2-stageTabs{
  padding: 0 16px;
  margin-bottom: 10px;
}
.crm-v2-work--calc .crm-v2-carousel{
  margin-top: 0;
  padding-top: 0;
}
.crm-v2-work--calc .crm-v2-footer{
  margin-top: 14px;
  padding: 0 8px 0 0;
}

.crm-v2-workTop{
  display: none;
}
.crm-v2-workTitle{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  color: var(--crm-text);
  letter-spacing: .2px;
}
.crm-v2-workTitleDot{
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 800;
  background: var(--crm-text);
  color: #fff;
  flex: 0 0 auto;
}
.crm-v2-workTitleTxt{
  font-size: .96rem;
  font-weight: 900;
}

.crm-v2-plusBtn{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--crm-border);
  background: var(--crm-cream-accent);
  color: var(--crm-text);
  cursor: pointer;
}
.crm-v2-plusBtn svg{ width: 18px; height: 18px; }
.crm-v2-plusBtn:disabled{
  opacity: .45;
  cursor: not-allowed;
}
.crm-v2-plusBtn.is-locked{
  opacity: .52;
  cursor: pointer;
}
.crm-v2-plusBtn--inline{
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}
.crm-v2-plusBtn--between{
  position: absolute;
  top: 50%;
  right: -21px;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  z-index: 4;
}

.crm-v2-carousel{
  margin-top: 12px;
  display: flex;
  gap: 0;
  overflow: hidden;
  padding: 6px 0;
  flex: 1 1 auto;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
}
.crm-v2-carousel.is-calc-stage{
  align-items: center;
  justify-content: center;
}
.crm-v2-carousel.is-schedule-stage,
.crm-v2-carousel.is-doc-stage{
  align-items: stretch;
  justify-content: stretch;
  padding-top: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}
.crm-v2-calcItem{
  flex: 0 1 100%;
  /* No extra outer chrome: calculator itself is the card. */
  padding: 0;
  display: flex;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.crm-v2-calcItem--single{
  justify-content: center;
}
.crm-v2-calcMount{
  width: 100%;
  display: flex;
  min-height: 0;
  height: 100%;
  align-items: center;
  justify-content: center;
}
.crm-ecalc{
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  align-items: center;
}
.crm-ecalc .main-card{
  width: 100%;
  max-width: 1120px;
  left: 0;
  transform: none;
  border-radius: 18px;
  min-height: auto;
  height: auto;
  zoom: 0.82;
  background: #fff;
  box-shadow: none;
}
.crm-ecalc-card{
  box-shadow: none;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--crm-border);
}
.crm-ecalc-card--full{
  display: block;
}
.crm-ecalc-left{
  flex: 0 0 224px;
  min-width: 224px;
}
.crm-ecalc-leftCard{
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.crm-ecalc-reset{
  top: 14px;
  left: 14px;
}
.crm-ecalc-reset--inline{
  position: static;
  inset: auto;
  flex: 0 0 auto;
}
.crm-ecalc-right{
  padding: 10px 10px 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  height: 100%;
  max-height: none;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  background: #fff;
}
.crm-ecalc-right--full{
  width: 100%;
  padding: 12px 16px 0;
}
.crm-ecalc-right::-webkit-scrollbar{ width: 4px; }
.crm-ecalc-right::-webkit-scrollbar-track{ background: transparent; }
.crm-ecalc-right::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,0.12);
  border-radius: 999px;
}
.crm-ecalc-formCard{
  margin: 0 auto;
  padding-top: 18px;
  flex: 0 0 auto;
  background: #fff;
}
.crm-ecalc-formCard--full{
  width: min(100%, 1040px);
}
.crm-ecalc-headRow{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.crm-ecalc-right .calc-heading{
  margin-bottom: 0;
}
.crm-ecalc-projectSelector{
  margin-top: 0;
}
.crm-ecalc-left .calc-left-panel-main{
  justify-content: center;
  min-height: auto;
}
.crm-ecalc-left .calc-left-rates-toggle-wrap{
  margin-top: 8px;
  margin-bottom: 0;
  justify-content: center;
}
.crm-ecalc-left .calc-left-rates-toggle{
  width: 28px;
  height: 28px;
}
.crm-ecalc-left .calc-left-rates-toggle svg{
  width: 20px;
  height: 20px;
}
.crm-ecalc-right .form-row input,
.crm-ecalc-right .form-row select{
  font-size: 16px;
}
.crm-ecalc-right .form-row label{
  width: 160px;
  font-size: 16px;
}
.crm-ecalc-right .calc-select-wrap select{
  font-size: 16px;
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  display: block;
  box-sizing: border-box;
}
.crm-ecalc-right .calc-select-wrap{
  width: min(100%, 40rem);
  max-width: 40rem;
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  box-sizing: border-box;
}
.crm-ecalc-right .form-row input{
  width: min(100%, 22rem);
  max-width: 22rem;
  flex: 0 1 22rem;
}
.crm-ecalc-right .pill-group{
  flex: 0 1 18rem;
  max-width: 18rem;
}
.crm-ecalc-right .circle-group{
  flex: 0 1 18rem;
  max-width: 18rem;
}
.crm-ecalc-right .pill-group .option-pill{
  font-size: 15px;
}
.crm-ecalc-right .circle-btn{
  font-size: 15px;
}
.crm-ecalc-right .calc-heading{
  font-size: 17px;
}
.crm-ecalc-right .advanced-toggle{
  font-size: 15px;
}

/* ── CRM document studio ─────────────────────────────────────────────────── */
.crm-doc-overlay{
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  opacity: 0;
  transition: opacity .18s ease;
}
.crm-doc-overlay.crm-doc-overlay--open{
  opacity: 1;
}

.crm-doc-shell{
  width: min(980px, calc(100vw - 32px));
  height: calc(100vh - 56px);
  max-width: 100%;
  max-height: 100%;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,.86), rgba(255,255,255,.65)),
    linear-gradient(180deg, #f7efe1 0%, #efe0c2 100%);
  border: 1px solid rgba(224, 201, 138, 0.92);
  box-shadow: 0 24px 80px rgba(42,31,18,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.crm-doc-shell__topbar{
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(252,247,238,.92);
  border-bottom: 1px solid rgba(224, 201, 138, 0.8);
  backdrop-filter: blur(14px);
}

.crm-doc-shell__titleWrap{
  min-width: 0;
}

.crm-doc-shell__eyebrow{
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #9a8058;
  font-weight: 700;
}

.crm-doc-shell__title{
  margin: 4px 0 0;
  font-size: 1.18rem;
  line-height: 1.2;
  color: #2b2320;
}

.crm-doc-shell__actions{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.crm-doc-shell__status{
  min-width: 110px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(248,238,215,.95);
  border: 1px solid rgba(224, 201, 138, 0.9);
  color: #6b5a43;
  font-size: .84rem;
  font-weight: 600;
  text-align: center;
}

.crm-doc-shell__btn{
  border: 1px solid rgba(224, 201, 138, 0.92);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.crm-doc-shell__btn--ghost{
  background: #fffaf0;
  color: #2b2320;
}

.crm-doc-shell__btn--primary{
  background: #6b1e2a;
  color: #fff;
  border-color: rgba(107, 30, 42, 0.96);
}

.crm-doc-shell__btn:disabled{
  cursor: wait;
  opacity: .75;
}

.crm-doc-shell__body{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 6px 24px;
}

.crm-doc-shell__stack{
  width: max-content;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.crm-doc-page{
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(42,31,18,.10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.crm-doc-page__header{
  padding: 10px 18px 6px;
  border-bottom: 1px solid rgba(44,32,24,.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.crm-doc-page__headerImg{
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.crm-doc-page__body{
  flex: 1 1 auto;
  overflow: hidden;
}

.crm-doc-page__content{
  min-height: 0;
}

.crm-doc-page__footer{
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #65574b;
}

.crm-doc-block{
  color: #1f1916;
  line-height: 1.68;
  font-size: 14.5px;
  outline: none;
  padding: 2px 0;
  border-radius: 4px;
}

.crm-doc-block + .crm-doc-block{
  margin-top: 8px;
}

.crm-doc-block[data-doc-editable="true"]:focus{
  background: rgba(248,238,215,.35);
  box-shadow: 0 0 0 2px rgba(224, 201, 138, 0.5);
}

.crm-doc-block[data-doc-editable="true"]{
  cursor: text;
}

.crm-doc-block__heading{
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .03em;
}

.crm-doc-block__meta{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 13.5px;
  font-weight: 700;
}

.crm-doc-block__paragraph{
  white-space: normal;
  line-height: 1.74;
}

.crm-doc-block__sectionTitle{
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b1e2a;
}

.crm-doc-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.72;
  color: #000;
}

.crm-doc-table th,
.crm-doc-table td{
  border: 1px solid #000;
  padding: 10px 12px;
  vertical-align: top;
  background: #fff;
  color: #000;
}

.crm-doc-table th{
  text-align: left;
  font-weight: 700;
}

.crm-doc-bankGrid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.crm-doc-bankCard{
  padding: 0;
  background: transparent;
}

.crm-doc-bankCard > div + div{
  margin-top: 6px;
}

.crm-doc-signatures{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 10px;
  padding-top: 26px;
}

.crm-doc-signature{
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}

.crm-doc-signature__line{
  border-top: 1px solid rgba(44,32,24,.48);
}

.crm-doc-signature__title{
  font-size: 13px;
  font-weight: 700;
  color: #6b5a43;
}

.crm-doc-annexure{
  border-top: 1px dashed rgba(44,32,24,.18);
  margin-top: 8px;
  padding-top: 14px;
}

.crm-doc-fill{
  font-weight: 700;
}

.crm-doc-label{
  font-weight: 700;
}

.crm-doc-value{
  font-weight: 700;
}

.crm-doc-block--annexureTitle{
  margin-top: 6px;
}

.crm-doc-block--docTitle{
  margin-top: -2px;
  margin-bottom: 10px;
}

.crm-doc-block--annexureTitle .crm-doc-block__heading,
.crm-doc-block--docTitle .crm-doc-block__heading{
  font-size: 16px;
  letter-spacing: .02em;
}

.crm-doc-block--metaRow{
  margin-bottom: 18px;
}

.crm-doc-block--intro{
  margin-bottom: 12px;
}

.crm-doc-block--intro .crm-doc-block__paragraph{
  line-height: 1.8;
}

.crm-doc-block--subject{
  margin-bottom: 16px;
}

.crm-doc-block--greeting{
  margin-bottom: 10px;
}

.crm-doc-clause__head{
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  font-weight: 700;
}

.crm-doc-clause__num{
  text-align: right;
}

.crm-doc-clause__title{
  font-weight: 700;
}

.crm-doc-clause__body{
  margin-top: 6px;
  padding-left: 30px;
  text-align: left;
  line-height: 1.74;
}

.crm-doc-subclause{
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
  padding-left: 30px;
}

.crm-doc-subclause__num{
  text-align: right;
  font-weight: 700;
}

.crm-doc-subclause__body{
  min-width: 0;
  line-height: 1.74;
}

.crm-doc-romanList{
  padding-left: 30px;
  display: grid;
  gap: 7px;
}

.crm-doc-romanList__item{
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: start;
}

.crm-doc-romanList__num{
  text-align: right;
  font-weight: 700;
}

.crm-doc-block--note{
  padding-left: 30px;
  font-size: 12.6px;
  line-height: 1.42;
}

.crm-doc-block--continuation{
  padding-left: 30px;
}

.crm-doc-block--scheduleHeading{
  margin-top: 10px;
  margin-bottom: 4px;
}

.crm-doc-block--scheduleHeading .crm-doc-block__heading{
  font-size: 15px;
}

.crm-doc-block--scheduleColumns .crm-doc-bankCard{
  font-size: 14.5px;
  line-height: 1.74;
  color: #000;
}

.crm-doc-block--scheduleColumns .crm-doc-block__sectionTitle{
  margin-bottom: 10px;
  color: #000;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14.5px;
}

.crm-doc-block--scheduleColumns .crm-doc-bankCard > div{
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px;
  align-items: start;
}

.crm-doc-block--tableLegal .crm-doc-table th,
.crm-doc-block--tableLegal .crm-doc-table td,
.crm-doc-block--tableAnnexure .crm-doc-table th,
.crm-doc-block--tableAnnexure .crm-doc-table td{
  padding: 10px 12px;
}

.crm-doc-block--tableLegal .crm-doc-table td:first-child{
  width: 54px;
}

.crm-doc-block--tableLegal .crm-doc-table td:last-child{
  width: 168px;
}

.crm-doc-block--signatureMeta{
  margin-top: 10px;
  line-height: 1.6;
}

.crm-doc-block--confirmationHeading{
  margin-top: 26px;
  margin-bottom: 14px;
}

.crm-doc-block--confirmationHeading .crm-doc-block__heading{
  font-size: 15px;
}

.crm-doc-block--confirmationIntro{
  text-align: left;
  margin-bottom: 18px;
}

.crm-doc-block--annexureA{
  margin-top: 22px;
}

.crm-doc-block--annexureA .crm-doc-block__heading{
  font-size: 15px;
}

.crm-doc-block--annexureASub{
  text-align: center;
  margin-bottom: 10px;
}

.crm-doc-block--tableAnnexure .crm-doc-table td:first-child{
  width: 46px;
}

.crm-doc-block--tableAnnexure .crm-doc-table td:last-child{
  width: 110px;
}

.crm-doc-block--directorSign{
  margin-top: 18px;
  padding-left: 8px;
}

.crm-doc-missing{
  position: relative;
  width: min(760px, calc(100% - 40px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  border-radius: 24px;
  background: #fffdf8;
  border: 1px solid rgba(224, 201, 138, 0.92);
  box-shadow: 0 20px 64px rgba(42,31,18,.18);
  padding: 28px 28px 24px;
}

.crm-doc-missing__eyebrow{
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #9a8058;
  font-weight: 700;
}

.crm-doc-missing__title{
  margin: 10px 0 6px;
  font-size: 1.5rem;
  color: #2b2320;
}

.crm-doc-missing__sub{
  margin: 0;
  color: #6b5a43;
  line-height: 1.5;
}

.crm-doc-missing__groups{
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.crm-doc-missing__group{
  border: 1px solid rgba(224, 201, 138, 0.75);
  border-radius: 18px;
  padding: 16px;
  background: #fff9ef;
}

.crm-doc-missing__groupHead{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.crm-doc-missing__groupStage{
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9a8058;
  font-weight: 700;
}

.crm-doc-missing__groupSection{
  margin-top: 2px;
  font-size: 1rem;
  font-weight: 800;
  color: #2b2320;
}

.crm-doc-missing__jump{
  border: 1px solid rgba(224, 201, 138, 0.92);
  background: #6b1e2a;
  color: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.crm-doc-missing__list{
  margin: 14px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.crm-doc-missing__list li{
  color: #5b4936;
}

.crm-doc-missing__list span{
  display: block;
  color: #7f6c58;
  margin-top: 2px;
}

.crm-doc-missing__list strong{
  color: #2b2320;
}

.crm-doc-missing-overlay{
  align-items: center;
  justify-content: center;
  padding: 20px;
}

@media (max-width: 960px){
  .crm-doc-overlay{
    padding: 10px;
  }

  .crm-doc-shell{
    border-radius: 20px;
  }

  .crm-doc-shell__topbar{
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .crm-doc-shell__actions{
    width: 100%;
    justify-content: flex-start;
  }

  .crm-doc-shell__body{
    padding: 18px 10px 26px;
  }

  .crm-doc-shell__stack{
    transform-origin: top center;
    transform: scale(.86);
    margin-top: -44px;
    margin-bottom: -90px;
  }

  .crm-doc-bankGrid,
  .crm-doc-signatures{
    grid-template-columns: 1fr;
  }

  .crm-doc-missing{
    width: calc(100% - 20px);
    padding: 22px 18px 18px;
  }

  .crm-doc-missing__groupHead{
    flex-direction: column;
    align-items: stretch;
  }
}
.crm-ecalc-right .calc-output-placeholder,
.crm-ecalc-right .calc-output-placeholder span{
  font-size: 14px;
}
.crm-ecalc-right .calc-rr-total-row{
  display: contents;
}
.crm-ecalc-right .generate-btn{
  display: none !important;
}
.crm-ecalc-placeholder{
  margin: 10px 16px 0;
  text-align: center;
  font-size: 13px;
}
.crm-ecalc-output .output-card{
  margin-top: 0;
  background: #fff !important;
  border: 1px solid var(--crm-border);
  box-shadow: none !important;
}
.crm-ecalc-output{
  margin: 18px auto 0;
  padding-bottom: 18px;
  flex: 0 0 auto;
  width: min(100%, 1040px);
}
.crm-ecalc .calc-output-placeholder{
  margin: 0 auto;
  width: min(100%, 1040px);
}
.crm-ecalc-placeholder[hidden]{
  display: none !important;
}
.crm-ecalc-output .calc-output-placeholder{
  margin-top: 0;
  padding-top: 18px;
  padding-bottom: 8px;
}
.crm-ecalc-output .ps-title{
  font-size: 21px;
}
.crm-ecalc-output .ps-subtitle{
  font-size: 13px;
}
.crm-ecalc-output .ps-meta{
  font-size: 12px;
}
.crm-ecalc-output .ps-section{
  font-size: 13px;
}
.crm-ecalc-output .ps-table{
  font-size: 14px;
}
.crm-ecalc-output .ps-table thead th{
  font-size: 13px;
}
.crm-ecalc-output .ps-table tbody td{
  font-size: 14px;
}
.crm-ecalc-output .ps-table--2col .ps-key{
  font-size: 14px;
}
.crm-ecalc-output .ps-table--2col .ps-val{
  font-size: 14px;
}
.crm-ecalc-output .ps-grand-label,
.crm-ecalc-output .ps-grand-value{
  font-size: 14px;
}

.crm-v2-footer{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}
.crm-v2-primaryBtn{
  padding: 10px 14px;
  border-radius: 999px;
}

.crm-v2-empty{
  padding: 20px 8px;
  color: #8c7a63;
  font-weight: 700;
}

.crm-v2-schedule{
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  flex: 0 0 auto;
}

.crm-v2-scheduleTop{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-v2-scheduleMeta{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crm-v2-scheduleLabel{
  font-size: .84rem;
  font-weight: 800;
  color: var(--crm-sub);
}

.crm-v2-schedulePrice{
  font-size: .94rem;
  color: var(--crm-text);
}

.crm-v2-tableAction{
  border: 1px solid var(--crm-border);
  background: var(--crm-cream-accent);
  color: var(--crm-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
}

.crm-v2-scheduleTableWrap{
  border: 1px solid rgba(224, 201, 138, 0.9);
  border-radius: 8px;
  overflow: visible;
  background: #fffdf8;
  min-height: 0;
  flex: 0 0 auto;
  max-height: none;
  height: auto;
  padding-bottom: 0;
  scroll-padding-bottom: 0;
}

.crm-v2-scheduleTable{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 740px;
  table-layout: fixed;
  font-family: var(--font-primary);
  font-size: 13px;
}

.crm-v2-scheduleTable th,
.crm-v2-scheduleTable td{
  border-bottom: 1px solid var(--border-light);
  padding: 8px 10px;
  vertical-align: middle;
}

.crm-v2-scheduleTable th:nth-child(1),
.crm-v2-scheduleTable td:nth-child(1){
  width: 34px;
}

.crm-v2-scheduleTable th:nth-child(2),
.crm-v2-scheduleTable td:nth-child(2){
  width: 102px;
}

.crm-v2-scheduleTable th:nth-child(3),
.crm-v2-scheduleTable td:nth-child(3){
  width: auto;
}

.crm-v2-scheduleTable th:nth-child(4),
.crm-v2-scheduleTable td:nth-child(4){
  width: 104px;
}

.crm-v2-scheduleTable th:nth-child(5),
.crm-v2-scheduleTable td:nth-child(5){
  width: 82px;
}

.crm-v2-scheduleTable th:nth-child(6),
.crm-v2-scheduleTable td:nth-child(6){
  width: 122px;
}

.crm-v2-scheduleTable th:nth-child(7),
.crm-v2-scheduleTable td:nth-child(7){
  width: 70px;
}

.crm-v2-scheduleTable th{
  position: sticky;
  top: 0;
  background: #f0e8d8;
  color: var(--text-dark);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  border-bottom: 2px solid var(--primary-gold);
  z-index: 1;
}
.crm-v2-scheduleTable thead tr th:first-child{
  border-radius: 7px 0 0 0;
}
.crm-v2-scheduleTable thead tr th:last-child{
  border-radius: 0 7px 0 0;
}

.crm-v2-scheduleRow.is-dragging{
  opacity: .55;
}

.crm-v2-dragCell{
  width: 44px;
  text-align: center;
}

.crm-v2-dragHandle{
  border: 0;
  background: transparent;
  color: var(--crm-sub);
  cursor: grab;
  font-size: 1rem;
  letter-spacing: 1px;
}

.crm-v2-cellInput,
.crm-v2-cellSelect{
  width: 100%;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #3a2a10;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
  box-sizing: border-box;
  display: block;
  transition: border-color .1s, background .1s, box-shadow .1s;
}

.crm-v2-inputSuffixWrap{
  position: relative;
  width: 100%;
  display: block;
}

.crm-v2-inputSuffixWrap .crm-v2-cellInput{
  padding-right: 28px;
}

.crm-v2-inputSuffix{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 500;
  color: var(--crm-sub);
  pointer-events: none;
  line-height: 1;
  z-index: 1;
}

.crm-v2-cellInput:focus,
.crm-v2-cellSelect:focus{
  outline: none;
  border-color: #b09060;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(176,144,96,.18);
}
.crm-v2-cellInput:hover,
.crm-v2-cellSelect:hover{
  border-color: #b09060;
  background: rgba(255,255,255,.55);
}

.crm-v2-cellInput--date{
  min-width: 104px;
}

.crm-v2-cellInput--num{
  min-width: 82px;
}

.crm-v2-statusSelect{
  font-weight: 600;
  cursor: pointer;
  border-color: #d9c19a;
  border-radius: 6px;
  height: 22px;
  padding: 0 6px;
  margin: 0 4px;
  width: calc(100% - 8px);
}

.crm-v2-statusSelect--completed{
  background: #e7f4e7;
  color: #3a6b3a;
  border-color: #8fbc8f;
}

.crm-v2-statusSelect--pending{
  background: #f0e9d8;
  color: #7a5c28;
  border-color: #d9c19a;
}

.crm-v2-rowActions{
  width: 78px;
  text-align: center;
  white-space: nowrap;
}

.crm-v2-iconBtn{
  width: 27px;
  height: 27px;
  border-radius: 999px;
  border: 1px solid rgba(160, 120, 64, 0.44);
  background: rgba(255, 250, 240, 0.35);
  color: var(--text-brown);
  cursor: pointer;
  font-weight: 700;
}

.crm-v2-iconBtn--danger{
  color: #8b3340;
}

.crm-v2-totalRow td{
  background: #fbf7ef;
  font-weight: 400;
  color: var(--text-brown);
  position: static;
  box-shadow: none;
}

.crm-v2-totalRow.is-invalid td{
  background: #fff0f0;
  color: #8b2e2e;
}

.crm-v2-docStage{
  width: 100%;
  min-height: 0;
  height: 100%;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0 10px;
  scrollbar-width: thin;
}

.crm-v2-docForm{
  min-height: 0;
  overflow: visible;
}

.crm-v2-docForm{
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(100%, 940px);
  margin: 0 auto;
}

.crm-v2-docWizard{
  width: min(100%, 980px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.crm-v2-docRail{
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
}

.crm-v2-docRailItem{
  border: 1px solid rgba(224, 201, 138, 0.7);
  border-radius: 16px;
  background: #fffdf8;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.crm-v2-docRailItem:hover{
  border-color: rgba(224, 201, 138, 0.95);
  background: #fdf8ed;
}

.crm-v2-docRailItem.is-active{
  background: var(--crm-cream-2);
  border-color: var(--crm-border);
  box-shadow: 0 8px 20px rgba(182, 155, 95, 0.08);
}

.crm-v2-docRailItem.is-done .crm-v2-docRailDot{
  background: #84b08a;
  border-color: #84b08a;
  color: #fff;
}

.crm-v2-docRailDot{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--crm-border);
  display: grid;
  place-items: center;
  font-size: .86rem;
  font-weight: 800;
  color: var(--crm-sub);
  background: #fffdfa;
}

.crm-v2-docRailBody{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.crm-v2-docRailTitle{
  font-size: .9rem;
  font-weight: 400;
  color: var(--crm-text);
}

.crm-v2-docRailSub{
  font-size: .74rem;
  color: var(--crm-sub);
  line-height: 1.3;
}

.crm-v2-docPane{
  min-width: 0;
}

.crm-v2-docSection{
  border: 1px solid var(--crm-border);
  border-radius: 18px;
  background: #fffdf8;
  padding: 16px;
}

.crm-v2-docSection--wizard{
  min-height: 100%;
}

.crm-v2-docSectionHead{
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--crm-text);
  margin-bottom: 4px;
}

.crm-v2-docSectionSub{
  font-size: .82rem;
  color: var(--crm-sub);
  margin-bottom: 14px;
}

.crm-v2-docGrid{
  display: grid;
  gap: 12px;
}

.crm-v2-docGrid--two{
  grid-template-columns: 1fr;
}

.crm-v2-docGrid--three{
  grid-template-columns: 1fr;
}

.crm-v2-docField{
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.crm-v2-docField--full{
  grid-column: 1 / -1;
}

.crm-v2-docField span{
  font-size: .9rem;
  font-weight: 500;
  color: var(--crm-text);
  letter-spacing: 0;
  text-transform: none;
}

.crm-v2-docField input,
.crm-v2-docField textarea{
  width: 100%;
  border: 1px solid rgba(224, 201, 138, 0.9);
  border-radius: 14px;
  background: #fffdfa;
  color: var(--crm-text);
  padding: 10px 12px;
  font-size: .94rem;
  line-height: 1.35;
  resize: vertical;
}

.crm-v2-docField textarea{
  min-height: 92px;
}

.crm-v2-docField:has(textarea){
  align-items: start;
}

.crm-v2-docField input[readonly]{
  background: #f8f2e5;
  color: #6f5d49;
}

.crm-v2-docField input:focus,
.crm-v2-docField textarea:focus{
  outline: 2px solid rgba(224, 201, 138, 0.45);
  outline-offset: 1px;
}

@media (max-width: 980px){
  .crm-v2-grid{ grid-template-columns: 1fr; }
  .crm-v2-actions{ grid-template-columns: 1fr 1fr; }
  .crm-v2-stageTabs{
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .crm-v2-stageTabs::-webkit-scrollbar{
    display: none;
  }
  .crm-v2-stageTab{
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .crm-v2-docWizard{
    grid-template-columns: 1fr;
  }
  .crm-v2-docRail{
    position: static;
  }
}

@media (max-width: 560px){
  .crm-v2-actions{ grid-template-columns: 1fr; }
  .crm-v2-docGrid--two,
  .crm-v2-docGrid--three{
    grid-template-columns: 1fr;
  }
  .crm-v2-docField{
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
.crm-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding: 0 4px 12px;
}

.crm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .875rem;
}

.crm-th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f5ede0;
  font-family: var(--font-primary);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #7a6048;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #e0c98a;
  white-space: nowrap;
}

.crm-th:first-child { padding-left: 18px; }

.crm-row {
  cursor: pointer;
  transition: background .12s;
}
.crm-row:hover { background: #faf5eb; }
.crm-row:nth-child(even) { background: #fdfaf6; }
.crm-row:nth-child(even):hover { background: #faf5eb; }

.crm-td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0e6d2;
  vertical-align: middle;
  color: #3d2e1e;
}
.crm-td:first-child { padding-left: 18px; }

.crm-td--name { min-width: 160px; }
.crm-td--amount { font-weight: 600; color: #5a3e28; }

.crm-name {
  font-weight: 600;
  font-family: var(--font-primary);
  color: #3d2e1e;
  font-size: .9rem;
}
.crm-phone { font-size: .8rem; color: #9b8770; margin-top: 2px; }
.crm-sub   { font-size: .78rem; color: #9b8770; }

.crm-status {
  display: inline-block;
  font-size: .75rem;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.crm-status--ok      { background: #e2f0e2; color: #3b7a3b; border: 1px solid #b8d9b8; }
.crm-status--pending { background: #fef3e2; color: #a06a20; border: 1px solid #f0d5a0; }

/* ── CRM Detail page ── */
.crm-detail-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #ede3ce;
  flex-shrink: 0;
}

.crm-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  padding: 7px 13px;
  white-space: nowrap;
}

.crm-detail-title {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 1.2rem;
  color: #3d2e1e;
  font-weight: 700;
}

/* ── Tabs ── */
.crm-tabs {
  display: flex;
  gap: 0;
  padding: 0 18px;
  border-bottom: 1px solid #ede3ce;
  background: #fdfaf6;
  overflow-x: auto;
}

.crm-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 18px;
  font-family: var(--font-primary);
  font-size: .85rem;
  color: #9b8770;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.crm-tab:hover        { color: #5a3e28; }
.crm-tab--active      { color: #5a3e28; border-bottom-color: #c8962a; font-weight: 600; }

/* ── Profile grid ── */
.crm-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.crm-section-card {
  background: #fdfaf6;
  border: 1px solid #e8d9b5;
  border-radius: 12px;
  padding: 16px 18px;
}

.crm-section-head {
  font-family: var(--font-primary);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9b8770;
  margin-bottom: 12px;
}

.crm-field-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f0e6d2;
}
.crm-field-row:last-child { border-bottom: none; }

.crm-field-label {
  font-size: .78rem;
  color: #9b8770;
  min-width: 100px;
  flex-shrink: 0;
  font-weight: 500;
}

.crm-field-value {
  font-size: .85rem;
  color: #3d2e1e;
  word-break: break-word;
}

.crm-field-input {
  flex: 1;
  font-size: .85rem;
  color: #3d2e1e;
  background: #fffdf8;
  border: 1px solid #ddd0b0;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: inherit;
  transition: border-color .15s;
  min-width: 0;
}
.crm-field-input:focus {
  outline: none;
  border-color: #c8962a;
  box-shadow: var(--shadow-focus);
}

.crm-toggle-label {
  font-size: .82rem;
  color: #7a6048;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-top: 6px;
}

.crm-empty-note {
  font-size: .82rem;
  color: #9b8770;
  font-style: italic;
  margin: 0;
}

/* ── No profile state ── */
.crm-no-profile {
  text-align: center;
  padding: 48px 24px;
  color: #9b8770;
}
.crm-no-profile p { margin: 0 0 18px; font-size: .95rem; }

/* ── Coming soon placeholder ── */
.crm-coming-soon {
  text-align: center;
  padding: 40px 24px;
  background: #fdfaf6;
  border-radius: 12px;
  border: 1px dashed #d8c898;
  color: #9b8770;
}

/* ── CRM Summary / Units ── */
.crm-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.crm-summary-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 120px;
  padding: 10px 14px;
  background: #fdfaf6;
  border: 1px solid #e8d9b5;
  border-radius: 10px;
}
.crm-summary-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9b8770;
}
.crm-summary-chip strong {
  font-size: .95rem;
  color: #3d2e1e;
}
.crm-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.crm-unit-card {
  appearance: none;
  border: 1px solid #e8d9b5;
  background: #fffdf8;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .15s, background .15s;
}
.crm-unit-card:hover {
  transform: translateY(-1px);
  border-color: #d3b05e;
  box-shadow: 0 6px 18px rgba(201,150,42,.08);
}
.crm-unit-card--active {
  border-color: #c8962a;
  background: #fff7e8;
  box-shadow: 0 0 0 1px rgba(200,150,42,.12) inset;
}
.crm-unit-card-title {
  font-weight: 700;
  color: #3d2e1e;
  font-size: .88rem;
  margin-bottom: 6px;
}
.crm-unit-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: .74rem;
  color: #9b8770;
}
.crm-unit-card-amt {
  margin-top: 10px;
  font-weight: 700;
  color: #5a3e28;
}
.crm-unit-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.crm-unit-switcher-btn {
  border: 1px solid #e0c98a;
  background: #fdfaf6;
  color: #7a6048;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .78rem;
  cursor: pointer;
}
.crm-unit-switcher-btn--active {
  background: #c8962a;
  border-color: #c8962a;
  color: #fff;
}

/* ── Payment preview ── */
.crm-payment-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 20px;
  background: #f5ede0;
  border-radius: 8px;
  border: 1px solid #e8d9b5;
}
.crm-pay-label { font-size: .82rem; color: #9b8770; }
.crm-pay-val   { font-size: 1rem; font-weight: 700; color: #5a3e28; }

/* ── Documents list ── */
.crm-doc-list { display: flex; flex-direction: column; gap: 10px; }
.crm-doc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #fdfaf6;
  border: 1px solid #e8d9b5;
  border-radius: 10px;
}
.crm-doc-icon { font-size: 1.4rem; flex-shrink: 0; }
.crm-doc-info { flex: 1; }
.crm-doc-name { font-weight: 600; font-size: .9rem; color: #3d2e1e; }
.crm-doc-meta { font-size: .78rem; color: #9b8770; margin-top: 2px; }
.crm-doc-btn  { flex-shrink: 0; }

/* ── Lead history (timeline) ── */
.crm-history-list { display: flex; flex-direction: column; gap: 12px; }
.crm-hist-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: #fdfaf6;
  border: 1px solid #f0e6d2;
  border-radius: 10px;
}
.crm-hist-icon   { font-size: 1.1rem; flex-shrink: 0; padding-top: 1px; }
.crm-hist-body   { flex: 1; min-width: 0; }
.crm-hist-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.crm-hist-type   { font-weight: 600; font-size: .85rem; color: #3d2e1e; }
.crm-hist-meta   { font-size: .75rem; color: #9b8770; white-space: nowrap; }
.crm-hist-remark { font-size: .85rem; color: #5a4030; margin-top: 4px; line-height: 1.4; }
.crm-hist-stage  { font-size: .78rem; color: #7a6048; margin-top: 4px; font-style: italic; }
.crm-hist-followup { font-size: .78rem; color: #c8962a; margin-top: 3px; }

/* ── Payment tab ────────────────────────────────────────────── */
.pay-summary-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.pay-summary-card {
  flex: 1;
  min-width: 110px;
  background: #fdfaf6;
  border: 1px solid #e8d9b5;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.pay-summary-label { font-size: .72rem; color: #9b8770; text-transform: uppercase; letter-spacing: .05em; }
.pay-summary-value { font-size: 1.05rem; font-weight: 700; color: #3d2e1e; margin-top: 4px; }
.pay-summary-value--green { color: #2e6e2e; }
.pay-summary-value--red   { color: #a02828; }

.pay-table-wrap { overflow-x: auto; margin-bottom: 8px; }
.pay-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.pay-th {
  text-align: left;
  padding: 8px 10px;
  background: #f5ede0;
  color: #7a6048;
  font-size: .73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid #e8d9b5;
  white-space: nowrap;
}
.pay-td {
  padding: 10px 10px;
  border-bottom: 1px solid #f0e6d2;
  color: #3d2e1e;
  vertical-align: middle;
}
.pay-tr:hover { background: #faf5ee; }

.pay-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.pay-badge--paid    { background: #e0f0e0; color: #2a6a2a; }
.pay-badge--partial { background: #fff0d0; color: #8a5010; }
.pay-badge--overdue { background: #fde8e8; color: #9a2020; }
.pay-badge--pending { background: #f0ece4; color: #7a6048; }

.pay-add-row-btn { font-size: .8rem; padding: 6px 14px; margin-top: 8px; }

.pay-record-btn {
  position: sticky;
  bottom: 16px;
  float: right;
  background: #c8962a;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 11px 22px;
  font-family: var(--font-primary);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(180,130,40,.35);
  transition: background .15s, transform .1s;
}
.pay-record-btn:hover { background: #b07820; transform: translateY(-1px); }

.pay-gen-cta {
  text-align: center;
  padding: 32px 24px;
  background: #fdfaf6;
  border: 1px dashed #d8c898;
  border-radius: 12px;
  margin-bottom: 20px;
}
.pay-gen-cta p { margin: 0 0 14px; color: #7a6048; font-size: .9rem; }

.pay-receipts-head {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9b8770;
  margin: 24px 0 10px;
}
.pay-receipt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fdfaf6;
  border: 1px solid #f0e6d2;
  border-radius: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.pay-rcpt-amount { font-weight: 700; color: #2e6e2e; font-size: .95rem; }
.pay-rcpt-mode   { font-size: .75rem; background: #f0e6d2; padding: 2px 8px; border-radius: 10px; color: #7a6048; flex-shrink: 0; }
.pay-rcpt-meta   { font-size: .75rem; color: #9b8770; margin-left: auto; }
.pay-rcpt-ref    { font-size: .75rem; color: #9b8770; font-style: italic; }

/* ── Record payment modal ── */
.pay-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.48);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pay-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.pay-modal-title {
  font-family: var(--font-primary);
  font-size: 1.1rem;
  font-weight: 700;
  color: #3d2e1e;
  margin: 0 0 20px;
}
.pay-modal-field { margin-bottom: 14px; }
.pay-modal-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: #7a6048;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pay-modal-input,
.pay-modal-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd0b0;
  border-radius: 8px;
  font-family: inherit;
  font-size: .9rem;
  color: #3d2e1e;
  background: #fffdf8;
  box-sizing: border-box;
  transition: border-color .15s;
}
.pay-modal-input:focus,
.pay-modal-select:focus { outline: none; border-color: #c8962a; box-shadow: var(--shadow-focus); }
.pay-modal-row { display: flex; gap: 10px; }
.pay-modal-row .pay-modal-field { flex: 1; }
.pay-modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* ── Admin — Payment Milestones ── */
.ms-project-row { margin-bottom: 14px; }
.ms-proj-select { width: 100%; max-width: 320px; }
.ms-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-bottom: 8px; }
.ms-th {
  text-align: left;
  padding: 7px 10px;
  background: #f5ede0;
  color: #7a6048;
  font-size: .73rem;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid #e8d9b5;
}
.ms-td { padding: 9px 10px; border-bottom: 1px solid #f0e6d2; color: #3d2e1e; }
.ms-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ms-add-row input { flex: 1; min-width: 80px; }
.ms-pct-input { max-width: 80px !important; flex: none !important; }
.ms-del-btn { background: none; border: none; color: #c05050; cursor: pointer; font-size: 1rem; padding: 2px 6px; }
.ms-del-btn:hover { color: #901010; }
.ms-total-bar { font-size: .82rem; color: #9b8770; padding: 6px 10px; }
.ms-total-bar strong { color: #3d2e1e; }
.ms-empty { font-size: .85rem; color: #9b8770; font-style: italic; padding: 12px 10px; }

/* ============================================================
   === END CRM MODULE =========================================
   ============================================================ */
