:root {
  color-scheme: light;
  font-family:
    Segoe UI,
    Arial,
    sans-serif;
  background: #f5f6f7;
  color: #1f2428;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f5f6f7;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 360px;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  border-left: 1px solid #dfe3e7;
  background: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.brand strong,
.brand span,
.mode-panel strong,
.mode-panel span {
  display: block;
}
.brand span,
.mode-panel span {
  color: #68717b;
  font-size: 13px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #17201b;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}
.brand-mark.large {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
}
.nav-list {
  display: grid;
  gap: 6px;
}
.nav-list button,
.icon-button,
.small-button,
.danger-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #1f2428;
  min-height: 40px;
}
.nav-list button {
  justify-content: flex-start;
  padding: 10px 12px;
  color: #424a53;
}
.nav-list button.active,
.nav-list button:hover {
  background: #e8f3ee;
  color: #16583e;
}
.mode-panel {
  position: absolute;
  right: 16px;
  left: 16px;
  bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #f8faf9;
}
.main {
  padding: 24px;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 4px;
  color: #6f7780;
  font-size: 13px;
}
h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}
h1 {
  font-size: 28px;
}
h2 {
  font-size: 18px;
}
.top-actions,
.quick-actions,
.work-actions,
.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.icon-button {
  width: 40px;
  height: 40px;
  border-color: #dfe3e7;
  background: #fff;
}
.icon-button:hover,
.small-button:hover {
  border-color: #aab4be;
}
.primary-button {
  padding: 0 14px;
  border-color: #166a4a;
  background: #166a4a;
  color: #fff;
  font-weight: 700;
}
.primary-button:hover {
  background: #10543a;
}
.primary-button.wide,
.small-button.wide,
.danger-button.wide {
  width: 100%;
}
.small-button {
  padding: 0 12px;
  border-color: #dfe3e7;
  background: #fff;
}
.danger-button {
  min-height: 40px;
  padding: 0 12px;
  border-color: #f0b8b2;
  background: #fff5f3;
  color: #a83224;
}
.danger-button:hover {
  border-color: #d76b5f;
  background: #ffe6e1;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}
.notice {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #f1c46b;
  border-radius: 8px;
  background: #fff8e8;
}
.notice button {
  display: inline-flex;
  border: 0;
  background: transparent;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metric {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.metric svg {
  color: #166a4a;
}
.metric span {
  color: #68717b;
}
.metric strong {
  grid-column: 1 / -1;
  font-size: 24px;
}
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}
.work-list {
  display: grid;
  gap: 10px;
}
.work-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.priority {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-weight: 800;
}
.priority-1 {
  background: #ffe6df;
  color: #b33121;
}
.priority-2 {
  background: #fff0c8;
  color: #8a5c00;
}
.priority-3 {
  background: #e7f0ff;
  color: #245c9f;
}
.work-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: right;
  border: 0;
  background: transparent;
}
.work-name {
  font-weight: 800;
}
.work-main span:not(.work-name) {
  color: #68717b;
}
.work-main strong {
  color: #1f2428;
}
.work-meta {
  display: grid;
  gap: 4px;
  color: #68717b;
  font-size: 13px;
  min-width: 120px;
}
.focus-panel,
.dashboard-panel,
.settings-panel,
.lead-panel,
.modal,
.auth-box {
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.focus-panel {
  padding: 18px;
  align-self: start;
}
.focus-panel p {
  color: #4b545d;
}
.focus-stats,
.leak-row,
.source-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #edf0f2;
}
.focus-stats strong,
.leak-row strong {
  font-size: 20px;
}
.pipeline {
  display: grid;
  gap: 18px;
}
.diagnosis-review {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.diagnosis-queue,
.diagnosis-workspace {
  display: grid;
  gap: 12px;
}
.section-head,
.review-hero,
.diagnosis-card-top,
.diagnosis-card-meta,
.review-actions,
.quick-action-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-head {
  padding: 14px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.section-head strong {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e8f3ee;
  color: #16583e;
}
.diagnosis-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.diagnosis-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
  color: #424a53;
  font-weight: 700;
}
.diagnosis-tabs button.active {
  border-color: #166a4a;
  background: #e8f3ee;
  color: #16583e;
}
.diagnosis-tabs span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #166a4a1a;
  font-size: 12px;
}
.diagnosis-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
  text-align: right;
}
.diagnosis-card:hover,
.diagnosis-card.active {
  border-color: #166a4a;
  background: #f8faf9;
}
.diagnosis-card.priority-1 {
  border-color: #f0b8b2;
}
.diagnosis-card.priority-2 {
  border-color: #f1c46b;
}
.diagnosis-card small,
.diagnosis-card-meta,
.review-hero span {
  color: #68717b;
  font-size: 13px;
}
.diagnosis-card-top span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf0f2;
  color: #424a53;
  font-size: 12px;
  font-weight: 700;
}
.diagnosis-workspace {
  min-width: 0;
}
.review-hero,
.review-panel {
  padding: 16px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.review-hero {
  align-items: flex-start;
}
.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf0f2;
  color: #424a53;
  font-size: 13px;
  font-weight: 800;
}
.alert-chip.priority-1 {
  background: #ffe6df;
  color: #b33121;
}
.alert-chip.priority-2 {
  background: #fff0c8;
  color: #8a5c00;
}
.review-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.review-grid.two-thirds {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
}
.review-panel {
  align-content: start;
  min-width: 0;
}
.review-panel h2 {
  margin-bottom: 12px;
}
.review-panel > span {
  color: #4b545d;
  font-size: 13px;
  font-weight: 800;
}
.review-panel textarea {
  min-height: 180px;
  margin-top: 8px;
  line-height: 1.6;
}
.review-panel .raw-textarea {
  min-height: 180px;
  color: #424a53;
  background: #f8faf9;
}
.quick-action-grid {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.pipeline-group {
  display: grid;
  gap: 10px;
}
.pipeline-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}
.pipeline-group-head h2 {
  margin-bottom: 2px;
}
.pipeline-group-head span {
  color: #68717b;
  font-size: 13px;
}
.pipeline-group-head strong {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.pipeline-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.pipeline-column {
  min-height: 250px;
  padding: 10px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #f9fafb;
}
.pipeline-group.premium .pipeline-column {
  border-color: #e3c37b;
  background: #fffaf0;
}
.pipeline-group.muted .pipeline-column {
  min-height: 180px;
  background: #f3f5f6;
}
.column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.column-head span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  color: #68717b;
}
.lead-card {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
  text-align: right;
}
.lead-card:hover {
  border-color: #9fb0bd;
}
.lead-card small {
  color: #68717b;
}
.table-section {
  display: grid;
  gap: 12px;
}
.filters {
  justify-content: space-between;
}
.filters select,
.search-box {
  min-height: 42px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(480px, 100%);
  padding: 0 12px;
}
.search-box input {
  width: 100%;
  border: 0;
  outline: none;
}
.filters select {
  padding: 0 12px;
}
.data-table {
  overflow: hidden;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.table-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr 72px 0.9fr 1.25fr 0.95fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  border: 0;
  border-top: 1px solid #edf0f2;
  background: #fff;
  text-align: right;
}
.table-row:first-child {
  border-top: 0;
}
.table-row:not(.table-head):hover {
  background: #f8faf9;
}
.table-head {
  color: #68717b;
  font-weight: 700;
}
.clients-section {
  display: grid;
  gap: 14px;
}
.clients-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.clients-toolbar select {
  width: auto;
  min-width: 150px;
}
.client-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.client-kpis div,
.client-stats-strip div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.client-kpis span,
.client-stats-strip span,
.client-card-meta,
.client-progress-line span,
.session-row small {
  color: #68717b;
  font-size: 13px;
}
.client-kpis strong,
.client-stats-strip strong {
  font-size: 22px;
}
.clients-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: 14px;
  align-items: start;
}
.client-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.client-status-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 260px;
  padding: 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fbfcfd;
}
.client-status-column.active {
  border-top: 4px solid #2f7d62;
}
.client-status-column.inactive {
  border-top: 4px solid #8d99a6;
}
.client-column-head,
.client-card-top,
.client-progress-line,
.client-card-meta,
.client-editor-head,
.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.client-column-head span {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  color: #68717b;
  font-weight: 700;
}
.client-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
  text-align: right;
}
.client-card:hover,
.client-card.active {
  border-color: #7a9b8e;
  box-shadow: 0 0 0 2px #2f7d6214;
}
.client-card.needs-contract {
  border-color: #ef8a52;
  background: #fff7ed;
  box-shadow: inset -5px 0 #df4f2d;
}
.client-card.needs-contract:hover,
.client-card.needs-contract.active {
  border-color: #df4f2d;
  box-shadow:
    inset -5px 0 #df4f2d,
    0 0 0 3px #df4f2d29;
}
.client-card.needs-receipt {
  border-color: #c83a2a;
  background: #fff4f2;
  box-shadow: inset 5px 0 #b42318;
}
.client-card.needs-receipt:hover,
.client-card.needs-receipt.active {
  border-color: #b42318;
  box-shadow:
    inset 5px 0 #b42318,
    0 0 0 3px #b4231829;
}
.client-card.needs-contract.needs-receipt {
  background: #fff7ed;
  box-shadow:
    inset -5px 0 #df4f2d,
    inset 5px 0 #b42318;
}
.client-card.needs-contract.needs-receipt:hover,
.client-card.needs-contract.needs-receipt.active {
  box-shadow:
    inset -5px 0 #df4f2d,
    inset 5px 0 #b42318,
    0 0 0 3px #b4231829;
}
.client-card-top strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.client-card-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.client-contract-alert {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #df4f2d;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.client-receipt-alert {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.client-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.client-status-pill.active {
  background: #e7f4ee;
  color: #166a4a;
}
.client-status-pill.inactive {
  background: #edf0f2;
  color: #4b545d;
}
.client-progress-bar {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f2;
}
.client-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f7d62;
}
.client-card-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.client-contract-missing {
  color: #b73a21;
  font-weight: 900;
}
.client-receipt-missing {
  color: #b42318;
  font-weight: 900;
}
.client-receipt-issued {
  color: #166a4a;
  font-weight: 800;
}
.client-editor {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.client-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 0;
}
.checkbox-field input,
.template-actions input {
  width: 16px;
  min-height: 16px;
}
.receipt-confirmation {
  padding: 10px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #f8faf9;
  font-weight: 800;
}
.client-sessions {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #edf0f2;
}
.session-add-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 8px;
}
.session-list {
  display: grid;
  gap: 8px;
}
.session-row {
  padding: 10px 0;
  border-top: 1px solid #edf0f2;
}
.session-row:first-child {
  border-top: 0;
}
.session-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.social-diagnosis {
  display: grid;
  gap: 14px;
}
.social-head,
.social-card-title,
.social-reply-head,
.social-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.social-head {
  justify-content: space-between;
}
.social-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.social-summary div {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.social-summary span,
.social-meta,
.social-reply-panel p {
  color: #68717b;
}
.social-summary strong {
  font-size: 24px;
}
.social-list {
  display: grid;
  gap: 10px;
}
.social-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.95fr) auto;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe3e7;
  border-right: 4px solid #9fb0bd;
  border-radius: 8px;
  background: #fff;
}
.social-card.status-sent {
  border-right-color: #2f7d62;
}
.social-card.status-failed {
  border-right-color: #c64b40;
}
.social-card.status-ignored {
  border-right-color: #aab4be;
}
.social-card-main,
.social-reply-panel {
  min-width: 0;
}
.social-card-title {
  flex-wrap: wrap;
}
.social-card-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.platform-pill,
.social-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.platform-pill {
  border: 1px solid #dfe3e7;
  background: #f8faf9;
  color: #38414a;
}
.social-status {
  background: #edf0f2;
  color: #38414a;
}
.social-status.status-sent {
  background: #e7f4ee;
  color: #166a4a;
}
.social-status.status-failed {
  background: #fff0ed;
  color: #a83224;
}
.social-status.status-received {
  background: #edf5ff;
  color: #1e5d92;
}
.social-comment {
  margin: 10px 0;
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.social-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
}
.social-reply-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: #fbfcfd;
}
.social-reply-head svg {
  color: #166a4a;
}
.social-reply-panel p {
  margin: 0;
  max-height: 78px;
  overflow: auto;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.social-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px;
  border-radius: 8px;
  background: #fff5f3;
  color: #a83224;
  font-size: 13px;
}
.social-actions {
  justify-content: flex-end;
  align-self: start;
  flex-wrap: wrap;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}
.dashboard-panel {
  padding: 18px;
  min-width: 0;
  max-width: 100%;
}
.wide-panel {
  grid-column: 1 / -1;
}
.funnel-bars {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.funnel-row {
  display: grid;
  grid-template-columns: 130px 1fr 40px;
  align-items: center;
  gap: 10px;
}
.funnel-row div {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf0f2;
}
.funnel-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f7d62;
}
.source-table {
  margin-top: 12px;
}
.source-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.5fr 0.6fr 0.6fr 0.9fr 0.9fr;
  gap: 8px;
  align-items: center;
}
.source-head {
  color: #68717b;
  font-weight: 700;
}
.sales-dashboard {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}
.dashboard-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
  min-width: 0;
  max-width: 100%;
}
.period-tabs,
.period-selector,
.dashboard-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.period-selector {
  justify-content: flex-start;
  max-width: 220px;
  min-width: 0;
}
.period-tabs button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
  color: #424a53;
}
.period-tabs button.active,
.period-tabs button:hover {
  border-color: #166a4a;
  background: #e8f3ee;
  color: #16583e;
}
.period-selector select,
.dashboard-filters select {
  min-height: 38px;
  max-width: 190px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
  color: #1f2428;
}
.sales-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
.sales-kpi {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 8px;
  min-height: 98px;
  padding: 14px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.sales-kpi svg {
  color: #166a4a;
}
.sales-kpi span {
  color: #68717b;
  font-size: 13px;
}
.sales-kpi strong {
  grid-column: 1 / -1;
  align-self: end;
  font-size: 21px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.diagnosis-money-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}
.diagnosis-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.diagnosis-money-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}
.diagnosis-money-grid h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.purchase-table,
.diagnosis-value-table {
  display: grid;
  gap: 8px;
}
.purchase-row,
.diagnosis-value-row {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border: 0;
  border-top: 1px solid #edf0f2;
  background: transparent;
  color: #1f2428;
  text-align: right;
}
.purchase-row {
  grid-template-columns: minmax(0, 1.5fr) 0.55fr 0.55fr 0.8fr;
}
.diagnosis-value-row {
  grid-template-columns: minmax(0, 1.2fr) 0.8fr minmax(0, 1fr) 0.75fr 0.75fr;
}
.diagnosis-value-row:not(.diagnosis-value-head):hover {
  background: #f8faf9;
}
.purchase-head,
.diagnosis-value-head {
  color: #68717b;
  font-weight: 700;
}
.diagnosis-value-row span,
.purchase-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.diagnosis-value-row span:first-child {
  display: grid;
  gap: 2px;
}
.diagnosis-value-row small {
  color: #68717b;
}
.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.panel-title-row span {
  color: #68717b;
  font-size: 13px;
}
.monthly-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 12px;
  min-height: 260px;
  margin-top: 18px;
}
.month-bar {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 8px;
  min-width: 0;
  text-align: center;
}
.bar-track {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  align-items: stretch;
  min-height: 190px;
  border-radius: 8px;
  overflow: hidden;
  background: #edf0f2;
}
.bar-track span {
  display: block;
  min-height: 0;
}
.bar-intro,
.legend-intro {
  background: #2f7d62;
}
.bar-package,
.legend-package {
  background: #2f6fbb;
}
.bar-other,
.legend-other {
  background: #b56b3a;
}
.month-bar strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.month-bar > span {
  color: #68717b;
  font-size: 12px;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: #68717b;
  font-size: 13px;
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.recommendation-list,
.leader-list,
.rep-table,
.records-table {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.recommendation-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid #edf0f2;
}
.recommendation-row:first-child {
  border-top: 0;
}
.recommendation-row span {
  color: #4b545d;
}
.sales-source-table,
.records-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}
.rep-table,
.recommendation-list,
.leader-list {
  min-width: 0;
  max-width: 100%;
}
.sales-source-table .source-row {
  grid-template-columns: 1fr 1.2fr 1.1fr 0.55fr 0.6fr 0.9fr 0.9fr 0.6fr 0.95fr;
  min-width: 940px;
}
.record-row,
.rep-row,
.leader-row {
  display: grid;
  gap: 8px;
  align-items: center;
  border: 0;
  border-top: 1px solid #edf0f2;
  background: transparent;
  color: #1f2428;
  text-align: right;
}
.record-row {
  grid-template-columns: 1.2fr 0.9fr 1fr 0.8fr 0.65fr 0.8fr 0.9fr 0.45fr;
  min-width: 860px;
  padding: 10px 0;
}
.record-row:not(.record-head):hover,
.leader-row:hover {
  background: #f8faf9;
}
.record-head,
.rep-head {
  color: #68717b;
  font-weight: 700;
}
.leader-row {
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  padding: 10px 0;
}
.leader-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.leader-row small {
  color: #68717b;
  overflow-wrap: anywhere;
}
.rep-row {
  grid-template-columns: 1fr 0.9fr 0.55fr 0.6fr 0.8fr 0.5fr;
  padding: 9px 0;
}
.rep-row span,
.record-row span,
.source-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.settings-panel {
  padding: 18px;
}
.settings-panel svg {
  color: #166a4a;
}
.settings-panel li {
  margin-bottom: 8px;
}
.lead-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.quick-actions {
  margin-bottom: 18px;
}
.danger-zone {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #edf0f2;
}
.conversion-strip,
.money-split {
  display: grid;
  gap: 10px;
}
.conversion-strip {
  grid-template-columns: 1fr;
  margin-bottom: 18px;
}
.ai-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid #d8e5df;
  border-radius: 8px;
  background: #f5fbf8;
}
.ai-panel-head,
.ai-score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.ai-panel-head span,
.ai-score-line span,
.ai-result dt {
  color: #68717b;
  font-size: 13px;
}
.ai-panel-head strong,
.ai-score-line strong {
  display: block;
}
.ai-result {
  display: grid;
  gap: 10px;
}
.ai-result p {
  margin: 0;
  color: #344039;
}
.ai-result dl {
  display: grid;
  gap: 8px;
  margin: 0;
}
.ai-result div {
  display: grid;
  gap: 3px;
}
.ai-result dd {
  margin: 0;
  color: #1f2428;
}
.money-split {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}
.conversion-strip div,
.money-split div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #f8faf9;
}
.conversion-strip span,
.money-split span {
  color: #68717b;
  font-size: 13px;
}
.conversion-strip strong,
.money-split strong {
  font-size: 18px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.action-date-field {
  grid-column: 1 / -1;
  min-width: 0;
}
.israeli-datetime-picker {
  position: relative;
  width: 100%;
  min-width: 0;
  cursor: pointer;
}
.israeli-datetime-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding-left: 40px;
  direction: ltr;
  text-align: left;
  cursor: pointer;
}
.israeli-datetime-picker:focus-within .israeli-datetime-input {
  border-color: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.14);
}
.israeli-datetime-picker-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 17px;
  line-height: 1;
  pointer-events: none;
}
.israeli-datetime-picker-native {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.panel-section {
  margin-top: 18px;
}
.panel-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.diagnosis-intake-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.diagnosis-intake-heading h3 {
  margin: 0;
}
.diagnosis-intake-heading span {
  color: #6b7280;
  font-size: 12px;
}
.diagnosis-intake-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.diagnosis-intake-card {
  min-height: 112px;
  padding: 13px;
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #f8fafc;
}
.diagnosis-intake-card > span {
  display: block;
  margin-bottom: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}
.diagnosis-intake-card p {
  margin: 0;
  color: #18212f;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.package-fields {
  margin-top: 12px;
}
label {
  display: grid;
  gap: 6px;
  color: #4b545d;
  font-size: 13px;
  font-weight: 700;
}
input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
  color: #1f2428;
}
textarea {
  min-height: 92px;
  resize: vertical;
}
.full-field {
  margin-top: 12px;
}
.lead-history-field {
  display: grid;
  gap: 8px;
}
.lead-history-head,
.lead-history-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lead-history-head label {
  color: #4b545d;
  font-size: 13px;
  font-weight: 700;
}
.lead-history-backdrop {
  z-index: 40;
  background: #141c1894;
}
.modal.lead-history-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1040px, 100%);
  height: min(820px, 92vh);
  max-height: 92vh;
  overflow: hidden;
}
.lead-history-modal .modal-head {
  align-items: flex-start;
}
.lead-history-modal h2,
.lead-history-modal .eyebrow {
  margin: 0;
}
.lead-history-textarea {
  min-height: 0;
  height: 100%;
  padding: 18px;
  resize: none;
  font-size: 16px;
  line-height: 1.75;
}
.lead-history-actions {
  padding-top: 14px;
}
.template-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.template-actions label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.number-field input {
  text-align: center;
}
.score-pill {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 28px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}
.score-pill.large {
  width: 56px;
  height: 40px;
  font-size: 18px;
}
.score-pill.hot {
  background: #ffe6df;
  color: #b33121;
}
.score-pill.warm {
  background: #fff0c8;
  color: #8a5c00;
}
.score-pill.mid {
  background: #e8f3ee;
  color: #166a4a;
}
.score-pill.cold {
  background: #edf0f2;
  color: #68717b;
}
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #1f24285c;
}
.modal {
  width: min(720px, 100%);
  max-height: min(760px, 90vh);
  overflow-y: auto;
  padding: 20px;
}
.empty-state-action {
  display: grid;
  gap: 10px;
}
.error-boundary {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
  background: #f5f6f7;
  color: #1f2428;
}
.error-boundary svg {
  color: #a83224;
}
.error-boundary h1,
.error-boundary p {
  margin: 0;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-score {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 150px;
  padding: 20px;
  color: #68717b;
  border: 1px dashed #cbd3da;
  border-radius: 8px;
  background: #fff;
}
.auth-screen,
.rating-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #f5f6f7;
}
.auth-box,
.rating-box {
  width: min(420px, 100%);
  padding: 28px;
  text-align: center;
}
.rating-box {
  border: 1px solid #dfe3e7;
  border-radius: 8px;
  background: #fff;
}
.auth-box h1 {
  margin-bottom: 18px;
}
.auth-box label,
.rating-box label {
  text-align: right;
  margin-bottom: 16px;
}
.auth-notice {
  color: #166a4a;
}
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .sales-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .diagnosis-kpi-grid,
  .diagnosis-money-grid,
  .clients-layout {
    grid-template-columns: 1fr;
  }
  .lead-panel {
    grid-column: 1 / -1;
    position: static;
    height: auto;
    border-top: 1px solid #dfe3e7;
  }
}
@media (max-width: 820px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    border-left: 0;
    border-bottom: 1px solid #dfe3e7;
  }
  .mode-panel {
    position: static;
    margin-top: 14px;
  }
  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main {
    padding: 16px;
  }
  .topbar,
  .filters,
  .clients-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .metric-grid,
  .client-kpis,
  .client-board,
  .client-stats-strip,
  .sales-kpi-grid,
  .diagnosis-kpi-grid,
  .work-grid,
  .diagnosis-review,
  .review-grid,
  .review-grid.two-thirds,
  .dashboard-grid,
  .settings-grid,
  .social-summary,
  .social-card,
  .money-split {
    grid-template-columns: 1fr;
  }
  .clients-toolbar select,
  .clients-toolbar .primary-button {
    width: 100%;
  }
  .client-editor {
    position: static;
    max-height: none;
  }
  .session-add-row {
    grid-template-columns: 1fr;
  }
  .social-head,
  .social-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .work-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .work-meta,
  .work-actions {
    grid-column: 1 / -1;
  }
  .table-row {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }
  .table-head {
    display: none;
  }
  .dashboard-filters select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .panel-title-row,
  .period-tabs,
  .period-selector,
  .dashboard-filters {
    align-items: stretch;
    flex-direction: column;
  }
  .period-selector {
    max-width: none;
  }
  .period-selector select,
  .period-tabs button,
  .dashboard-filters .small-button {
    width: 100%;
    min-width: 0;
  }
  .monthly-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 220px;
  }
  .bar-track {
    min-height: 150px;
  }
  .field-grid,
  .diagnosis-intake-grid,
  .score-grid,
  .modal-score {
    grid-template-columns: 1fr;
  }
  .lead-history-backdrop {
    padding: 10px;
  }
  .lead-history-modal {
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    padding: 14px;
  }
  .lead-history-head,
  .lead-history-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
