:root {
  --ttcrm-red: #d60302;
  --ttcrm-black: #111111;
  --ttcrm-muted: #6b7280;
  --ttcrm-border: #e5e7eb;
  --ttcrm-bg: #f6f7f9;
  --ttcrm-card: #ffffff;
}

body.ttcrm-frontend-page header,
body.ttcrm-frontend-page .site-header,
body.ttcrm-frontend-page #masthead,
body.ttcrm-frontend-page .elementor-location-header {
  display: none !important;
}

body.ttcrm-frontend-page {
  background: var(--ttcrm-bg);
}

.ttcrm-frontend-shell {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--ttcrm-bg);
  min-height: 100vh;
}

.ttcrm-frontend-topbar {
  position: sticky;
  top: 0;
  z-index: 9999;
  min-height: 54px;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.ttcrm-frontend-brand,
.ttcrm-core-link {
  color: #fff !important;
  text-decoration: none !important;
}

.ttcrm-frontend-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ttcrm-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ttcrm-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: -.04em;
}

.ttcrm-frontend-brand strong,
.ttcrm-frontend-brand em {
  display: block;
  line-height: 1.05;
}

.ttcrm-frontend-brand strong {
  font-size: 14px;
}

.ttcrm-frontend-brand em {
  font-size: 11px;
  color: #cbd5e1;
  font-style: normal;
}

.ttcrm-frontend-spacer {
  flex: 1;
}

.ttcrm-core-link {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
}

.ttcrm-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
}

.ttcrm-user-badge span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.ttcrm-user-badge strong,
.ttcrm-user-badge em {
  display: block;
  line-height: 1.05;
}

.ttcrm-user-badge strong {
  font-size: 12px;
}

.ttcrm-user-badge em {
  color: #cbd5e1;
  font-size: 10px;
  font-style: normal;
}

.ttcrm-wrap {
  max-width: 100%;
  padding: 18px;
  color: #111827;
  box-sizing: border-box;
}

.wrap .ttcrm-wrap {
  padding-left: 0;
  padding-right: 0;
}

.ttcrm-hero {
  background: linear-gradient(135deg, #151515, #3a0d0d);
  color: #fff;
  border-radius: 18px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
}

.ttcrm-hero h1 {
  margin: 4px 0 6px;
  color: #fff;
  font-size: 26px;
  line-height: 1.1;
}

.ttcrm-hero p {
  margin: 0;
  color: #f3f4f6;
  max-width: 820px;
}

.ttcrm-eyebrow {
  color: #fecaca;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ttcrm-hero-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}


.ttcrm-wrap .button,
.ttcrm-wrap a.button,
.ttcrm-wrap button.button,
.ttcrm-wrap input.button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 13px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #111827 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04) !important;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

.ttcrm-wrap .button:hover,
.ttcrm-wrap a.button:hover,
.ttcrm-wrap button.button:hover,
.ttcrm-wrap input.button:hover {
  border-color: #9ca3af !important;
  color: var(--ttcrm-red) !important;
  background: #fff7f7 !important;
}

.ttcrm-wrap .button-small,
.ttcrm-wrap a.button-small,
.ttcrm-wrap button.button-small {
  min-height: 30px;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
}

.ttcrm-wrap .button-primary,
.ttcrm-wrap .button-primary:hover,
.ttcrm-wrap .button-primary:focus {
  background: var(--ttcrm-red) !important;
  border-color: var(--ttcrm-red) !important;
  color: #fff !important;
}


.ttcrm-wrap .button[disabled],
.ttcrm-wrap button[disabled],
.ttcrm-wrap input[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.ttcrm-actions .button {
  margin: 0 !important;
}

.ttcrm-panel .submit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.ttcrm-filter-form .button,
.ttcrm-filter-form button,
.ttcrm-lead-form .button,
.ttcrm-stack-form .button {
  width: auto;
  max-width: 100%;
}

.ttcrm-filter-form select,
.ttcrm-lead-form select,
.ttcrm-stack-form select,
.ttcrm-settings-form select {
  appearance: auto;
  background-color: #fff;
}

.ttcrm-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 16px;
  padding: 4px 0 8px;
}

.ttcrm-tab {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none !important;
  color: #111827;
  background: #fff;
  border: 1px solid var(--ttcrm-border);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.ttcrm-tab.is-active {
  background: var(--ttcrm-red);
  border-color: var(--ttcrm-red);
  color: #fff !important;
}

.ttcrm-notice {
  border-radius: 12px;
  padding: 11px 14px;
  margin: 0 0 14px;
  border: 1px solid var(--ttcrm-border);
  background: #fff;
}

.ttcrm-notice p {
  margin: 0;
}

.ttcrm-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.ttcrm-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.ttcrm-cards {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ttcrm-card {
  background: #fff;
  border: 1px solid var(--ttcrm-border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.04);
  min-height: 82px;
}

.ttcrm-card span {
  display: block;
  font-size: 12px;
  color: var(--ttcrm-muted);
  margin-bottom: 8px;
}

.ttcrm-card strong {
  display: block;
  font-size: 24px;
  line-height: 1;
  color: #111827;
}

.ttcrm-card-confirmed { border-top: 4px solid #16a34a; }
.ttcrm-card-lost { border-top: 4px solid #ef4444; }
.ttcrm-card-missed { border-top: 4px solid #f97316; }
.ttcrm-card-ai { border-top: 4px solid #7c3aed; }
.ttcrm-card-payment { border-top: 4px solid #0f766e; }
.ttcrm-card-followup { border-top: 4px solid var(--ttcrm-red); }
.ttcrm-card-active { border-top: 4px solid #2563eb; }
.ttcrm-card-total { border-top: 4px solid #111827; }

.ttcrm-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.ttcrm-panel {
  background: #fff;
  border: 1px solid var(--ttcrm-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.04);
  margin-bottom: 16px;
}

.ttcrm-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.2;
}

.ttcrm-panel h3 {
  margin: 16px 0 6px;
  font-size: 14px;
}

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

.ttcrm-panel-head h2 {
  margin: 0;
}

.ttcrm-panel-head span {
  color: var(--ttcrm-muted);
  font-size: 12px;
}

.ttcrm-flow {
  display: grid;
  gap: 10px;
}

.ttcrm-flow div {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--ttcrm-border);
  border-radius: 12px;
  padding: 10px;
}

.ttcrm-flow strong {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ttcrm-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
}

.ttcrm-filter-form {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.ttcrm-filter-form label,
.ttcrm-lead-form label,
.ttcrm-stack-form label,
.ttcrm-settings-form label {
  display: grid;
  gap: 5px;
  font-weight: 700;
  font-size: 12px;
  color: #374151;
}

.ttcrm-filter-form input,
.ttcrm-filter-form select,
.ttcrm-lead-form input,
.ttcrm-lead-form select,
.ttcrm-lead-form textarea,
.ttcrm-stack-form input,
.ttcrm-stack-form select,
.ttcrm-stack-form textarea,
.ttcrm-settings-form input,
.ttcrm-settings-form select,
.ttcrm-settings-form textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 38px;
  font-weight: 500;
  box-sizing: border-box;
}

.ttcrm-lead-form textarea,
.ttcrm-stack-form textarea,
.ttcrm-settings-form textarea {
  min-height: 80px;
}

.ttcrm-required {
  color: var(--ttcrm-red);
}

.ttcrm-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.ttcrm-wide-label {
  margin-top: 12px;
}

.ttcrm-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ttcrm-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ttcrm-table {
  border-radius: 12px;
  overflow: hidden;
}

.ttcrm-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #4b5563;
}

.ttcrm-table td {
  vertical-align: top;
}

.ttcrm-actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ttcrm-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  background: #f3f4f6;
  color: #374151;
  margin: 1px 0;
}

.ttcrm-chip-active,
.ttcrm-chip-attended {
  background: #dcfce7;
  color: #166534;
}

.ttcrm-chip-confirmed {
  background: #bbf7d0;
  color: #14532d;
}

.ttcrm-chip-lost,
.ttcrm-chip-missed,
.ttcrm-chip-abandoned {
  background: #fee2e2;
  color: #991b1b;
}

.ttcrm-chip-ai,
.ttcrm-chip-needs_review {
  background: #ede9fe;
  color: #5b21b6;
}

.ttcrm-empty {
  color: var(--ttcrm-muted);
  margin: 8px 0;
}

.ttcrm-lead-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ttcrm-lead-detail-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.ttcrm-lead-detail-head p {
  margin: 0;
}

.ttcrm-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ttcrm-detail-grid div {
  border: 1px solid var(--ttcrm-border);
  border-radius: 12px;
  padding: 10px;
}

.ttcrm-detail-grid span {
  display: block;
  font-size: 11px;
  color: var(--ttcrm-muted);
  margin-bottom: 4px;
}

.ttcrm-detail-grid strong {
  display: block;
  font-size: 14px;
}

.ttcrm-stack-form {
  display: grid;
  gap: 10px;
}

.ttcrm-ai-panel {
  border-color: #ddd6fe;
  background: #fbfaff;
}

.ttcrm-timeline {
  display: grid;
  gap: 10px;
}

.ttcrm-timeline-item {
  border-left: 4px solid var(--ttcrm-red);
  background: #f9fafb;
  border-radius: 12px;
  padding: 12px;
}

.ttcrm-timeline-item strong {
  display: inline-block;
  margin-right: 8px;
}

.ttcrm-timeline-item em {
  color: var(--ttcrm-muted);
  font-size: 12px;
  font-style: normal;
}

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

.ttcrm-timeline-item details {
  margin-top: 8px;
}

.ttcrm-import-box {
  border-color: #fecaca;
}

@media (max-width: 1400px) {
  .ttcrm-cards {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }
  .ttcrm-filter-form {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }
  .ttcrm-form-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 980px) {
  .ttcrm-grid-2,
  .ttcrm-settings-grid {
    grid-template-columns: 1fr;
  }
  .ttcrm-cards,
  .ttcrm-filter-form,
  .ttcrm-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ttcrm-hero,
  .ttcrm-lead-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .ttcrm-hero-actions {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .ttcrm-wrap {
    padding: 12px;
  }
  .ttcrm-frontend-topbar {
    gap: 8px;
    padding: 7px 10px;
  }
  .ttcrm-core-link {
    display: none;
  }
  .ttcrm-cards,
  .ttcrm-filter-form,
  .ttcrm-form-grid,
  .ttcrm-detail-grid {
    grid-template-columns: 1fr;
  }
  .ttcrm-hero {
    padding: 16px;
    border-radius: 14px;
  }
  .ttcrm-hero h1 {
    font-size: 21px;
  }
  
.ttcrm-wrap .button[disabled],
.ttcrm-wrap button[disabled],
.ttcrm-wrap input[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.ttcrm-actions .button {
  margin: 0 !important;
}

.ttcrm-panel .submit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.ttcrm-filter-form .button,
.ttcrm-filter-form button,
.ttcrm-lead-form .button,
.ttcrm-stack-form .button {
  width: auto;
  max-width: 100%;
}

.ttcrm-filter-form select,
.ttcrm-lead-form select,
.ttcrm-stack-form select,
.ttcrm-settings-form select {
  appearance: auto;
  background-color: #fff;
}

.ttcrm-tabs {
    gap: 6px;
  }
  .ttcrm-tab {
    padding: 8px 11px;
    font-size: 12px;
  }
  .ttcrm-user-badge strong,
  .ttcrm-user-badge em {
    display: none;
  }
}

.ttcrm-filter-summary {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  color: #374151;
  font-size: 13px;
}

.ttcrm-filter-summary strong {
  color: #111827;
}

.ttcrm-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 8px 0;
}

.ttcrm-pagination-summary {
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}

.ttcrm-pagination-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ttcrm-pagination .button.disabled {
  opacity: .45;
  pointer-events: none;
}

.ttcrm-page-ellipsis {
  color: #6b7280;
  padding: 0 2px;
  font-weight: 800;
}

.ttcrm-muted-text {
  color: #4b5563;
  margin: 0 0 12px;
}

.ttcrm-count-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px;
}

.ttcrm-count-tile {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-height: 96px;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
}

.ttcrm-count-tile span,
.ttcrm-count-tile small {
  display: block;
}

.ttcrm-count-tile span {
  font-size: 12px;
  font-weight: 800;
  color: #4b5563;
  line-height: 1.25;
}

.ttcrm-count-tile strong {
  display: block;
  margin: 5px 0 4px;
  font-size: 24px;
  line-height: 1;
  color: #111827;
}

.ttcrm-count-tile small {
  font-size: 11px;
  line-height: 1.3;
  color: #6b7280;
}

.ttcrm-warning-text {
  margin: 12px 0 0;
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
  padding: 9px 11px;
  border-radius: 10px;
  color: #92400e;
}

@media (max-width: 1280px) {
  .ttcrm-count-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 760px) {
  .ttcrm-count-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
  .ttcrm-pagination {
    align-items: flex-start;
  }
}


/* CRM top-bar property selector */
.ttcrm-scope-selector{position:relative;min-width:260px;max-width:380px;color:#172033;z-index:40}.ttcrm-scope-selector form{margin:0}.ttcrm-scope-selector details{position:relative}.ttcrm-scope-selector summary{list-style:none;display:flex;align-items:center;gap:10px;justify-content:space-between;min-height:38px;border:1px solid #dde3ea;background:#fff;border-radius:999px;padding:7px 12px;cursor:pointer;box-shadow:0 5px 14px rgba(15,23,42,.05)}.ttcrm-scope-selector summary::-webkit-details-marker{display:none}.ttcrm-scope-selector summary span{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#697386;font-weight:800}.ttcrm-scope-selector summary strong{font-size:13px;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ttcrm-scope-menu{position:absolute;right:0;top:calc(100% + 8px);width:min(390px,calc(100vw - 36px));background:#fff;border:1px solid #dde3ea;border-radius:16px;box-shadow:0 20px 45px rgba(15,23,42,.18);padding:12px;z-index:99999}.ttcrm-scope-search{width:100%;min-height:38px;border:1px solid #ccd3dc;border-radius:10px;padding:8px 10px;margin-bottom:9px}.ttcrm-scope-checks{max-height:250px;overflow:auto;display:grid;gap:6px}.ttcrm-scope-check{display:flex;gap:9px;align-items:flex-start;padding:9px 10px;border:1px solid #edf0f4;border-radius:11px;background:#fbfcfd;cursor:pointer}.ttcrm-scope-check:hover{border-color:#f3b0b0;background:#fffafa}.ttcrm-scope-check input{margin-top:3px}.ttcrm-scope-check span{display:block}.ttcrm-scope-check strong{display:block;font-size:13px;color:#172033;line-height:1.25}.ttcrm-scope-check em{display:block;font-style:normal;font-size:11px;color:#697386;margin-top:2px}.ttcrm-scope-all{margin-bottom:8px;background:#fff;border-color:#dbe3ee}.ttcrm-scope-all strong{color:#111827}.ttcrm-scope-actions{display:flex;gap:8px;justify-content:flex-end;align-items:center;margin-top:11px;border-top:1px solid #eef2f6;padding-top:10px}.ttcrm-scope-actions .button{display:inline-flex;align-items:center;justify-content:center;min-height:38px;line-height:1;padding:8px 14px;border-radius:10px;text-decoration:none}.ttcrm-scope-actions .ttcrm-scope-clear{background:#fff;color:#d60302;border-color:#f1a6a6;box-shadow:none}.ttcrm-scope-actions .ttcrm-scope-clear:hover,.ttcrm-scope-actions .ttcrm-scope-clear:focus{background:#fff7f7;color:#a40000;border-color:#d60302}.ttcrm-scope-actions .ttcrm-scope-apply{background:#d60302;border-color:#d60302;color:#fff}.ttcrm-scope-empty{font-size:12px;color:#697386;border:1px dashed #d8dee7;border-radius:999px;padding:8px 11px;background:#fbfcfd}.ttcrm-frontend-topbar .ttcrm-scope-selector{min-width:280px;max-width:420px}.ttcrm-frontend-topbar .ttcrm-scope-selector summary{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.24);color:#fff;box-shadow:none}.ttcrm-frontend-topbar .ttcrm-scope-selector summary span,.ttcrm-frontend-topbar .ttcrm-scope-selector summary strong{color:#fff}.ttcrm-frontend-topbar .ttcrm-scope-menu{color:#172033}.ttcrm-hero-actions .ttcrm-scope-selector{margin-right:8px}.ttcrm-hero-actions{gap:10px;flex-wrap:wrap}
@media(max-width:782px){.ttcrm-scope-selector,.ttcrm-frontend-topbar .ttcrm-scope-selector{width:100%;max-width:none;min-width:0}.ttcrm-scope-selector summary strong{max-width:calc(100vw - 150px)}.ttcrm-scope-menu{left:0;right:auto;width:100%}.ttcrm-frontend-topbar{align-items:stretch}.ttcrm-hero-actions{width:100%}}

/* CRM v0.1.28 dashboard and safety panels */
.ttcrm-dashboard-filter-panel .ttcrm-panel-head {
  margin-bottom: 10px;
}

.ttcrm-dashboard-cards {
  margin-top: 4px;
}

.ttcrm-danger-panel {
  border-color: #fecaca;
  background: #fffafa;
}

.ttcrm-danger-panel .ttcrm-panel-head h2 {
  color: #991b1b;
}

.ttcrm-count-check-lazy .button {
  margin-top: 2px;
}


.ttcrm-lead-inbox-table th.ttcrm-manual-column,
.ttcrm-lead-inbox-table td.ttcrm-manual-column,
.ttcrm-lead-inbox-table th.ttcrm-ai-column,
.ttcrm-lead-inbox-table td.ttcrm-ai-column {
  min-width: 88px;
  white-space: nowrap;
}

.ttcrm-lead-inbox-table th.ttcrm-ai-column,
.ttcrm-lead-inbox-table td.ttcrm-ai-column {
  background: #fafafa;
  color: #4b5563;
}

.ttcrm-lead-inbox-table th.ttcrm-ai-column {
  color: #5b21b6;
}

/* CRM v0.1.31 Lead Inbox wide-table usability */
.ttcrm-lead-inbox-scroll-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
}

.ttcrm-lead-inbox-table {
  border-collapse: separate;
  border-spacing: 0;
}

.ttcrm-lead-inbox-table th.ttcrm-actions-head,
.ttcrm-lead-inbox-table td.ttcrm-actions-cell {
  position: sticky;
  right: 0;
  z-index: 8;
  min-width: 74px;
  background: #fff;
  box-shadow: -8px 0 12px rgba(15,23,42,.08);
}

.ttcrm-lead-inbox-table th.ttcrm-actions-head {
  z-index: 12;
  background: #f9fafb;
}

.ttcrm-lead-inbox-table td.ttcrm-actions-cell .ttcrm-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex-wrap: nowrap;
}

.ttcrm-lead-inbox-table td.ttcrm-actions-cell .button {
  width: 100%;
  margin: 0 !important;
}

.ttcrm-sticky-scrollbar {
  display: none;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(255,255,255,.98);
  border: 1px solid #d7dde6;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(15,23,42,.16);
  z-index: 99998;
}

.ttcrm-sticky-scrollbar.is-visible {
  display: block;
  position: fixed;
  bottom: 8px;
}

.ttcrm-sticky-scrollbar > div {
  height: 1px;
}

/* CRM v0.1.32 auto sync status */
.ttcrm-auto-sync-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 12px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  background: #f8fbff;
  font-size: 12px;
}
.ttcrm-auto-sync-status > div {
  min-width: 0;
}
.ttcrm-auto-sync-error {
  grid-column: 1 / -1;
  color: #991b1b;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 6px 8px;
}
.ttcrm-badge.ttcrm-ok {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.ttcrm-badge {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

/* CRM v0.1.33 Lead Inbox frozen header/actions and settings-only manual sync */
.ttcrm-lead-inbox-scroll-wrap {
  max-height: calc(100vh - 180px);
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.ttcrm-lead-inbox-table {
  width: max-content;
  min-width: 100%;
  overflow: visible;
}

.ttcrm-lead-inbox-table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #f9fafb;
  box-shadow: 0 1px 0 #d1d5db;
}

.ttcrm-lead-inbox-table th.ttcrm-actions-head,
.ttcrm-lead-inbox-table td.ttcrm-actions-cell,
.ttcrm-lead-inbox-table th:last-child,
.ttcrm-lead-inbox-table td:last-child {
  position: -webkit-sticky;
  position: sticky;
  right: 0;
  min-width: 82px;
  width: 82px;
  background: #fff;
  box-shadow: -8px 0 12px rgba(15,23,42,.10);
}

.ttcrm-lead-inbox-table th.ttcrm-actions-head,
.ttcrm-lead-inbox-table thead th:last-child {
  top: 0;
  z-index: 50;
  background: #f9fafb;
}

.ttcrm-lead-inbox-table td.ttcrm-actions-cell,
.ttcrm-lead-inbox-table td:last-child {
  z-index: 35;
}

.ttcrm-lead-inbox-table tbody td.ttcrm-actions-cell,
.ttcrm-lead-inbox-table tbody td:last-child {
  background: #fff;
}

#ttcrm-manual-voice-ai-sync-settings {
  margin-top: 14px;
}


/* CRM v0.1.34 IST auto-sync time display support + squeezed Lead Inbox table */
.ttcrm-lead-inbox-table {
  table-layout: auto;
  font-size: 11px;
}

.ttcrm-lead-inbox-table th,
.ttcrm-lead-inbox-table td {
  padding: 8px 7px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  vertical-align: top;
}

.ttcrm-lead-inbox-table thead th {
  white-space: normal !important;
  overflow-wrap: normal;
  text-align: center;
  vertical-align: middle;
  font-size: 10.5px;
  line-height: 1.15;
  letter-spacing: .012em;
}

.ttcrm-lead-inbox-table th.ttcrm-manual-column,
.ttcrm-lead-inbox-table td.ttcrm-manual-column,
.ttcrm-lead-inbox-table th.ttcrm-ai-column,
.ttcrm-lead-inbox-table td.ttcrm-ai-column {
  min-width: 62px !important;
  width: 72px;
  max-width: 86px;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.ttcrm-lead-inbox-table th.ttcrm-manual-column,
.ttcrm-lead-inbox-table th.ttcrm-ai-column {
  font-size: 10px;
  padding-left: 5px;
  padding-right: 5px;
}

.ttcrm-lead-inbox-table th:nth-child(1),
.ttcrm-lead-inbox-table td:nth-child(1) { min-width: 112px; max-width: 126px; }
.ttcrm-lead-inbox-table th:nth-child(2),
.ttcrm-lead-inbox-table td:nth-child(2) { min-width: 94px; max-width: 112px; }
.ttcrm-lead-inbox-table th:nth-child(3),
.ttcrm-lead-inbox-table td:nth-child(3) { min-width: 104px; max-width: 118px; }
.ttcrm-lead-inbox-table th:nth-child(4),
.ttcrm-lead-inbox-table td:nth-child(4) { min-width: 118px; max-width: 150px; }
.ttcrm-lead-inbox-table th:nth-child(5),
.ttcrm-lead-inbox-table td:nth-child(5) { min-width: 106px; max-width: 130px; }
.ttcrm-lead-inbox-table th:nth-child(6),
.ttcrm-lead-inbox-table td:nth-child(6) { min-width: 86px; max-width: 102px; }
.ttcrm-lead-inbox-table th:nth-child(7),
.ttcrm-lead-inbox-table td:nth-child(7) { min-width: 96px; max-width: 118px; }
.ttcrm-lead-inbox-table th:nth-child(16),
.ttcrm-lead-inbox-table td:nth-child(16),
.ttcrm-lead-inbox-table th:nth-child(17),
.ttcrm-lead-inbox-table td:nth-child(17),
.ttcrm-lead-inbox-table th:nth-child(18),
.ttcrm-lead-inbox-table td:nth-child(18),
.ttcrm-lead-inbox-table th:nth-child(19),
.ttcrm-lead-inbox-table td:nth-child(19),
.ttcrm-lead-inbox-table th:nth-child(26),
.ttcrm-lead-inbox-table td:nth-child(26),
.ttcrm-lead-inbox-table th:nth-child(27),
.ttcrm-lead-inbox-table td:nth-child(27) { min-width: 78px !important; max-width: 108px; }
.ttcrm-lead-inbox-table th:nth-child(28),
.ttcrm-lead-inbox-table td:nth-child(28) { min-width: 94px; max-width: 112px; }

.ttcrm-lead-inbox-table th.ttcrm-actions-head,
.ttcrm-lead-inbox-table td.ttcrm-actions-cell,
.ttcrm-lead-inbox-table th:last-child,
.ttcrm-lead-inbox-table td:last-child {
  min-width: 74px !important;
  width: 74px !important;
  max-width: 74px !important;
  white-space: normal !important;
}

.ttcrm-lead-inbox-table td.ttcrm-actions-cell {
  padding-left: 6px;
  padding-right: 6px;
}

/* CRM v0.1.35 compact Edit/View lead UI + read-only Voice AI guidance */
.ttcrm-lead-form .ttcrm-form-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(165px, 220px));
  justify-content: start;
  align-items: start;
  gap: 10px;
}

.ttcrm-lead-form .ttcrm-form-grid-compact label {
  min-width: 0;
}

.ttcrm-lead-form .ttcrm-form-grid-compact input,
.ttcrm-lead-form .ttcrm-form-grid-compact select {
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 13px;
}

.ttcrm-lead-form .ttcrm-form-grid-compact small {
  font-size: 10.5px;
  line-height: 1.25;
  color: #6b7280;
}

.ttcrm-lead-form .ttcrm-wide-label textarea {
  min-height: 68px;
  padding: 8px 10px;
}

.ttcrm-ai-reference-panel {
  border: 1px solid #e5ddff;
  border-radius: 14px;
  background: #fbfaff;
  padding: 12px;
  margin: 0 0 14px;
}

.ttcrm-inline-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ttcrm-inline-panel-head h3 {
  margin: 0;
  font-size: 14px;
  color: #4c1d95;
}

.ttcrm-inline-panel-head span {
  font-size: 11px;
  color: #6b7280;
}

.ttcrm-ai-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 165px));
  gap: 8px;
  justify-content: start;
}

.ttcrm-ai-reference-grid label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #4c1d95;
}

.ttcrm-ai-reference-grid input[readonly] {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #ddd6fe;
  background: #fff;
  color: #312e81;
  font-weight: 700;
  font-size: 12px;
  cursor: default;
}

.ttcrm-manual-ai-comparison-panel {
  padding-bottom: 12px;
}

.ttcrm-manual-ai-comparison-table {
  table-layout: fixed;
}

.ttcrm-manual-ai-comparison-table th,
.ttcrm-manual-ai-comparison-table td {
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.25;
}

.ttcrm-manual-ai-comparison-table th:first-child,
.ttcrm-manual-ai-comparison-table td:first-child {
  width: 140px;
}

.ttcrm-ai-readonly-cell {
  background: #fbfaff;
  color: #4c1d95;
  font-weight: 700;
}

@media (min-width: 1200px) {
  .ttcrm-lead-form .ttcrm-form-grid-compact {
    grid-template-columns: repeat(6, minmax(150px, 205px));
  }
}

/* CRM v0.1.36 View cleanup + revenue field + tighter edit/view grids */
.ttcrm-lead-form .ttcrm-form-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 185px));
  gap: 8px;
}

.ttcrm-lead-form .ttcrm-form-grid-compact input,
.ttcrm-lead-form .ttcrm-form-grid-compact select {
  min-height: 32px;
  padding: 5px 8px;
}

.ttcrm-lead-view-main {
  align-items: start;
}

.ttcrm-lead-detail-readonly .ttcrm-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}

.ttcrm-lead-detail-readonly .ttcrm-detail-grid div,
.ttcrm-lead-notes-readonly .ttcrm-readonly-note {
  border: 1px solid var(--ttcrm-border);
  border-radius: 10px;
  padding: 8px 9px;
  background: #fff;
}

.ttcrm-lead-detail-readonly .ttcrm-detail-grid span,
.ttcrm-lead-notes-readonly .ttcrm-readonly-note span {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ttcrm-muted);
  margin-bottom: 4px;
}

.ttcrm-lead-detail-readonly .ttcrm-detail-grid strong {
  font-size: 12.5px;
  line-height: 1.3;
  word-break: break-word;
}

.ttcrm-lead-notes-readonly .ttcrm-readonly-note + .ttcrm-readonly-note {
  margin-top: 8px;
}

.ttcrm-lead-notes-readonly .ttcrm-readonly-note p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
}

.ttcrm-muted-note {
  margin: 10px 0 0;
  color: var(--ttcrm-muted);
  font-size: 12px;
}

@media (min-width: 1200px) {
  .ttcrm-lead-form .ttcrm-form-grid-compact {
    grid-template-columns: repeat(7, minmax(135px, 180px));
  }
}

/* CRM v0.1.37 Edit Lead section UI cleanup */
.ttcrm-lead-form {
  max-width: 1480px;
}

.ttcrm-ai-reference-strip-panel {
  padding: 10px 12px;
  margin-bottom: 12px;
}

.ttcrm-ai-reference-strip-panel .ttcrm-inline-panel-head {
  margin-bottom: 8px;
}

.ttcrm-ai-reference-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
  gap: 6px;
}

.ttcrm-ai-reference-chip {
  border: 1px solid #ddd6fe;
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  min-height: 42px;
}

.ttcrm-ai-reference-chip span {
  display: block;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 800;
  color: #5b21b6;
  text-transform: uppercase;
  letter-spacing: .02em;
  margin-bottom: 4px;
}

.ttcrm-ai-reference-chip strong {
  display: block;
  color: #111827;
  font-size: 12px;
  line-height: 1.2;
  word-break: break-word;
}

.ttcrm-edit-sections {
  display: grid;
  gap: 12px;
}

.ttcrm-edit-section {
  border: 1px solid var(--ttcrm-border);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.ttcrm-edit-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 7px;
}

.ttcrm-edit-section-head h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
  color: #111827;
}

.ttcrm-edit-section .ttcrm-form-grid-compact {
  gap: 9px;
  align-items: start;
}

.ttcrm-edit-section .ttcrm-form-grid-compact label,
.ttcrm-notes-grid label {
  gap: 4px;
}

.ttcrm-edit-section .ttcrm-form-grid-compact input,
.ttcrm-edit-section .ttcrm-form-grid-compact select {
  min-height: 31px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12.5px;
}

.ttcrm-edit-section .ttcrm-form-grid-compact small,
.ttcrm-notes-grid small {
  font-size: 10px;
  line-height: 1.25;
  color: #6b7280;
  font-weight: 600;
}

.ttcrm-form-grid-contact {
  grid-template-columns: 1.05fr 1.05fr 1fr 1fr !important;
}

.ttcrm-form-grid-booking {
  grid-template-columns: repeat(6, minmax(115px, 1fr)) !important;
}

.ttcrm-form-grid-status {
  grid-template-columns: repeat(6, minmax(125px, 1fr)) !important;
}

.ttcrm-form-grid-followup {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
}

.ttcrm-notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.ttcrm-notes-grid .ttcrm-wide-label {
  margin-top: 0;
}

.ttcrm-notes-grid textarea {
  min-height: 72px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 12.5px;
}

.ttcrm-lead-form .submit {
  margin-top: 14px;
}

@media (max-width: 1350px) {
  .ttcrm-form-grid-booking,
  .ttcrm-form-grid-status {
    grid-template-columns: repeat(4, minmax(130px, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .ttcrm-form-grid-contact,
  .ttcrm-form-grid-booking,
  .ttcrm-form-grid-status,
  .ttcrm-form-grid-followup,
  .ttcrm-notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  .ttcrm-form-grid-contact,
  .ttcrm-form-grid-booking,
  .ttcrm-form-grid-status,
  .ttcrm-form-grid-followup,
  .ttcrm-notes-grid,
  .ttcrm-ai-reference-strip {
    grid-template-columns: 1fr !important;
  }
}

.ttcrm-missed-filter-form {
  align-items: end;
}

.ttcrm-missed-abandoned-table th,
.ttcrm-missed-abandoned-table td {
  vertical-align: top;
}

.ttcrm-inline-assign-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 460px;
}

.ttcrm-inline-assign-form input[type="text"] {
  width: 100%;
  min-height: 34px;
}

.ttcrm-muted-text {
  color: #6b7280;
  font-size: 12px;
}

.ttcrm-lead-form input:disabled,
.ttcrm-lead-form select:disabled,
.ttcrm-lead-form textarea:disabled {
  background: #f3f4f6 !important;
  color: #6b7280 !important;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .ttcrm-inline-assign-form {
    grid-template-columns: 1fr;
    min-width: 260px;
  }
}

/* CRM v0.1.40: keep only the real table scrollbar; duplicate fixed bottom scrollbar removed. */
.ttcrm-sticky-scrollbar{display:none!important;}
.ttcrm-lead-inbox-scroll-wrap{max-width:100%;}
.ttcrm-wrap{overflow-x:hidden;}


/* CRM v0.1.41: reduce duplicate horizontal scrollbars; keep only the internal table scroll for Lead Inbox. */
.ttcrm-sticky-scrollbar,
.ttcrm-lead-inbox-sticky-scrollbar,
[data-ttcrm-sticky-scrollbar] { display: none !important; visibility: hidden !important; }
.ttcrm-wrap,
.ttcrm-panel,
.ttcrm-table-wrap { max-width: 100%; }
.ttcrm-lead-inbox-scroll-wrap {
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.ttcrm-lead-inbox-scroll-wrap .ttcrm-table { margin-bottom: 0; }
body.ttcrm-frontend-page,
body.wp-admin .ttcrm-wrap { overflow-x: hidden !important; }

/* CRM v0.1.46 compact dashboard KPI sections */
.ttcrm-dashboard-section {
  margin-top: 14px;
  padding: 14px;
}

.ttcrm-dashboard-section-head {
  margin-bottom: 10px;
}

.ttcrm-dashboard-compact-cards {
  grid-template-columns: repeat(8, minmax(105px, 1fr));
  gap: 9px;
  margin-bottom: 0;
}

.ttcrm-dashboard-compact-cards .ttcrm-card {
  min-height: 62px;
  padding: 10px 11px;
  border-radius: 12px;
}

.ttcrm-dashboard-compact-cards .ttcrm-card span {
  font-size: 11px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.ttcrm-dashboard-compact-cards .ttcrm-card strong {
  font-size: 20px;
}

.ttcrm-dashboard-dimension-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px;
}

.ttcrm-dashboard-dimension-card {
  border: 1px solid var(--ttcrm-border);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.ttcrm-dashboard-dimension-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.2;
  color: #111827;
}

.ttcrm-dashboard-mini-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.ttcrm-dashboard-mini-cards div {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 7px 8px;
  background: #fbfcfd;
  min-height: 48px;
}

.ttcrm-dashboard-mini-cards span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ttcrm-muted);
  margin-bottom: 4px;
}

.ttcrm-dashboard-mini-cards strong {
  display: block;
  font-size: 18px;
  line-height: 1;
  color: #111827;
}


.ttcrm-dashboard-card-note,
.ttcrm-dashboard-mini-money {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 10px;
  line-height: 1.2;
  color: var(--ttcrm-muted);
  white-space: normal;
}

.ttcrm-dashboard-mini-money {
  font-size: 9.5px;
  color: #374151;
}

@media (max-width: 1380px) {
  .ttcrm-dashboard-compact-cards { grid-template-columns: repeat(4, minmax(110px, 1fr)); }
  .ttcrm-dashboard-dimension-grid { grid-template-columns: repeat(3, minmax(200px, 1fr)); }
}

@media (max-width: 920px) {
  .ttcrm-dashboard-compact-cards { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .ttcrm-dashboard-dimension-grid { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
}

@media (max-width: 560px) {
  .ttcrm-dashboard-compact-cards,
  .ttcrm-dashboard-dimension-grid { grid-template-columns: 1fr; }
}

/* CRM v0.1.48 dashboard graphs */
.ttcrm-dashboard-section-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.ttcrm-dashboard-chart-card {
  border: 1px solid #e6eaf0;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  padding: 10px 11px;
  min-height: 92px;
}

.ttcrm-dashboard-chart-title {
  font-size: 11px;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 9px;
}

.ttcrm-dashboard-chart-empty {
  border: 1px dashed #d8dee7;
  border-radius: 10px;
  color: #697386;
  background: #fff;
  padding: 12px;
  font-size: 12px;
}

.ttcrm-dashboard-bar-chart,
.ttcrm-dashboard-grouped-chart {
  display: grid;
  gap: 7px;
}

.ttcrm-dashboard-bar-row,
.ttcrm-dashboard-group-bar-line {
  display: grid;
  grid-template-columns: minmax(110px, 190px) minmax(90px, 1fr) minmax(70px, auto);
  gap: 9px;
  align-items: center;
  font-size: 11px;
}

.ttcrm-dashboard-bar-label,
.ttcrm-dashboard-group-label {
  color: #111827;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ttcrm-dashboard-bar-track {
  height: 9px;
  border-radius: 999px;
  background: #edf1f6;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.05);
}

.ttcrm-dashboard-bar-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: #d60302;
}

.ttcrm-dashboard-bar-row strong,
.ttcrm-dashboard-group-bar-line strong {
  color: #111827;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.ttcrm-dashboard-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: -2px 0 9px;
  color: #697386;
  font-size: 10px;
  font-weight: 700;
}

.ttcrm-dashboard-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ttcrm-dashboard-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d60302;
  display: inline-block;
}

.ttcrm-dashboard-grouped-chart {
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.ttcrm-dashboard-grouped-row {
  display: grid;
  grid-template-columns: minmax(110px, 170px) 1fr;
  gap: 10px;
  align-items: start;
  border-top: 1px solid #f0f3f7;
  padding-top: 7px;
}

.ttcrm-dashboard-grouped-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.ttcrm-dashboard-group-bars {
  display: grid;
  gap: 4px;
}

.ttcrm-dashboard-group-bar-line {
  grid-template-columns: minmax(54px, 68px) minmax(90px, 1fr) minmax(70px, auto);
}

.ttcrm-dashboard-group-bar-line span {
  font-size: 10px;
  color: #697386;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.ttcrm-chart-active,
.ttcrm-dashboard-legend-dot.ttcrm-chart-active,
.ttcrm-chart-active_estimated_revenue,
.ttcrm-dashboard-legend-dot.ttcrm-chart-active_estimated_revenue {
  background: #16a34a;
}

.ttcrm-chart-hot,
.ttcrm-dashboard-legend-dot.ttcrm-chart-hot,
.ttcrm-chart-hot_estimated_revenue,
.ttcrm-dashboard-legend-dot.ttcrm-chart-hot_estimated_revenue,
.ttcrm-chart-followup {
  background: #f59e0b;
}

.ttcrm-chart-confirmed,
.ttcrm-dashboard-legend-dot.ttcrm-chart-confirmed {
  background: #2563eb;
}

.ttcrm-chart-lost,
.ttcrm-dashboard-legend-dot.ttcrm-chart-lost {
  background: #7f1d1d;
}

.ttcrm-chart-missed,
.ttcrm-dashboard-legend-dot.ttcrm-chart-missed {
  background: #6b7280;
}

.ttcrm-chart-ai,
.ttcrm-dashboard-legend-dot.ttcrm-chart-ai {
  background: #7c3aed;
}

.ttcrm-chart-total,
.ttcrm-dashboard-legend-dot.ttcrm-chart-total,
.ttcrm-chart-total_estimated_revenue,
.ttcrm-dashboard-legend-dot.ttcrm-chart-total_estimated_revenue {
  background: #d60302;
}

@media (max-width: 920px) {
  .ttcrm-dashboard-section-charts { grid-template-columns: 1fr; }
  .ttcrm-dashboard-grouped-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .ttcrm-dashboard-bar-row,
  .ttcrm-dashboard-group-bar-line { grid-template-columns: 1fr; gap: 4px; }
  .ttcrm-dashboard-bar-row strong,
  .ttcrm-dashboard-group-bar-line strong { text-align: left; }
}

/* CRM v0.1.49 preferred check-in month chart */
.ttcrm-checkin-month-panel {
  overflow: hidden;
}

.ttcrm-checkin-month-head {
  align-items: center;
}

.ttcrm-checkin-month-head span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ttcrm-muted);
}

.ttcrm-checkin-month-legend {
  display: flex;
  gap: 10px 16px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 12px;
  font-size: 12px;
  color: #3c434a;
}

.ttcrm-lg {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  margin-right: 4px;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
}

.ttcrm-lg-active { background: #dcfce7; color: #166534; }
.ttcrm-lg-hot { background: #fef3c7; color: #92400e; }
.ttcrm-lg-zero { background: #f3f4f6; color: #4b5563; }

.ttcrm-checkin-month-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ttcrm-checkin-month-table {
  --ttcrm-checkin-status-width: 168px;
  width: 100%;
  min-width: 1040px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 2px;
}

.ttcrm-checkin-month-table .ttcrm-checkin-status-col {
  width: var(--ttcrm-checkin-status-width);
}

.ttcrm-checkin-month-table .ttcrm-checkin-total-col {
  width: 58px;
}

.ttcrm-checkin-month-table th,
.ttcrm-checkin-month-table td {
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.ttcrm-checkin-status-head,
.ttcrm-checkin-status-cell {
  position: sticky;
  left: 0;
  z-index: 4;
  text-align: left !important;
  background: #fff;
  box-shadow: 6px 0 10px rgba(255,255,255,.9);
}

.ttcrm-checkin-total-head,
.ttcrm-checkin-total-cell {
  position: sticky;
  left: var(--ttcrm-checkin-status-width);
  z-index: 3;
  text-align: center !important;
  box-shadow: 6px 0 10px rgba(255,255,255,.78);
}

.ttcrm-checkin-status-head {
  padding: 8px 10px !important;
  font-weight: 900;
  border-radius: 9px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.ttcrm-checkin-total-head {
  height: 34px;
  border-radius: 9px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  font-weight: 900;
}

.ttcrm-checkin-status-cell {
  padding: 6px 8px !important;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
}

.ttcrm-checkin-status-cell strong,
.ttcrm-checkin-status-cell span {
  display: block;
}

.ttcrm-checkin-status-cell strong {
  font-size: 12px;
  color: #111827;
}

.ttcrm-checkin-status-cell span {
  font-size: 10px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ttcrm-checkin-total-cell {
  height: 38px;
  border-radius: 9px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
  overflow: hidden;
}

.ttcrm-checkin-total-cell strong {
  display: block;
  font-size: 12px;
  line-height: 38px;
}

.ttcrm-checkin-day-head {
  height: 34px;
  border-radius: 9px;
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
}

.ttcrm-checkin-day-head span,
.ttcrm-checkin-day-head small {
  display: block;
  line-height: 1.05;
}

.ttcrm-checkin-day-head span {
  font-size: 12px;
  font-weight: 900;
  padding-top: 5px;
}

.ttcrm-checkin-day-head small {
  font-size: 9px;
  color: #6b7280;
  margin-top: 2px;
}

.ttcrm-checkin-day-today {
  background: #ede9fe;
  border-color: #c4b5fd;
}

.ttcrm-checkin-cell {
  height: 38px;
  border-radius: 9px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  overflow: hidden;
}

.ttcrm-checkin-cell strong {
  display: block;
  font-size: 12px;
  line-height: 38px;
  font-weight: 900;
}

.ttcrm-checkin-active.ttcrm-checkin-has-count {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.ttcrm-checkin-hot.ttcrm-checkin-has-count {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.ttcrm-checkin-zero {
  color: #9ca3af;
}

@media (max-width: 920px) {
  .ttcrm-checkin-month-table {
    min-width: 920px;
  }
}

/* CRM v0.1.50 preferred check-in month selector */
.ttcrm-checkin-month-controls {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.ttcrm-checkin-month-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: #111827;
}

.ttcrm-checkin-month-controls select {
  min-height: 32px;
  min-width: 92px;
  border-radius: 8px;
}

.ttcrm-checkin-month-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.ttcrm-month-tab {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 8px 10px;
  cursor: pointer;
}

.ttcrm-month-tab:hover {
  border-color: #d60302;
  color: #d60302;
}

.ttcrm-month-tab.is-active {
  border-color: #d60302;
  background: #d60302;
  color: #fff;
}

.ttcrm-checkin-month-note {
  margin-left: auto;
  color: #6b7280;
  font-size: 11px;
}

.ttcrm-checkin-month-table {
  width: max-content;
  min-width: 1040px;
}

.ttcrm-checkin-month-table col:not(.ttcrm-checkin-status-col):not(.ttcrm-checkin-total-col) {
  width: 42px;
}

@media (max-width: 920px) {
  .ttcrm-checkin-month-note { margin-left: 0; width: 100%; }
}

/* CRM v0.1.52 preferred check-in month totals */
.ttcrm-month-tab {
  min-width: 56px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 9px;
  border-radius: 10px;
}

.ttcrm-month-tab .ttcrm-month-label {
  display: block;
  line-height: 1;
}

.ttcrm-month-tab .ttcrm-month-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.ttcrm-month-tab.has-count .ttcrm-month-count {
  background: #dbeafe;
  color: #1d4ed8;
}

.ttcrm-month-tab.is-zero .ttcrm-month-count {
  background: #f3f4f6;
  color: #9ca3af;
}

.ttcrm-month-tab.is-active .ttcrm-month-count {
  background: rgba(255,255,255,.95);
  color: #d60302;
}
