body.crm-view-active,
body.crm-view-active .shell,
body.crm-view-active .workspace,
body.crm-view-active .main {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #f6f8fb;
}

.crm-budget-card {
  display: grid;
  gap: 14px;
}

.crm-budget-card form,
.crm-budget-history {
  display: grid;
  gap: 10px;
}

.crm-budget-card form label {
  display: grid;
  gap: 6px;
  color: #455468;
  font-size: 12px;
  font-weight: 800;
}

.crm-budget-card form input,
.crm-budget-card form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dce3ed;
  border-radius: 10px;
  padding: 9px 11px;
  color: #14213d;
  background: #fff;
}

.crm-budget-history > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 12px;
  border: 1px solid #dfe6ef;
  border-radius: 10px;
  background: #f8fafc;
}

.crm-budget-history strong,
.crm-budget-history span {
  grid-column: 1;
}

.crm-budget-history span,
.crm-budget-empty {
  color: #667085;
  font-size: 12px;
}

.crm-budget-history em {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: #14213d;
  font-style: normal;
  font-weight: 900;
}

body.crm-view-active .workspace {
  display: block !important;
}

body.crm-view-active .workspace > .sidebar,
body.crm-view-active .topbar,
body.crm-view-active .support-entry-fab,
body.crm-view-active .mobile-menu-toggle,
body.crm-view-active .sidebar-backdrop {
  display: none !important;
}

body.crm-view-active .main {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
}

body.crm-view-active .view {
  display: none !important;
}

body.crm-view-active .view[data-view-panel="crm"].active {
  display: block !important;
  height: 100vh;
}

.crm-login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(420px, 45fr);
  overflow: hidden;
  color: #10213c;
  background: #f8fafc;
  font-family: Inter, Manrope, Sora, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-sizing: border-box;
}

.crm-login-brand {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: clamp(40px, 6vw, 96px);
  overflow: hidden;
  color: #fff;
  background: radial-gradient(circle at 15% 18%, rgba(30, 192, 183, .3), transparent 28%), linear-gradient(145deg, #061735 0%, #102f6d 62%, #1553a4 100%);
}

.crm-brand-content { position: relative; z-index: 2; width: min(100%, 620px); display: grid; justify-items: center; text-align: center; }
.crm-brand-logo-wrap { width: min(100%, 520px); padding: clamp(12px, 2vw, 24px); border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 24px 60px rgba(0,12,40,.2); }
.crm-login-brand img { display: block; width: 100%; max-width: 520px; height: auto; max-height: min(34vh, 260px); object-fit: contain; }
.crm-login-orb { position: absolute; display: block; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.crm-login-orb::after { content: ""; position: absolute; inset: 18%; border: 1px solid rgba(46,211,198,.16); border-radius: inherit; }
.crm-login-orb.orb-one { width: min(42vw, 600px); aspect-ratio: 1; left: -20%; bottom: -35%; }
.crm-login-orb.orb-two { width: min(25vw, 350px); aspect-ratio: 1; right: -12%; top: -12%; }
.crm-brand-cards { display: flex; gap: 12px; margin-top: clamp(28px, 5vh, 50px); }
.crm-brand-cards span { width: clamp(62px, 7vw, 92px); height: 5px; border-radius: 99px; background: rgba(255,255,255,.18); }
.crm-brand-cards span:nth-child(2) { background: rgba(46,211,198,.55); }

.crm-login-brand h1 { max-width: 580px; margin: clamp(28px, 4vh, 42px) 0 0; font-size: clamp(27px, 2.4vw, 42px); line-height: 1.12; letter-spacing: -.035em; color: #fff; }
.crm-login-brand p { max-width: 530px; margin: 14px 0 0; color: #dce9fb; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.55; font-weight: 500; }

.crm-login-panel { min-width: 0; display: grid; place-items: center; padding: clamp(24px, 4vw, 64px); background: #f8fafc; }
.crm-login-card, .crm-login-card * { box-sizing: border-box; }
.crm-login-card {
  display: grid;
  gap: 0;
  width: min(100%, 456px);
  border: 1px solid #e8edf4;
  border-radius: 18px;
  padding: clamp(32px, 3vw, 40px);
  color: #10213c;
  background: #fff;
  box-shadow: 0 20px 60px rgba(17, 40, 76, .1);
}

.crm-login-compact-logo { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 14px; overflow: hidden; background: #f0f5fb; }
.crm-login-compact-logo img { width: 100%; height: 100%; object-fit: contain; }
.crm-login-heading .eyebrow { margin: 0 0 8px; color: #167d9c; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.crm-login-heading h2 { margin: 0; color: #10213c; font-size: clamp(25px, 2vw, 30px); line-height: 1.18; letter-spacing: -.025em; }
.crm-login-heading > p:last-child { margin: 10px 0 25px; color: #66758b; font-size: 14px; line-height: 1.5; }
.crm-login-field { display: grid; gap: 7px; margin-top: 15px; }
.crm-login-field > label { color: #263b59; font-size: 13px; font-weight: 700; }
.crm-input-wrap { min-width: 0; height: 50px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; border: 1px solid #d9e1eb; border-radius: 11px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.crm-input-wrap:focus-within { border-color: #2865b3; box-shadow: 0 0 0 4px rgba(40,101,179,.11); }
.crm-input-wrap > svg { width: 18px; height: 18px; justify-self: center; color: #8391a5; }
.crm-login-card .crm-input-wrap input { width: 100%; min-width: 0; height: 48px; border: 0; outline: 0; padding: 0 8px 0 0; color: #10213c; background: transparent; font: inherit; font-size: 15px; }
.crm-input-wrap input::placeholder { color: #9aa7b8; }
.crm-password-toggle { width: 44px; height: 46px; display: grid; place-items: center; border: 0; padding: 0; color: #718097; background: transparent; cursor: pointer; }
.crm-password-toggle svg { width: 18px; height: 18px; }
.crm-field-error { min-height: 16px; color: #bd2942; font-size: 12px; line-height: 1.3; }
.crm-login-field.has-error .crm-input-wrap { border-color: #d64a60; box-shadow: 0 0 0 3px rgba(214,74,96,.08); }
.crm-login-options { margin: 5px 0 20px; }
.crm-remember { width: max-content; display: flex; align-items: center; gap: 9px; color: #53647c; font-size: 13px; cursor: pointer; }
.crm-login-card .crm-remember input { width: 17px; height: 17px; margin: 0; accent-color: #174b91; }

.crm-login-submit {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 11px;
  color: #ffffff;
  background: #123b76;
  box-shadow: 0 10px 24px rgba(18,59,118,.18);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.crm-login-submit:hover:not(:disabled) { background: #0b2f63; transform: translateY(-1px); }
.crm-login-submit svg { width: 18px; height: 18px; }
.crm-login-submit[aria-busy="true"] svg { animation: crm-login-spin .8s linear infinite; }
@keyframes crm-login-spin { to { transform: rotate(360deg); } }

.crm-login-submit:disabled {
  opacity: .62;
  cursor: not-allowed;
}

.crm-login-alert { margin: 0 0 4px; border: 1px solid #d9e2ee; border-radius: 10px; padding: 11px 12px; color: #40536e; background: #f5f8fc; font-size: 13px; line-height: 1.4; }
.crm-login-alert[hidden] { display: none; }
.crm-login-alert.error { border-color: #f0c9cf; color: #9e2639; background: #fff4f5; }
.crm-login-alert.success { border-color: #bfe4da; color: #14745f; background: #f0fbf7; }

.crm-login-card small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  margin-top: 22px;
  color: #7b899c;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.crm-login-card small svg { width: 15px; height: 15px; color: #1a9c92; }

@media (max-width: 767px) {
  .crm-login-shell { display: block; min-height: 100dvh; overflow: visible; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #0d346e 0, #15529e 138px, #f6f8fb 138px); }
  .crm-login-brand { min-height: 116px; display: block; padding: 0; overflow: visible; background: none; }
  .crm-brand-content { display: block; width: 100%; }
  .crm-brand-logo-wrap { width: min(220px, 66vw); margin: 0 auto; padding: 10px 12px; border-radius: 14px; box-shadow: 0 12px 30px rgba(4,23,57,.2); }
  .crm-login-brand img { max-height: 82px; }
  .crm-login-brand h1, .crm-login-brand p, .crm-brand-cards, .crm-login-orb { display: none; }
  .crm-login-panel { display: block; padding: 0; background: transparent; }
  .crm-login-card { width: 100%; max-width: none; border-radius: 17px; padding: 26px clamp(24px, 7vw, 28px); box-shadow: 0 15px 40px rgba(17,40,76,.12); }
  .crm-login-compact-logo { display: none; }
  .crm-login-heading { text-align: center; }
  .crm-login-heading h2 { font-size: clamp(23px, 7vw, 28px); }
  .crm-login-heading > p:last-child { margin-bottom: 20px; }
}

@media (max-width: 359px) {
  .crm-login-shell { padding-left: 12px; padding-right: 12px; }
  .crm-login-card { padding-left: 20px; padding-right: 20px; }
}

@media (max-height: 720px) and (min-width: 768px) {
  .crm-login-brand { padding: 28px clamp(36px, 5vw, 72px); }
  .crm-brand-logo-wrap { width: min(76%, 440px); }
  .crm-login-brand h1 { margin-top: 22px; font-size: clamp(25px, 2vw, 34px); }
  .crm-brand-cards { margin-top: 22px; }
  .crm-login-panel { padding-block: 20px; }
  .crm-login-card { padding-block: 27px; }
  .crm-login-compact-logo { margin-bottom: 14px; }
  .crm-login-heading > p:last-child { margin-bottom: 15px; }
  .crm-login-field { margin-top: 10px; }
  .crm-login-options { margin-bottom: 13px; }
  .crm-login-card small { margin-top: 14px; }
}

.crm-page-root,
.crm-shell {
  min-height: 100vh;
}

.crm-plan-gate {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 32px;
  color: #10213f;
  background:
    radial-gradient(circle at 50% 15%, rgba(33, 211, 207, 0.13), transparent 32%),
    #f6f8fb;
  text-align: center;
}

.crm-plan-gate > span {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, #061b49, #0b3a70);
  box-shadow: 0 16px 34px rgba(6, 27, 73, 0.2);
}

.crm-plan-gate > span svg {
  width: 32px;
  height: 32px;
}

.crm-plan-gate p {
  margin: 10px 0 0;
  color: #0aa89f;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crm-plan-gate h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
}

.crm-plan-gate strong {
  max-width: 520px;
  margin-bottom: 12px;
  color: #667085;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
}

.crm-plan-gate .primary-action {
  min-height: 48px;
  padding-inline: 22px;
}

.crm-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  color: #061638;
  background: #f6f8fb;
  font-family: Inter, Manrope, Sora, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.crm-shell button,
.crm-shell input,
.crm-shell textarea {
  font: inherit;
}

.crm-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 22px 16px;
  overflow: hidden;
  color: #e9f3ff;
  background: linear-gradient(180deg, #07193a 0%, #05142d 52%, #031027 100%);
}

.crm-brand {
  min-height: 62px;
  display: flex;
  align-items: center;
}

.crm-brand button {
  width: 100%;
  display: flex;
  align-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.crm-brand > span {
  width: 100%;
  min-height: 52px;
  display: grid;
  place-items: center;
}

.crm-brand > span img {
  max-width: 168px;
}

.crm-detail-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed #d0d5dd;
  border-radius: 12px;
  color: #667085;
  background: #f9fafb;
  font-size: 13px;
  line-height: 1.5;
}

.crm-brand img {
  width: 178px;
  height: auto;
  max-height: 54px;
  object-fit: contain;
  border-radius: 8px;
  padding: 6px 8px;
  background: #07164a;
}

.crm-side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.crm-side-nav button,
.crm-help-button {
  min-height: 45px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  color: #d8e6f7;
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.crm-side-nav button svg,
.crm-help-button svg {
  width: 19px;
  height: 19px;
}

.crm-side-nav button.active {
  color: #ffffff;
  background: linear-gradient(135deg, #14a99d, #0e8f89);
  box-shadow: 0 12px 30px rgba(20, 169, 157, 0.28);
}

.crm-side-nav button:hover,
.crm-help-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.crm-side-nav em {
  min-width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #0fb8ad;
  font-size: 12px;
  font-style: normal;
}

.crm-sidebar-footer {
  display: grid;
  gap: 12px;
}

.crm-today-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 16px;
  background: rgba(2, 11, 29, 0.52);
}

.crm-today-card span,
.crm-today-card small {
  color: #d5e2f2;
  font-size: 12px;
  font-weight: 800;
}

.crm-today-card div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-today-card strong {
  color: #ffffff;
  font-size: 34px;
  line-height: 1;
}

.crm-today-card em {
  border-radius: 999px;
  padding: 5px 8px;
  color: #ffffff;
  background: #0fbf9d;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.crm-today-card i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.crm-today-card i::before {
  content: "";
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16d6c3, #48e3a7);
}

.crm-help-button {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(2, 11, 29, 0.38);
}

.crm-main {
  height: 100vh;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.crm-support-main {
  display: block;
  overflow: auto;
  padding: 18px 20px 28px;
}

.crm-support-mobile-menu {
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #061638;
  font-weight: 800;
}

.crm-header {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) minmax(260px, 420px) auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px 22px 12px;
  background: #ffffff;
}

.crm-mobile-menu {
  display: none;
}

.crm-title-block h1 {
  margin: 0;
  color: #071638;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: 0;
}

.crm-title-block p {
  margin: 5px 0 0;
  color: #5b6b84;
  font-size: 14px;
  font-weight: 700;
}

.crm-global-search,
.crm-chat-search {
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  padding: 0 11px;
  color: #708197;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(20, 38, 76, 0.04);
}

.crm-global-search input,
.crm-chat-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  color: #071638;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

.crm-global-search kbd {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 7px;
  color: #41536c;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.crm-icon-button,
.crm-view-toggle button,
.crm-chat-head button {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  color: #071638;
  background: #ffffff;
}

.crm-icon-button.has-badge em {
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #f0143f;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.crm-user-menu {
  min-width: 170px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 0;
  padding: 0;
  color: #071638;
  background: transparent;
  text-align: left;
}

.crm-user-menu > span,
.crm-lead-top > span,
.crm-chat-item > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #8a0049;
  font-size: 12px;
  font-weight: 900;
}

.crm-user-menu strong,
.crm-user-menu small {
  display: block;
}

.crm-user-menu strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.crm-user-menu small {
  margin-top: 1px;
  color: #5b6b84;
  font-size: 11px;
}

.crm-pipeline-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 22px 16px;
  background: #ffffff;
}

.crm-pipeline-tabs button {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  padding: 0 13px;
  color: #071638;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(20, 38, 76, 0.04);
  font-size: 13px;
  font-weight: 900;
}

.crm-pipeline-tabs button svg {
  width: 18px;
  height: 18px;
}

.crm-pipeline-tabs button.active {
  color: #ffffff;
  border-color: #0f9d91;
  background: linear-gradient(135deg, #14a99d, #0b8f88);
}

.crm-pipeline-tabs button:hover {
  border-color: rgba(20, 169, 157, 0.48);
}

.crm-pipeline-tabs .crm-new-pipeline {
  margin-left: auto;
  color: #ffffff;
  border-color: #047b78;
  background: #067a78;
}

.crm-content-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  padding: 0 22px 18px;
  overflow: auto;
}

.crm-work-area {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

.crm-pipeline-head,
.crm-chat-panel,
.crm-rules,
.crm-bottom-alert {
  border: 1px solid #e8edf4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(24, 39, 75, 0.05);
}

.crm-pipeline-head {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(320px, 1.2fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
}

.crm-pipeline-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.crm-pipeline-title span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  background: #132b68;
}

.crm-pipeline-title h2 {
  margin: 0;
  font-size: 18px;
}

.crm-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 12px;
}

.crm-metrics span,
.crm-kanban-column header span,
.crm-lead-top small,
.crm-chat-item small,
.crm-rule-row strong,
.crm-time-row strong,
.crm-bottom-alert span {
  color: #62728a;
  font-size: 12px;
  font-weight: 800;
}

.crm-metrics strong {
  display: block;
  margin-top: 3px;
  color: #071638;
  font-size: 22px;
  line-height: 1;
}

.crm-metrics .red { color: #f0143f; }
.crm-metrics .green { color: #0ba875; }
.crm-metrics .blue { color: #132b68; }

.crm-view-toggle {
  display: flex;
  gap: 6px;
}

.crm-view-toggle button.active {
  color: #ffffff;
  border-color: #098f86;
  background: #098f86;
}

.crm-kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(360px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
}

.crm-kanban-column {
  min-width: 360px;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 14px;
  border: 1px solid #e8edf4;
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 39, 75, 0.04);
  scroll-snap-align: start;
}

.crm-kanban-column header {
  display: grid;
  gap: 5px;
}

.crm-kanban-column header strong {
  min-height: 38px;
  color: #061638;
  font-size: 15px;
  line-height: 1.3;
}

.crm-kanban-column header i {
  height: 3px;
  border-radius: 99px;
  background: var(--stage-color);
}

.crm-column-cards {
  display: grid;
  gap: 14px;
  align-content: start;
}

.crm-lead-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-sizing: border-box;
  overflow-x: hidden;
  border: 1px solid #edf1f6;
  border-left: 5px solid #16b99a;
  border-radius: 18px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 39, 75, 0.08);
  cursor: grab;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.crm-lead-card[hidden] {
  display: none;
}

.crm-lead-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(24, 39, 75, 0.13);
}

.crm-lead-card.is-dragging {
  opacity: 0.62;
}

.crm-lead-card.late,
.crm-chat-item.late {
  border-left-color: #f0143f;
}

.crm-lead-card.attention,
.crm-chat-item.attention {
  border-left-color: #f59e0b;
}

.crm-lead-card.done,
.crm-chat-item.done {
  border-left-color: #16a875;
}

.crm-lead-top {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.crm-lead-top > span {
  width: 52px;
  height: 52px;
  font-size: 15px;
}

.crm-lead-top div {
  min-width: 0;
}

.crm-lead-top strong,
.crm-lead-top small {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
}

.crm-lead-top strong {
  color: #071638;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  -webkit-line-clamp: 2;
}

.crm-lead-top small {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
}

.crm-lead-top time {
  align-self: start;
  color: #6b7b91;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}

.crm-lead-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
}

.crm-lead-card em,
.crm-chat-item em {
  border-radius: 5px;
  padding: 3px 6px;
  color: #00836f;
  background: #e8fbf4;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.crm-lead-card em {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 15px;
  font-weight: 700;
}

.crm-lead-card.late em,
.crm-chat-item.late em {
  color: #f0143f;
  background: #fff0f3;
}

.crm-lead-card.attention em,
.crm-chat-item.attention em {
  color: #d87900;
  background: #fff6dc;
}

.crm-lead-card b {
  color: #0a8d69;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.crm-lead-card.late b { color: #f0143f; }
.crm-lead-card.attention b { color: #d87900; }

.crm-more-link,
.crm-all-chats {
  border: 0;
  color: #132b68;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.crm-chat-panel {
  position: sticky;
  top: 0;
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.crm-chat-head,
.crm-chat-tabs,
.crm-bottom-alert,
.crm-bottom-alert > div {
  display: flex;
  align-items: center;
}

.crm-chat-head {
  justify-content: space-between;
}

.crm-chat-head h3,
.crm-day-summary h4,
.crm-rule-card h3 {
  margin: 0;
  color: #071638;
  font-size: 16px;
}

.crm-chat-head em {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #ffffff;
  background: #0b9f96;
  font-size: 12px;
  font-style: normal;
}

.crm-chat-tabs {
  gap: 8px;
}

.crm-chat-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  color: #132b68;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.crm-chat-tabs button.active {
  color: #ffffff;
  background: #06958e;
}

.crm-chat-list {
  display: grid;
  gap: 8px;
}

.crm-chat-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  border: 1px solid #edf1f6;
  border-left: 3px solid #16b99a;
  border-radius: 8px;
  padding: 10px 8px;
  color: #071638;
  background: #ffffff;
  text-align: left;
}

.crm-chat-item div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.crm-chat-item strong,
.crm-chat-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-chat-item strong {
  font-size: 12px;
}

.crm-chat-item time {
  display: grid;
  gap: 14px;
  justify-items: end;
  color: #61728b;
  font-size: 11px;
  font-weight: 800;
}

.crm-chat-item time b {
  color: #07956b;
}

.crm-day-summary {
  display: grid;
  gap: 10px;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.crm-day-summary div {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #56677f;
  font-size: 12px;
  font-weight: 800;
}

.crm-day-summary strong {
  color: #071638;
}

.crm-day-summary .red svg,
.crm-day-summary .red strong { color: #f0143f; }
.crm-day-summary .green svg,
.crm-day-summary .green strong { color: #0ba875; }
.crm-day-summary .blue svg,
.crm-day-summary .blue strong { color: #1677ff; }

.crm-rules {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr 0.9fr;
  gap: 0;
  overflow: hidden;
}

.crm-rule-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border-right: 1px solid #edf1f6;
}

.crm-rule-card.wide {
  grid-column: auto !important;
}

.crm-rule-card:last-child {
  border-right: 0;
}

.crm-rule-card h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.crm-rule-row,
.crm-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}

.crm-rule-row span,
.crm-time-row span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #132b68;
  font-size: 11px;
  font-weight: 800;
}

.crm-rule-row b,
.crm-time-row b {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #132b68;
  font-size: 10px;
}

.crm-rule-row button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  color: #6b7b91;
  background: transparent;
}

.crm-status-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.crm-status-row i {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: #0ba875;
}

.crm-status-row.yellow i { background: #f59e0b; }
.crm-status-row.red i { background: #f0143f; }

.crm-status-row span,
.crm-status-row small {
  display: block;
}

.crm-status-row span {
  color: #132b68;
  font-size: 12px;
  font-weight: 900;
}

.crm-status-row small {
  color: #65758c;
  font-size: 11px;
  font-weight: 700;
}

.crm-donut {
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  background: conic-gradient(#1f7dff 0 32%, #14a99d 32% 62%, #f59e0b 62% 82%, #071638 82% 100%);
}

.crm-donut::before {
  content: "";
  position: absolute;
}

.crm-donut strong {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #071638;
  background: #ffffff;
  text-align: center;
  font-size: 17px;
  line-height: 1.05;
}

.crm-donut small {
  display: block;
  color: #65758c;
  font-size: 10px;
}

.crm-edit-rules {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #cdece7;
  border-radius: 8px;
  color: #067f77;
  background: #ecfbf8;
  font-size: 12px;
  font-weight: 900;
}

.crm-bottom-alert {
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
}

.crm-bottom-alert > div {
  gap: 10px;
}

.crm-bottom-alert svg {
  color: #132b68;
}

.crm-bottom-alert strong {
  color: #071638;
  font-size: 13px;
}

.crm-bottom-alert button {
  border: 0;
  color: #087f77;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.crm-drawer,
.crm-drawer-backdrop,
.crm-modal-backdrop,
.crm-sidebar-backdrop {
  position: fixed;
}

.crm-drawer {
  top: 0;
  right: 0;
  z-index: 60;
  width: min(430px, 94vw);
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 16px;
  overflow-y: auto;
  padding: 20px;
  background: #ffffff;
  box-shadow: -18px 0 50px rgba(8, 25, 47, 0.18);
}

.crm-drawer header,
.crm-modal header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.crm-drawer header span,
.crm-drawer-grid span {
  color: #65758c;
  font-size: 12px;
  font-weight: 800;
}

.crm-drawer h3 {
  margin: 4px 0 0;
  color: #071638;
}

.crm-drawer-status {
  border-left: 4px solid #0ba875;
  border-radius: 8px;
  padding: 12px;
  background: #f4fbf8;
}

.crm-drawer-status.late { border-left-color: #f0143f; background: #fff5f7; }
.crm-drawer-status.attention { border-left-color: #f59e0b; background: #fffbeb; }

.crm-drawer section {
  display: grid;
  gap: 8px;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  padding: 12px;
}

.crm-drawer h4,
.crm-drawer p,
.crm-drawer ol {
  margin: 0;
}

.crm-drawer p,
.crm-drawer li {
  color: #52637a;
  font-size: 13px;
}

.crm-drawer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-drawer-grid div {
  display: grid;
  gap: 3px;
}

.crm-drawer footer {
  display: grid;
  gap: 8px;
  align-self: end;
}

.crm-whatsapp,
.crm-secondary-action,
.crm-modal-primary,
.crm-modal-form footer button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.crm-whatsapp {
  color: #ffffff;
  background: #11a36c;
}

.crm-whatsapp:disabled {
  color: #7a8799;
  background: #edf1f6;
}

.crm-secondary-action {
  color: #132b68;
  background: #eef4ff;
}

.crm-secondary-action.danger {
  color: #f0143f;
  background: #fff0f3;
}

.crm-drawer-backdrop {
  inset: 0;
  z-index: 55;
  border: 0;
  background: rgba(7, 22, 56, 0.26);
}

.crm-modal-backdrop {
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 22, 56, 0.36);
}

.crm-modal {
  width: min(520px, 100%);
  display: grid;
  gap: 18px;
  border-radius: 10px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(7, 22, 56, 0.24);
}

.crm-modal h3 {
  margin: 0;
}

.crm-modal-form {
  display: grid;
  gap: 12px;
}

.crm-modal-form label {
  display: grid;
  gap: 6px;
  color: #132b68;
  font-size: 13px;
  font-weight: 900;
}

.crm-modal-form input,
.crm-modal-form textarea {
  width: 100%;
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  padding: 10px 12px;
  color: #071638;
  background: #ffffff;
}

.crm-modal-form textarea {
  min-height: 86px;
  resize: vertical;
}

.crm-modal-form footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.crm-modal-form footer button {
  padding: 0 15px;
  color: #132b68;
  background: #eef4ff;
}

.crm-modal-form footer .crm-modal-primary {
  color: #ffffff;
  background: #078f86;
}

.crm-sidebar-backdrop {
  display: none;
}

.crm-detail-page {
  min-height: 0;
  display: grid;
  gap: 14px;
  padding: 0 22px 18px;
  overflow: auto;
}

.crm-lead-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.crm-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  color: #52637a;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.crm-lead-detail-header h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 0;
  color: #071638;
  font-size: 22px;
}

.crm-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 12px;
  color: #078a68;
  background: #dff8ec;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.crm-status-badge.done {
  color: #32435a;
  background: #eef2f7;
}

.crm-status-badge.attention {
  color: #b86d00;
  background: #fff4d8;
}

.crm-status-badge.late {
  color: #e11d48;
  background: #fff1f4;
}

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

.crm-lead-actions > button,
.crm-lead-actions > label {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  padding: 0 13px;
  color: #132b68;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(20, 38, 76, 0.04);
  font-size: 13px;
  font-weight: 900;
}

.crm-lead-actions label svg:first-child {
  color: #0ba875;
  fill: currentColor;
}

.crm-lead-actions select {
  border: 0;
  outline: 0;
  color: #132b68;
  background: transparent;
  font-weight: 900;
  appearance: none;
}

.crm-lead-actions .crm-detail-dots {
  width: 42px;
  justify-content: center;
  padding: 0;
}

.crm-detail-grid {
  display: grid;
  grid-template-columns: minmax(245px, 27%) minmax(420px, 46%) minmax(260px, 27%);
  gap: 16px;
  align-items: start;
}

.crm-detail-left,
.crm-detail-right {
  display: grid;
  gap: 14px;
}

.crm-detail-card,
.crm-conversation-panel {
  border: 1px solid #e8edf4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(24, 39, 75, 0.05);
}

.crm-detail-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.crm-detail-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.crm-detail-card h3 {
  margin: 0;
  color: #071638;
  font-size: 14px;
}

.crm-detail-card > header button,
.crm-see-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  color: #087f77;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.crm-customer-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.crm-customer-head span,
.crm-conversation-head span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #8a0049;
  font-size: 13px;
  font-weight: 900;
}

.crm-customer-head strong {
  color: #071638;
  font-size: 16px;
}

.crm-customer-head em,
.crm-vehicle-card em {
  border-radius: 999px;
  padding: 4px 8px;
  color: #078a68;
  background: #dff8ec;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.crm-detail-row {
  display: grid;
  grid-template-columns: 18px minmax(92px, 0.85fr) minmax(0, 1.3fr);
  gap: 8px;
  align-items: start;
}

.crm-detail-row svg {
  width: 16px;
  height: 16px;
  color: #74839a;
}

.crm-detail-row span {
  color: #65758c;
  font-size: 12px;
  font-weight: 800;
}

.crm-detail-row strong,
.crm-detail-row a {
  color: #071638;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 900;
  text-decoration: none;
}

.crm-detail-row a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.crm-detail-row a svg {
  color: #10a66d;
}

.crm-vehicle-card {
  overflow: hidden;
}

.crm-vehicle-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.crm-vehicle-card th,
.crm-vehicle-card td {
  border-bottom: 1px solid #eef2f7;
  padding: 9px 5px;
  color: #132b68;
  text-align: left;
  white-space: nowrap;
}

.crm-vehicle-card th {
  color: #65758c;
  font-size: 10px;
}

.crm-vehicle-card em {
  margin-left: 6px;
  padding: 3px 6px;
  font-size: 10px;
}

.crm-conversation-panel {
  min-height: 636px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.crm-conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #eef2f7;
}

.crm-conversation-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.crm-conversation-head strong,
.crm-conversation-head small {
  display: block;
}

.crm-conversation-head strong {
  color: #071638;
  font-size: 14px;
}

.crm-conversation-head small {
  color: #65758c;
  font-size: 12px;
}

.crm-conversation-head nav {
  display: flex;
  gap: 8px;
}

.crm-conversation-head button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  color: #132b68;
  background: transparent;
}

.crm-conversation-date {
  justify-self: center;
  margin-top: 12px;
  color: #65758c;
  font-size: 12px;
  font-weight: 800;
}

.crm-message-timeline {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding: 12px 18px 18px;
}

.crm-message-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: start;
}

.crm-message-row.sent {
  grid-template-columns: 30px minmax(0, 0.78fr) 42px;
}

.crm-message-row.sent .crm-message-bubble {
  width: min(100%, 430px);
  justify-self: end;
  background: #eefaf4;
}

.crm-message-row.note .crm-message-bubble {
  background: #fff8df;
}

.crm-message-channel {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #315fdd;
}

.crm-message-channel.whatsapp {
  color: #0aa06e;
  background: #ecfbf4;
}

.crm-message-channel.call {
  color: #2652b8;
  background: #eef4ff;
}

.crm-message-bubble {
  position: relative;
  display: grid;
  gap: 6px;
  border: 1px solid #e9edf4;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

.crm-message-bubble strong,
.crm-message-bubble small {
  display: block;
}

.crm-message-bubble strong {
  color: #071638;
  font-size: 12px;
}

.crm-message-bubble small {
  color: #29548c;
  font-size: 11px;
}

.crm-message-bubble p {
  margin: 0;
  color: #132b68;
  font-size: 12px;
  line-height: 1.45;
}

.crm-message-attachment {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  gap: 8px;
  align-items: center;
  min-width: 230px;
  padding: 8px 9px;
  border: 1px solid #dce5f2;
  border-radius: 7px;
  color: #173b72;
  background: #f7faff;
  text-decoration: none;
}

.crm-message-attachment:hover {
  border-color: #91b4e5;
  background: #eef5ff;
}

.crm-message-attachment svg {
  width: 16px;
  height: 16px;
}

.crm-message-attachment span {
  min-width: 0;
}

.crm-message-attachment strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-message-bubble > i {
  justify-self: end;
  color: #0ba875;
  line-height: 1;
}

.crm-message-row time {
  color: #52637a;
  font-size: 11px;
  font-weight: 800;
}

.crm-audio-bubble {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.crm-audio-bubble button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #132b68;
  background: #eef4ff;
}

.crm-audio-bubble i {
  height: 16px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, #9aabc2 0 2px, transparent 2px 7px),
    linear-gradient(#d7dee9, #d7dee9);
  opacity: 0.78;
}

.crm-audio-bubble span {
  color: #52637a;
  font-size: 12px;
  font-weight: 900;
}

.crm-reply-composer {
  display: grid;
  gap: 10px;
  padding: 12px 18px 14px;
  border-top: 1px solid #eef2f7;
  background: #ffffff;
}

.crm-reply-tabs {
  display: flex;
  gap: 18px;
}

.crm-reply-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 0 8px;
  color: #52637a;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.crm-reply-tabs button.active {
  color: #087f77;
  border-color: #087f77;
}

.crm-reply-composer textarea {
  min-height: 42px;
  border: 0;
  outline: 0;
  resize: vertical;
  color: #071638;
  background: transparent;
  font-size: 13px;
}

.crm-reply-actions,
.crm-reply-actions > div,
.crm-reply-actions nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-reply-actions {
  justify-content: space-between;
}

.crm-reply-actions button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 0 12px;
  color: #132b68;
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.crm-reply-actions button.active {
  color: #078a68;
  border-color: #9ddfcd;
  background: #eefaf4;
}

.crm-reply-actions nav button {
  width: 38px;
  padding: 0;
}

.crm-reply-actions .send {
  color: #ffffff;
  border-color: #087f77;
  background: #087f77;
}

.crm-ticket-history {
  gap: 10px;
}

.crm-ticket-item {
  position: relative;
  display: grid;
  gap: 6px;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  padding: 11px 34px 11px 10px;
  color: #132b68;
  background: #ffffff;
  text-align: left;
}

.crm-ticket-item > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-ticket-item strong {
  color: #1677ff;
  font-size: 13px;
}

.crm-ticket-item span {
  color: #52637a;
  font-size: 11px;
  font-weight: 800;
}

.crm-ticket-item b {
  color: #071638;
}

.crm-ticket-item > svg {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 16px;
  transform: translateY(-50%);
}

.crm-reviews-card {
  gap: 0;
}

.crm-review-item {
  display: grid;
  gap: 6px;
  border-top: 1px solid #eef2f7;
  padding: 12px 0;
}

.crm-review-item:first-of-type {
  border-top: 0;
}

.crm-review-item div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-review-item span,
.crm-review-item small {
  color: #52637a;
  font-size: 11px;
  font-weight: 800;
}

.crm-review-item strong {
  color: #071638;
  font-size: 13px;
}

.crm-review-item button {
  border: 0;
  color: #071638;
  background: transparent;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.crm-stars {
  color: #f7b500;
  font-size: 12px;
  font-style: normal;
  letter-spacing: 1px;
}

.crm-review-item em {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 9px;
  color: #087f57;
  background: #e8fbf0;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 1220px) {
  .crm-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-detail-grid {
    grid-template-columns: minmax(230px, 0.9fr) minmax(420px, 1.25fr);
  }

  .crm-detail-right {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-chat-panel {
    position: static;
    grid-row: auto;
  }

  .crm-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-rule-card:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 900px) {
  .crm-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(82vw, 280px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.crm-mobile-sidebar-open .crm-sidebar {
    transform: translateX(0);
  }

  body.crm-mobile-sidebar-open .crm-sidebar-backdrop {
    display: block;
    inset: 0;
    z-index: 15;
    border: 0;
    background: rgba(7, 22, 56, 0.42);
  }

  .crm-mobile-menu {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #e7ebf2;
    border-radius: 8px;
    color: #071638;
    background: #ffffff;
  }

  .crm-header {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .crm-global-search {
    grid-column: 1 / -1;
    order: 3;
  }

  .crm-user-menu {
    min-width: 0;
  }

  .crm-user-menu strong {
    display: none;
  }

  .crm-pipeline-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-conversation-panel {
    order: -1;
  }

  .crm-detail-right {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-lead-detail-header {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .crm-lead-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  body.crm-view-active,
  body.crm-view-active .shell,
  body.crm-view-active .workspace,
  body.crm-view-active .main,
  body.crm-view-active .view[data-view-panel="crm"].active {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .crm-main {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .crm-header {
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px 14px;
  }

  .crm-header .crm-icon-button {
    display: none;
  }

  .crm-title-block h1 {
    font-size: 22px;
  }

  .crm-pipeline-tabs {
    padding: 8px 14px 12px;
  }

  .crm-content-grid {
    padding: 0 16px 16px;
  }

  .crm-detail-page {
    padding: 0 14px 16px;
  }

  .crm-lead-actions > button,
  .crm-lead-actions > label {
    flex: 1 1 150px;
  }

  .crm-detail-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .crm-detail-row strong {
    grid-column: 2;
  }

  .crm-conversation-panel {
    min-height: 0;
  }

  .crm-message-row,
  .crm-message-row.sent {
    grid-template-columns: 28px minmax(0, 1fr) 38px;
  }

  .crm-reply-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-reply-actions > div {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .crm-vehicle-card {
    overflow-x: auto;
  }

  .crm-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-kanban {
    width: 100%;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(86vw, 320px);
    gap: 14px;
    margin-right: 0;
    padding: 2px 2px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
  }

  .crm-kanban-column {
    width: 100%;
    min-width: 0;
    max-width: 320px;
    height: max-content;
    box-sizing: border-box;
    overflow: visible;
    padding: 14px;
    scroll-snap-align: start;
  }

  .crm-column-cards {
    width: 100%;
    min-width: 0;
    gap: 14px;
  }

  .crm-lead-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 156px;
    gap: 14px;
    border-left-width: 5px;
    border-radius: 16px;
    padding: 16px;
    overflow-x: hidden;
  }

  .crm-lead-top {
    grid-template-columns: 56px minmax(0, 1fr) 48px;
    gap: 12px;
  }

  .crm-lead-top > span {
    width: 56px;
    height: 56px;
    font-size: 16px;
  }

  .crm-lead-top strong {
    font-size: 17px;
    line-height: 1.2;
  }

  .crm-lead-top small {
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.35;
  }

  .crm-lead-top time {
    justify-self: end;
    font-size: 15px;
    font-weight: 600;
  }

  .crm-lead-card em {
    padding: 8px 14px;
    font-size: 15px;
    font-weight: 700;
  }

  .crm-lead-card b {
    font-size: 18px;
  }

  .crm-rules {
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-rule-card,
  .crm-rule-card:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid #edf1f6;
  }

  .crm-rule-card:last-child {
    border-bottom: 0;
  }

  .crm-bottom-alert,
  .crm-bottom-alert > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .crm-bottom-alert {
    padding: 12px;
  }
}
.crm-real-chats-page {
  min-height: calc(100vh - 126px);
  padding: 22px 0 28px;
  overflow-x: auto;
  background: #f6f8fc;
}

.crm-support-main .crm-header {
  display: flex;
  padding-inline: 4px;
}

.crm-chat-board {
  min-width: 960px;
  display: grid;
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 16px;
  align-items: start;
}

.crm-chat-lane {
  min-height: calc(100vh - 180px);
  overflow: hidden;
  border: 1px solid #dfe5ef;
  border-radius: 16px;
  background: #eef2f8;
  box-shadow: 0 8px 24px rgba(15, 35, 73, .05);
}

.crm-chat-lane > header {
  min-height: 82px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-top: 4px solid var(--chat-lane-color);
  border-bottom: 1px solid #e1e6ef;
  background: #fff;
}

.crm-chat-lane > header > span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--chat-lane-color);
  background: color-mix(in srgb, var(--chat-lane-color) 12%, white);
}

.crm-chat-lane > header svg {
  width: 20px;
  height: 20px;
}

.crm-chat-lane > header strong,
.crm-chat-lane > header small {
  display: block;
}

.crm-chat-lane > header strong {
  color: #10254b;
  font-size: 14px;
}

.crm-chat-lane > header small {
  margin-top: 3px;
  color: #77839a;
  font-size: 10px;
}

.crm-chat-lane > header em {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--chat-lane-color);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.crm-chat-lane-list {
  min-height: 280px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.crm-chat-board-item {
  padding: 13px;
  border: 1px solid #dfe5ef;
  border-left: 4px solid #20b68f;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 35, 73, .05);
  cursor: grab;
}

.crm-chat-board-item.attention { border-left-color: #f4b740; }
.crm-chat-board-item.late { border-left-color: #ef5350; }
.crm-chat-board-item.done { border-left-color: #0aa678; }
.crm-chat-board-item.is-dragging { opacity: .45; cursor: grabbing; }

.crm-chat-board-person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
}

.crm-chat-board-person > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #10254b;
  font-size: 12px;
  font-weight: 900;
}

.crm-chat-board-person strong,
.crm-chat-board-person small {
  display: block;
}

.crm-chat-board-person strong {
  color: #10254b;
  font-size: 13px;
}

.crm-chat-board-person small {
  margin-top: 4px;
  overflow: hidden;
  color: #68758c;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-chat-board-person time {
  color: #8a95a8;
  font-size: 10px;
}

.crm-chat-board-meta {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #edf0f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-chat-board-meta span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: #66738a;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-chat-board-meta svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.crm-chat-board-meta em {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: #315dba;
  background: #edf4ff;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.crm-chat-lane-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #c8d1df;
  border-radius: 12px;
  color: #8490a4;
  text-align: center;
  background: rgba(255, 255, 255, .55);
  font-size: 11px;
}

.crm-chat-lane-empty svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 760px) {
  .crm-support-main { padding-inline: 12px; }
  .crm-chat-board { min-width: 900px; }
  .crm-real-chats-page { margin-right: -12px; padding-right: 12px; }
}

/* CRM: pipelines em largura total, pesquisa contínua e gestão administrativa. */
.crm-content-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

.crm-global-search {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
}

.crm-global-search button,
.crm-home-button,
.crm-pipeline-actions button,
.crm-bulk-bar button,
.crm-stage-editor button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 9px;
  padding: 7px 12px;
  color: #fff;
  background: #0b73e0;
  font-weight: 800;
  cursor: pointer;
}

.crm-global-search button {
  margin-right: 4px;
  background: #087f76;
}

.crm-home-button {
  flex: 0 0 auto;
  border: 1px solid #dce4ef;
  color: #10254b;
  background: #fff;
}

.crm-home-button svg,
.crm-pipeline-actions svg,
.crm-bulk-bar svg,
.crm-stage-editor button svg {
  width: 16px;
  height: 16px;
}

.crm-pipeline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-pipeline-actions button:first-child {
  color: #087f76;
  background: #e9f8f6;
}

.crm-bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  border: 1px solid #cfe1f6;
  border-radius: 12px;
  padding: 10px 14px;
  color: #17345f;
  background: #f2f7fd;
}

.crm-bulk-bar strong { margin-right: auto; }
.crm-bulk-bar label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.crm-bulk-bar select,
.crm-stage-editor select,
.crm-modal-form select {
  min-height: 38px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  padding: 7px 10px;
  color: #193250;
  background: #fff;
}

.crm-bulk-bar button:last-child { color: #344966; background: #e4eaf2; }
.crm-bulk-bar button:disabled { opacity: .5; cursor: not-allowed; }

.crm-lead-card { position: relative; }
.crm-lead-card.is-selected { outline: 2px solid #1677e8; outline-offset: 1px; }
.crm-lead-select { position: absolute; z-index: 3; top: 8px; right: 8px; width: 22px; height: 22px; display: grid; place-items: center; }
.crm-lead-select input { width: 16px; height: 16px; margin: 0; accent-color: #087f76; cursor: pointer; }
.crm-lead-card .crm-lead-top { padding-right: 20px; }

.crm-pipeline-settings-form { width: min(900px, 90vw); }
.crm-stage-editor { display: grid; gap: 9px; }
.crm-stage-editor article { display: grid; grid-template-columns: 28px minmax(190px, 1fr) 90px 120px minmax(230px, auto); gap: 9px; align-items: end; border: 1px solid #e2e8f0; border-radius: 11px; padding: 10px; }
.crm-stage-editor article > b { align-self: center; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #10254b; font-size: 11px; }
.crm-stage-editor article > div { display: flex; align-items: center; gap: 6px; }
.crm-stage-editor label { gap: 4px; font-size: 10px; }
.crm-stage-editor input[type="color"] { min-height: 40px; padding: 4px; }

@media (max-width: 1180px) {
  .crm-home-button span { display: none; }
  .crm-pipeline-head { flex-wrap: wrap; }
  .crm-pipeline-actions { width: 100%; }
  .crm-stage-editor article { grid-template-columns: 28px minmax(170px, 1fr) 76px 110px; }
  .crm-stage-editor article > div { grid-column: 2 / -1; }
}

@media (max-width: 760px) {
  .crm-header { flex-wrap: wrap; }
  .crm-global-search { order: 5; width: 100%; }
  .crm-home-button { min-width: 40px; padding-inline: 10px; }
  .crm-bulk-bar { align-items: stretch; flex-direction: column; }
  .crm-bulk-bar label { align-items: stretch; flex-direction: column; }
  .crm-stage-editor article { grid-template-columns: 28px minmax(0, 1fr) 72px; }
  .crm-stage-editor article label:nth-of-type(3), .crm-stage-editor article > div { grid-column: 2 / -1; }
  .crm-stage-editor article > div { align-items: stretch; flex-direction: column; }
}

/* CRM layout containment: only the kanban owns horizontal pipeline scrolling. */
html,
body.crm-view-active {
  max-width: 100%;
  overflow-x: hidden;
}

body.crm-view-active .shell,
body.crm-view-active .workspace,
body.crm-view-active .main,
body.crm-view-active .view[data-view-panel="crm"].active,
.crm-page-root,
.crm-shell,
.crm-main,
.crm-content-grid,
.crm-work-area {
  width: 100%;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
}

body.crm-view-active .main,
body.crm-view-active .view[data-view-panel="crm"].active,
.crm-page-root,
.crm-shell {
  min-height: 0;
}

body.crm-view-active .view[data-view-panel="crm"].active,
.crm-page-root,
.crm-shell {
  height: 100%;
}

body.crm-view-active .view[data-view-panel="crm"].active,
.crm-page-root {
  overflow: clip;
}

.crm-shell {
  grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
}

.crm-sidebar {
  width: 100%;
  min-width: 0;
  max-width: 240px;
  box-sizing: border-box;
}

.crm-main {
  max-width: 100%;
}

.crm-header {
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(180px, auto) minmax(240px, 1fr) auto minmax(150px, auto);
  box-sizing: border-box;
}

.crm-header > *,
.crm-title-block,
.crm-global-search,
.crm-pipeline-head > *,
.crm-pipeline-title,
.crm-metrics,
.crm-pipeline-actions {
  min-width: 0;
  max-width: 100%;
}

.crm-global-search {
  box-sizing: border-box;
}

.crm-content-grid {
  overflow-x: clip;
  overflow-y: auto;
}

.crm-work-area {
  overflow: visible;
}

.crm-pipeline-head {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.crm-kanban {
  width: 100%;
  min-width: 0;
  max-width: none;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 320px);
  gap: 16px;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 12px;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.crm-kanban-column {
  width: 100%;
  min-width: 0;
  max-width: 320px;
  box-sizing: border-box;
}

.crm-kanban-column header {
  min-height: 65px;
  align-content: start;
}

@media (max-width: 900px) {
  .crm-shell {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: clip;
  }

  .crm-sidebar {
    width: min(82vw, 280px);
    max-width: 280px;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.crm-mobile-sidebar-open .crm-sidebar-backdrop {
    position: fixed;
    inset: 0;
  }

  .crm-header {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .crm-global-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  body.crm-view-active,
  body.crm-view-active .shell,
  body.crm-view-active .workspace,
  body.crm-view-active .main,
  body.crm-view-active .view[data-view-panel="crm"].active,
  .crm-page-root,
  .crm-shell,
  .crm-main {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 100dvh;
  }

  body.crm-view-active,
  body.crm-view-active .shell,
  body.crm-view-active .workspace,
  body.crm-view-active .main,
  body.crm-view-active .view[data-view-panel="crm"].active,
  .crm-page-root,
  .crm-shell,
  .crm-main,
  .crm-content-grid,
  .crm-work-area {
    overflow-x: clip;
  }

  body.crm-view-active,
  body.crm-view-active .main,
  .crm-main,
  .crm-content-grid {
    overflow-y: visible;
  }

  .crm-header {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "menu title home user"
      "search search search search";
    gap: 10px;
  }

  .crm-mobile-menu { grid-area: menu; }
  .crm-title-block { grid-area: title; }
  .crm-global-search { grid-area: search; width: auto; }
  .crm-home-button { grid-area: home; width: 40px; }
  .crm-user-menu { grid-area: user; width: 40px; grid-template-columns: 1fr; justify-items: center; }
  .crm-user-menu > svg { display: none; }

  .crm-title-block {
    overflow: hidden;
  }

  .crm-title-block h1,
  .crm-title-block p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .crm-content-grid {
    width: 100%;
    padding-inline: 14px;
  }

  .crm-kanban {
    width: 100%;
    grid-auto-columns: min(86vw, 320px);
    gap: 14px;
    margin: 0;
    padding: 2px 2px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }

  .crm-kanban-column {
    width: 100%;
    min-width: 0;
    max-width: 320px;
    scroll-snap-align: start;
  }
}

@media (max-width: 480px) {
  .crm-header {
    padding-inline: 10px;
  }

  .crm-title-block h1 {
    font-size: 19px;
  }

  .crm-title-block p {
    font-size: 11px;
  }

  .crm-home-button,
  .crm-user-menu {
    min-width: 40px;
  }

  .crm-user-menu {
    gap: 0;
  }
}
