.fa-app-shell {
  width: min(100%, 1320px);
}

.iw-topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0;
  padding: 1.05rem 1.5rem 1.55rem;
  border-bottom: 1px solid #dbe4ee;
  background: #ffffff;
}

.iw-nav-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  font-weight: 700;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.iw-nav-button.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.iw-status {
  margin: 1.5rem 1.5rem 0;
  width: auto;
  max-width: calc(100% - 3rem);
  box-sizing: border-box;
  border-radius: 0.95rem;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 1rem 1.1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.iw-pane {
  margin: 0;
  padding: 1.5rem;
}

.iw-pane[hidden] {
  display: none !important;
}

.iw-pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0 0 1.5rem;
}

.iw-pane-title {
  margin: 0 0 0.55rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-pane-copy {
  margin: 0;
  color: #475569;
  max-width: 72ch;
  line-height: 1.65;
}

.iw-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem;
}

.iw-grid-single {
  grid-template-columns: 1fr;
}

.iw-card {
  min-width: 0;
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  padding: 1.5rem;
}

.iw-card-header {
  margin: 0 0 1.25rem;
}

.iw-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-card-copy {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.iw-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.1rem;
}

.iw-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.iw-field span {
  font-weight: 700;
  color: #0f172a;
}

.iw-field input,
.iw-field select,
.iw-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  background: #fff;
  padding: 0.95rem 1rem;
  color: #0f172a;
}

.iw-field textarea {
  resize: vertical;
  min-height: 112px;
}

.iw-field-wide {
  grid-column: 1 / -1;
}

.iw-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.iw-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 180px;
}

.iw-list-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 0.85rem;
  padding: 1rem;
  color: #64748b;
  background: #f8fafc;
}

.iw-row {
  border: 1px solid #dbe4ee;
  border-radius: 0.9rem;
  background: #fff;
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.iw-row-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.iw-row-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-row-meta {
  margin: 0.2rem 0 0;
  color: #475569;
  font-size: 0.94rem;
  line-height: 1.6;
  overflow-wrap: normal;
  word-break: normal;
}

.iw-row-contact-line,
.iw-address-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iw-row-contact-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.iw-row-contact-line strong {
  flex: 0 0 auto;
}

.iw-row-contact-primary {
  max-width: 100%;
}

.iw-row-contact-primary .iw-inline-value {
  flex: 1 1 auto;
  min-width: 0;
}

.iw-inline-value {
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iw-row-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.iw-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.iw-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.34rem 0.68rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  background: #e2e8f0;
  color: #0f172a;
}

.iw-badge.is-new { background: #dbeafe; color: #1d4ed8; }
.iw-badge.is-qualified { background: #dcfce7; color: #166534; }
.iw-badge.is-estimate { background: #fef3c7; color: #92400e; }
.iw-badge.is-lost { background: #fee2e2; color: #b91c1c; }
.iw-badge.is-customer { background: #ede9fe; color: #6d28d9; }
.iw-badge.iw-badge-success,
.iw-badge-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.iw-address-block {
  display: grid;
  gap: 0.2rem;
  margin: 0.2rem 0 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.85rem;
  background: #f8fafc;
}

.iw-address-label {
  margin-top: 0;
}

.iw-address-line {
  margin: 0;
  padding-left: 0.2rem;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
  color: #334155;
}

.iw-address-link {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  color: #0f4c81;
  text-decoration: none;
  min-width: 0;
}

.iw-address-link:hover,
.iw-address-link:focus-visible {
  text-decoration: underline;
}

.iw-address-link-line {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iw-address-link-block {
  display: grid;
  gap: 0.2rem;
}

.iw-address-link-inline {
  display: inline-grid;
  gap: 0.1rem;
  max-width: 100%;
}

.iw-inline-link-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: #0f4c81;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.iw-inline-link-button:hover,
.iw-inline-link-button:focus-visible {
  text-decoration: underline;
}

.iw-inline-button-compact,
.iw-inline-button-link {
  padding: 0.4rem 0.68rem;
  border-radius: 0.72rem;
  font-size: 0.78rem;
}

.iw-inline-button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.iw-phone-action-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.iw-phone-value-button {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iw-phone-value-text {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: #0f172a;
}

.iw-inline-button-icon {
  min-width: 2.3rem;
  padding-inline: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.iw-editor-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.iw-mobile-phone-sheet {
  display: grid;
  gap: 0.85rem;
}

.iw-mobile-phone-sheet-number {
  padding: 0.8rem 0.95rem;
  border: 1px solid #dbe4ee;
  border-radius: 0.9rem;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  word-break: break-word;
}

.iw-mobile-phone-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.iw-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.iw-appointment-ticket-resolved {
  display: inline-flex;
  align-items: center;
  border: 1px solid #86efac;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  padding: 0.25rem 0.55rem;
  font-weight: 800;
}

.iw-inline-button.iw-inline-button-success {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.iw-inline-button.iw-inline-button-success:hover,
.iw-inline-button.iw-inline-button-success:focus-visible {
  border-color: #22c55e;
  background: #bbf7d0;
  color: #14532d;
}

.iw-inline-button {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 0.8rem;
  padding: 0.6rem 0.9rem;
  font-weight: 700;
}

.iw-bullet-list {
  margin: 0;
  padding-left: 1rem;
  color: #334155;
}

.iw-field-help {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.55;
}

.iw-activity-fieldset {
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  padding: 1.15rem;
  background: #f8fbff;
  gap: 0.9rem;
}

.iw-activity-fieldset legend {
  padding: 0 0.35rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.iw-activity-card {
  min-width: 0;
  border: 1px solid #dbe4ee;
  border-radius: 0.95rem;
  background: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.iw-check {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-check input {
  width: 1rem;
  height: 1rem;
}

.iw-activity-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.iw-activity-inputs[hidden] {
  display: none !important;
}

.iw-activity-summary {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.15rem;
}

.iw-activity-summary p {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.45;
}

.fa-app-shell.iw-shell-view-leads,
.fa-app-shell.iw-shell-view-customers,
.fa-app-shell.iw-shell-view-appointments,
.fa-app-shell.iw-shell-view-billing,
.fa-app-shell.iw-shell-view-maintenance,
.fa-app-shell.iw-shell-view-reporting,
.fa-app-shell.iw-shell-view-contracts {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

.fa-app-shell.iw-shell-view-billing .iw-pane,
.fa-app-shell.iw-shell-view-maintenance .iw-pane {
  padding-bottom: 2rem;
}

@media (max-width: 1120px) {
  .iw-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .iw-pane-header,
  .iw-row-header {
    flex-direction: column;
  }

  .iw-form-grid,
  .iw-activity-grid,
  .iw-activity-inputs {
    grid-template-columns: 1fr;
  }

  .iw-nav-button {
    flex: 1 1 calc(50% - 0.5rem);
  }
}

@media (max-width: 720px) {
  .iw-topnav {
    gap: 0.75rem;
    padding: 0.95rem 1rem 1.35rem;
  }

  .iw-status {
    margin: 1rem 1rem 0;
    max-width: calc(100% - 2rem);
    padding: 0.9rem 0.95rem;
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .iw-pane {
    padding: 1rem;
  }

  .iw-card {
    padding: 1rem;
  }

  .iw-pane-header {
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .iw-nav-button {
    min-height: 44px;
    padding: 0.75rem 0.95rem;
    font-size: 0.92rem;
  }

  .iw-actions {
    justify-content: stretch;
  }

  .iw-actions .fa-primary-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .iw-topnav {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    padding-bottom: 1.25rem;
  }

  .iw-status {
    margin: 0.85rem 0.85rem 0;
    max-width: calc(100% - 1.7rem);
    padding: 0.85rem 0.9rem;
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .iw-pane {
    margin-left: 0;
    margin-right: 0;
  }

  .iw-pane {
    padding: 0.85rem;
  }

  .iw-card {
    padding: 0.9rem;
    border-radius: 0.9rem;
  }

  .iw-row,
  .iw-activity-card {
    padding: 0.9rem;
  }

  .iw-nav-button {
    flex-basis: 100%;
  }
}


.iw-grid-billing,
.iw-grid-reporting {
  align-items: start;
}

.iw-grid-reporting {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.iw-grid-reporting > .iw-card,
.iw-reporting-metric-grid > .iw-reporting-metric-card {
  align-self: start;
}
.iw-grid-reporting-secondary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}


.iw-reporting-stack {
  display: grid;
  gap: 1.25rem;
}

.iw-reporting-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.iw-reporting-metric-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--fa-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--fa-shadow-sm);
}

.iw-reporting-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.iw-reporting-metric-value {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1.05;
  font-weight: 800;
  color: #0f172a;
}

.iw-reporting-metric-value-sm {
  font-size: 1rem;
  line-height: 1.35;
}

.iw-reporting-metric-value-negative {
  color: #b91c1c;
}

.iw-reporting-metric-link {
  margin-top: 0.75rem;
  padding-left: 0;
}

.iw-reporting-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.iw-reporting-tooltip-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.iw-reporting-tooltip-indicator:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.iw-reporting-tooltip-indicator:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.iw-reporting-tooltip-list {
  margin: 0;
  padding-left: 1.15rem;
  color: #334155;
}

.iw-reporting-tooltip-list li + li {
  margin-top: 0.45rem;
}

.iw-reporting-bars {
  display: grid;
  gap: 0.9rem;
}

.iw-reporting-empty {
  color: #64748b;
  line-height: 1.5;
}

.iw-reporting-link-list {
  display: grid;
  gap: 0.75rem;
}

.iw-reporting-lead-link {
  width: 100%;
  border: 1px solid #dbe4ee;
  border-radius: 0.85rem;
  background: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  text-align: left;
  cursor: pointer;
}

.iw-reporting-lead-link:hover,
.iw-reporting-lead-link:focus-visible {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.iw-reporting-lead-link-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.iw-reporting-lead-link-title,
.iw-reporting-lead-link-copy,
.iw-reporting-lead-link-action {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iw-reporting-lead-link-title {
  font-weight: 700;
  color: #0f172a;
}

.iw-reporting-lead-link-copy,
.iw-reporting-lead-link-action {
  color: #475569;
  font-size: 0.94rem;
}

.iw-reporting-bar-row {
  display: grid;
  gap: 0.4rem;
}

.iw-reporting-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.iw-reporting-bar-label,
.iw-reporting-bar-value {
  margin: 0;
  color: #334155;
  line-height: 1.4;
}

.iw-reporting-bar-label {
  font-weight: 700;
}

.iw-reporting-bar-value {
  font-size: 0.92rem;
}

.iw-reporting-bar-values {
  display: grid;
  justify-items: end;
  gap: 0.1rem;
}

.iw-reporting-bar-copy {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.35;
  text-align: right;
}

.iw-card-header-reporting {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.iw-field-compact {
  min-width: 160px;
  margin: 0;
}

.iw-field-compact span {
  display: block;
  margin-bottom: 0.35rem;
}

@media (max-width: 720px) {
  .iw-card-header-reporting {
    flex-direction: column;
  }

  .iw-field-compact {
    width: 100%;
  }

  .iw-reporting-bar-values {
    justify-items: start;
  }

  .iw-reporting-bar-copy {
    text-align: left;
  }
}

.iw-reporting-bar-track {
  height: 0.65rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.iw-reporting-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.iw-reporting-sales-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.iw-reporting-sales-card {
  padding: 0.95rem 1rem;
  border: 1px solid var(--fa-border);
  border-radius: 16px;
  background: #fff;
}

.iw-reporting-sales-label,
.iw-reporting-sales-value,
.iw-reporting-sales-comparison {
  margin: 0;
}

.iw-reporting-sales-label {
  font-weight: 700;
  color: #334155;
}

.iw-reporting-sales-value {
  margin-top: 0.4rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-reporting-sales-comparison {
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.4;
}

@media (max-width: 1120px) {
  .iw-reporting-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .iw-grid-billing,
  .iw-grid-reporting,
  .iw-grid-reporting-secondary,
  .iw-reporting-metric-grid,
  .iw-reporting-sales-grid {
    grid-template-columns: 1fr;
  }
}


.iw-repeater-fieldset,
.iw-company-fieldset {
  border: 1px solid #dbe4ee;
  border-radius: 0.95rem;
  padding: 1rem;
  background: #f8fbff;
}

[data-iw-business-fields][hidden],
.iw-company-fieldset[hidden],
.iw-business-fieldset[hidden] {
  display: none !important;
}

.iw-repeater-list {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.iw-repeater-row {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: end;
}

.iw-repeater-grow {
  min-width: 0;
}

.iw-repeater-remove {
  align-self: end;
}

.iw-company-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.1rem;
}

.iw-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 54px;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  padding: 0.95rem 1rem;
  background: #fff;
  font-weight: 600;
  color: #0f172a;
}

.iw-switch input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .iw-repeater-row,
  .iw-company-grid {
    grid-template-columns: 1fr;
  }
}

.iw-grid-leads {
  gap: 1.25rem;
}

.iw-business-fieldset {
  border: 1px solid #dbe4ee;
  border-radius: 0.95rem;
  padding: 1rem;
  background: #f8fafc;
}

.iw-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  background: #fff;
  padding: 0.85rem 0.95rem;
}

.iw-switch input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.iw-actions-split {
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
}

#iw-customer-editor-shell {
  scroll-margin-top: 1rem;
}

#iw-customer-secure-summary {
  margin-top: 0.35rem;
}

.iw-sensitive-field {
  min-width: 0;
}

.iw-sensitive-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.iw-sensitive-toggle {
  min-height: 46px;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .iw-actions-split {
    flex-direction: column;
    align-items: stretch;
  }
}


.fa-app-subtitle {
  white-space: nowrap;
}

.iw-pane-note {
  margin: 0.55rem 0 0;
  color: #64748b;
  line-height: 1.55;
}

.iw-open-records {
  margin: 1rem 1.5rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  background: #ffffff;
}

.iw-open-records-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.iw-open-records-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-open-records-copy {
  margin: 0;
  color: #64748b;
  line-height: 1.5;
}

.iw-open-records-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.iw-open-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.5rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
}

.iw-open-chip-kind {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}

.iw-open-chip-label {
  font-weight: 700;
  color: #0f172a;
}

.iw-business-fieldset[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .fa-app-subtitle {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .iw-open-records,
  .iw-status {
    margin-left: 1rem;
    margin-right: 1rem;
    max-width: calc(100% - 2rem);
  }
}


.iw-grid-customers {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.5rem;
}

.iw-editor-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 0.95rem;
  background: #f8fafc;
  padding: 1rem 1.1rem;
  color: #475569;
  line-height: 1.6;
}

.iw-editor-empty p {
  margin: 0;
}

.iw-editor-empty p + p {
  margin-top: 0.45rem;
}

#iw-customer-form[hidden],
#iw-customer-editor-empty[hidden] {
  display: none !important;
}

.iw-open-records {
  margin: 1rem 1.5rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.iw-open-records-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.iw-open-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  max-width: 100%;
  padding: 0.45rem 0.55rem 0.45rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
}

.iw-open-chip-label {
  font-weight: 800;
  color: #0f172a;
}

.iw-open-chip .iw-inline-button {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}

@media (max-width: 1120px) {
  .iw-grid-customers {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .fa-app-subtitle {
    white-space: normal;
  }
}


.iw-grid-customers {
  grid-template-columns: minmax(340px, 0.95fr) minmax(420px, 1.05fr);
}

#iw-customers-list .iw-row-actions {
  align-items: center;
}

#iw-customers-list .iw-row {
  scroll-margin-top: 1rem;
}

@media (max-width: 900px) {
  .iw-grid-customers {
    grid-template-columns: 1fr;
  }
}


.fa-app-subtitle {
  white-space: nowrap;
}

.iw-preview-banner {
  margin: 0 1.5rem 1.5rem;
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  background: #eff6ff;
  padding: 1rem 1.1rem;
}

.iw-preview-banner-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-preview-banner-copy {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.iw-pane-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}


.iw-pane-header-actions-billing {
  justify-content: flex-end;
  gap: 1rem 1.25rem;
}

.iw-pane-header-billing {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.iw-pane-header-billing .iw-pane-header-actions-billing {
  width: 100%;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 0.95rem;
  border-top: 1px solid #e2e8f0;
}

.iw-pane-header-billing .iw-pane-button-group {
  gap: 0.65rem;
}

.iw-pane-header-billing .iw-pane-button-group > button {
  min-height: 44px;
}

.iw-pane-header-billing .iw-pane-button-group-qbo {
  justify-content: flex-end;
}

.iw-billing-status-stack {
  margin-top: 1rem;
}

.iw-grid-billing + .iw-grid-billing {
  margin-top: 1.5rem;
}

.iw-pane-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.iw-pane-button-group-qbo {
  justify-content: flex-end;
}

.iw-pane-note-inline {
  margin: 0.75rem 0 1rem;
}

.iw-maintenance-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.iw-maintenance-section {
  scroll-margin-top: 110px;
}

.iw-card-header-maintenance-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.iw-maintenance-qbo-actions {
  justify-content: flex-end;
}

.iw-card-copy-subtle {
  margin-top: 0.35rem;
  color: #64748b;
}


.iw-lead-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(180px, 0.7fr) minmax(180px, 0.7fr);
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.iw-grid-leads {
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.25fr);
}

.iw-lead-row {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.iw-lead-row:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.iw-lead-row.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.iw-badge-muted {
  background: #f8fafc;
  color: #475569;
  border-color: #dbe4ee;
}

.iw-customer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(180px, 0.6fr) minmax(180px, 0.6fr);
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.iw-toolbar-search input {
  min-height: 50px;
}

.iw-grid-customers {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.3fr);
}

.iw-customer-row {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.iw-customer-row:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.iw-customer-row.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.iw-row-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.iw-row-ticket-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.iw-editor-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 0.95rem;
  background: #f8fafc;
  padding: 1.15rem;
  color: #475569;
  line-height: 1.6;
}

.iw-editor-empty p {
  margin: 0 0 0.5rem;
}

.iw-form-errors {
  margin: 0 0 1rem;
  border: 1px solid #fecaca;
  border-radius: 0.9rem;
  background: #fef2f2;
  color: #991b1b;
  padding: 0.9rem 1rem;
  line-height: 1.5;
}

.iw-field.is-invalid input,
.iw-field.is-invalid select,
.iw-field.is-invalid textarea {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.08);
}

.iw-open-records[hidden] {
  display: none !important;
}

.iw-open-records-list {
  overflow-x: auto;
}

.iw-open-record-chip {
  cursor: pointer;
}

.iw-open-record-close {
  border: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 800;
  color: #475569;
}

.iw-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .fa-app-subtitle {
    white-space: normal;
  }

  .iw-lead-toolbar,
  .iw-customer-toolbar,
  .iw-grid-leads,
  .iw-grid-customers {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .iw-preview-banner {
    margin: 0 1rem 1rem;
  }
}


.iw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
}

.iw-actions-wrap > * {
  margin: 0;
}

.iw-lead-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.iw-lead-record-type-field {
  max-width: 240px;
}

.iw-lead-business-profile {
  margin-top: -0.15rem;
}

.iw-row {
  cursor: pointer;
}

.iw-row-actions,
.iw-actions-wrap {
  gap: 0.75rem;
}

.iw-row-actions > * {
  margin: 0;
}

.iw-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 9998;
}

.iw-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  z-index: 9999;
}

.iw-modal[hidden],
.iw-modal-backdrop[hidden] {
  display: none !important;
}

.iw-modal-inner {
  box-sizing: border-box;
  width: min(calc(100vw - 2.5rem), 560px);
  max-width: 100%;
  max-height: calc(100dvh - 2.5rem);
  border-radius: 1rem;
  border: 1px solid #dbe4ee;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  padding: 1.4rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.iw-modal-header {
  margin-bottom: 1rem;
}

.iw-modal-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.iw-modal-close {
  appearance: none;
  border: 1px solid #d7e3f1;
  background: #f8fafc;
  color: #334155;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.iw-modal-close:hover,
.iw-modal-close:focus-visible {
  border-color: #9db6d7;
  background: #eef4fb;
  outline: none;
}

.iw-modal-title.is-success {
  color: #0f172a;
}

.iw-modal-title.is-error {
  color: #991b1b;
}

.iw-modal-actions-single {
  justify-content: flex-end;
}

.iw-modal-actions-single #iw-modal-confirm {
  min-width: 8.5rem;
}


.iw-modal-title {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-modal-copy {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.iw-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 1120px) {
  .iw-lead-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .iw-lead-form-grid,
  .iw-modal-actions {
    grid-template-columns: 1fr;
  }

  .iw-modal {
    align-items: flex-start;
    padding: 0.9rem;
    overflow-x: hidden;
  }

  .iw-modal-inner {
    width: min(calc(100vw - 1.8rem), 560px);
    max-height: calc(100dvh - 1.8rem);
    padding: 1rem;
  }

  .iw-modal-actions {
    display: grid;
  }
}


/* CRM / lead follow-up fixes */
.iw-primary-check {
  align-self: end;
  margin-bottom: 0.55rem;
  white-space: nowrap;
}
.iw-lead-form-grid .iw-lead-record-type-field {
  grid-column: span 1;
}
.iw-lead-form-grid .iw-business-fieldset {
  margin-top: 0.25rem;
}
.iw-lead-toolbar {
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(180px, 1fr));
}
.iw-row-meta strong {
  font-weight: 600;
}


/* Internal Workspace mobile fixes */
@media (max-width: 720px) {
  .iw-pane-header-actions,
  .iw-row-actions,
  .iw-actions,
  .iw-actions-wrap,
  .iw-pane-button-group {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .iw-pane-header-actions > *,
  .iw-row-actions > *,
  .iw-actions > *,
  .iw-actions-wrap > *,
  .iw-pane-button-group > * {
    width: 100%;
    margin: 0;
  }

  .iw-reporting-lead-link {
    align-items: flex-start;
    flex-direction: column;
  }

  .iw-lead-toolbar,
  .iw-customer-toolbar,
  .iw-lead-form-grid,
  .iw-company-grid,
  .iw-repeater-row,
  .iw-activity-grid,
  .iw-activity-inputs,
  .iw-form-grid,
  .iw-grid-leads,
  .iw-grid-customers {
    grid-template-columns: 1fr;
  }

  .iw-primary-check {
    align-self: start;
    margin-bottom: 0;
  }

  .iw-open-chip {
    width: 100%;
    border-radius: 1rem;
    justify-content: space-between;
  }

  .iw-open-chip-label {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .iw-row-header {
    gap: 0.75rem;
  }
}

@media (max-width: 560px) {
  .iw-topnav {
    gap: 0.6rem;
  }

  .iw-nav-button {
    width: 100%;
  }

  .iw-row,
  .iw-card,
  .iw-open-records {
    overflow-x: hidden;
  }
}


.iw-reporting-metric-card-qbo-connected {
  position: relative;
  border-color: rgba(16, 185, 129, 0.32);
  background:
    radial-gradient(circle at top, rgba(187, 247, 208, 0.72), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  box-shadow:
    0 18px 36px rgba(16, 185, 129, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.iw-reporting-metric-card-qbo-connected::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.66);
}

.iw-reporting-metric-value-qbo {
  font-size: 1rem;
  line-height: 1.1;
}

.iw-qbo-connected-badge {
  display: inline-grid;
  gap: 0.22rem;
  width: 100%;
}

.iw-qbo-connected-line {
  display: block;
}

.iw-qbo-connected-line-top {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: #166534;
}

.iw-qbo-connected-line-company {
  font-size: 1.16rem;
  font-weight: 900;
  color: #0f172a;
}

.iw-qbo-connected-line-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #22c55e 0%, #108000 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow:
    0 10px 24px rgba(16, 128, 0, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}


.iw-billing-status-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid #dbe6f4;
  border-radius: 16px;
  background: #f8fbff;
}

.iw-billing-status-card + .iw-billing-status-card {
  margin-top: 0.85rem;
}

.iw-billing-status-card-success {
  border-color: #c8ead9;
  background: #f2fbf6;
}

.iw-billing-status-card-warning {
  border-color: #f5ddb0;
  background: #fff9ef;
}

.iw-billing-status-card-danger {
  border-color: #f0c7c7;
  background: #fff5f5;
}

.iw-billing-status-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

.iw-billing-status-body {
  display: grid;
  gap: 0.55rem;
}

.iw-billing-status-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.4fr);
  gap: 0.85rem;
  align-items: start;
}

.iw-billing-status-label {
  color: #475569;
  font-weight: 600;
}

.iw-billing-status-value {
  color: #0f172a;
  min-width: 0;
  word-break: break-word;
}


@media (max-width: 900px) {
  .iw-pane-header-billing .iw-pane-header-actions-billing,
  .iw-pane-header-billing .iw-pane-button-group-qbo {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .iw-pane-header-billing .iw-pane-header-actions-billing {
    gap: 0.85rem;
  }

  .iw-pane-header-billing .iw-pane-button-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .iw-pane-header-billing .iw-pane-button-group > button {
    width: 100%;
  }

  .iw-card-header-maintenance-actions {
    flex-direction: column;
  }

  .iw-maintenance-qbo-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .iw-maintenance-qbo-actions > button {
    width: 100%;
  }
}


.iw-grid-billing-columns {
  align-items: start;
}

.iw-billing-column {
  display: grid;
  gap: 1.5rem;
  align-content: start;
  min-width: 0;
}

.iw-grid-billing-columns .iw-list {
  min-height: 0;
}

#iw-billing-documents,
#iw-billing-payments,
#iw-billing-review-queue,
#iw-billing-latest-sync,
#iw-maintenance-latest-sync {
  min-height: 0;
}

.iw-billing-review-card {
  margin-top: 1.5rem;
}

.iw-customer-qbo-summary {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.iw-customer-qbo-status {
  display: grid;
  gap: 0.35rem;
  border: 1px solid #dbe4ee;
  border-radius: 0.95rem;
  background: #f8fbff;
  padding: 1rem 1.05rem;
}

.iw-customer-qbo-status.is-linked {
  border-color: #c8ead9;
  background: #f2fbf6;
}

.iw-customer-qbo-status.is-linked .iw-customer-qbo-status-title {
  color: #166534;
}

.iw-customer-qbo-status.is-warning {
  border-color: #f5ddb0;
  background: #fff9ef;
}

.iw-customer-qbo-status-title {
  margin: 0;
  font-weight: 800;
  color: #0f172a;
}

.iw-customer-qbo-status-copy {
  margin: 0;
  color: #475569;
  line-height: 1.55;
}

.iw-customer-qbo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.iw-customer-financial-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.iw-customer-financial-card {
  border: 1px solid #dbe4ee;
  border-radius: 0.95rem;
  background: #f8fbff;
  padding: 0.95rem 1rem;
}

.iw-customer-financial-card-label {
  margin: 0 0 0.35rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}

.iw-customer-financial-card-value {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-customer-financial-card-copy {
  margin: 0.35rem 0 0;
  color: #64748b;
  line-height: 1.45;
}

.iw-customer-financial-documents {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.iw-customer-financial-empty {
  margin: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 0.85rem;
  padding: 0.95rem 1rem;
  color: #64748b;
  background: #f8fafc;
}

.iw-customer-financial-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
  border: 1px solid #dbe4ee;
  border-radius: 0.9rem;
  background: #fff;
  padding: 0.95rem 1rem;
}

.iw-customer-financial-row-main {
  min-width: 0;
  flex: 1 1 280px;
}

.iw-customer-financial-row-side {
  min-width: 150px;
  text-align: right;
}

.iw-customer-financial-title {
  margin: 0 0 0.2rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-customer-financial-copy {
  margin: 0;
  color: #475569;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.iw-customer-financial-copy-subtle {
  color: #64748b;
}

.iw-company-grid-documents {
  align-items: end;
}

.iw-customer-document-purpose-other-field,
#iw-customer-document-purpose-other-field {
  display: none !important;
}

.iw-customer-document-purpose-other-field.is-visible,
#iw-customer-document-purpose-other-field.is-visible {
  display: flex !important;
}

.iw-customer-documents {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.iw-customer-documents-empty {
  margin: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 0.85rem;
  padding: 0.95rem 1rem;
  color: #64748b;
  background: #f8fafc;
}

.iw-customer-document-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
  border: 1px solid #dbe4ee;
  border-radius: 0.9rem;
  background: #fff;
  padding: 0.95rem 1rem;
}

.iw-customer-document-meta {
  min-width: 0;
}

.iw-customer-document-title {
  margin: 0 0 0.2rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-customer-document-copy {
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.iw-customer-document-side {
  display: grid;
  gap: 0.6rem;
  justify-items: end;
}

.iw-customer-document-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  word-break: break-word;
}

.iw-customer-document-link:hover,
.iw-customer-document-link:focus-visible {
  color: #2563eb;
}

@media (max-width: 767px) {
  .iw-customer-document-side {
    width: 100%;
    justify-items: start;
  }

  .iw-customer-document-row .iw-row-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 767px) {
  .iw-customer-qbo-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .iw-customer-qbo-actions > button {
    width: 100%;
  }
}

.iw-modal-form-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.05rem; margin-top: 1rem; }
@media (max-width: 720px) { .iw-modal-form-grid { grid-template-columns: 1fr; } .iw-customer-financial-row-side { width: 100%; text-align: left; } }

.iw-modal-form-grid-tight {
  gap: 0.85rem 1rem;
  margin-top: 0;
}

.iw-fa-ticket-launch {
  display: grid;
  gap: 0.9rem;
}

.iw-fa-ticket-choice-stack {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.2rem;
}

.iw-fa-ticket-choice-card {
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  background: #f8fbff;
  padding: 1rem 1rem 1.05rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.iw-fa-ticket-choice-card.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.iw-fa-ticket-choice-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
}

.iw-fa-ticket-choice-heading input[type="radio"] {
  margin: 0;
  flex: 0 0 auto;
}

.iw-fa-ticket-choice-body {
  margin-top: 0.8rem;
  padding-left: 1.75rem;
}

.iw-fa-ticket-choice-body .iw-field,
.iw-fa-ticket-choice-body .iw-field > input,
.iw-fa-ticket-choice-body .iw-field > select,
.iw-modal-form-grid > .iw-field,
.iw-modal-form-grid > .iw-field > input,
.iw-modal-form-grid > .iw-field > select {
  min-width: 0;
  max-width: 100%;
}

.iw-fa-ticket-choice-body .iw-field {
  margin-bottom: 0;
}

#iw-fa-existing-active-ticket,
#iw-fa-existing-resolved-ticket,
#iw-fa-new-ticket-title,
#iw-fa-new-ticket-type {
  width: 100%;
  max-width: 100%;
}

.iw-form-error {
  margin: 0;
  color: #b91c1c;
  font-weight: 700;
}

@media (max-width: 720px) {
  .iw-fa-ticket-choice-card {
    padding: 0.9rem;
  }

  .iw-fa-ticket-choice-body {
    padding-left: 0;
  }
}


.iw-autofill-decoys {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.iw-address-summary {
  margin: 0.2rem 0 0;
  color: #475569;
  font-size: 0.94rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* CRM redesign and reporting enhancements */
.iw-customer-editor-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  margin-bottom: 1rem;
}

.iw-customer-editor-summary-main {
  min-width: 0;
}

.iw-customer-editor-summary-kicker,
.iw-customer-editor-summary-title,
.iw-customer-editor-summary-copy {
  margin: 0;
}

.iw-customer-editor-summary-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.iw-customer-editor-summary-title {
  margin-top: 0.25rem;
  font-size: 1.15rem;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.iw-customer-editor-summary-copy {
  margin-top: 0.35rem;
  color: #475569;
  line-height: 1.55;
  word-break: break-word;
}

.iw-customer-section-nav {
  position: sticky;
  top: 0.8rem;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1rem;
  padding: 0.8rem;
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.iw-customer-section-button {
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.iw-customer-section-button.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.10);
}

#iw-customer-form [data-iw-customer-section] {
  scroll-margin-top: 6rem;
}

#iw-customer-form .is-section-hidden {
  display: none !important;
}

.iw-customer-card-details {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.iw-customer-card-detail {
  display: grid;
  grid-template-columns: minmax(108px, 128px) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  min-width: 0;
}

.iw-customer-card-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #64748b;
}

.iw-customer-card-value {
  min-width: 0;
  color: #0f172a;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.iw-customer-card-value-break {
  font-weight: 500;
}

.iw-customer-card-value-address .iw-address-link-inline,
.iw-customer-card-value-phone .iw-phone-action-group {
  max-width: 100%;
}

.iw-customer-card-value-phone .iw-phone-value-button {
  min-width: 0;
}

#iw-customers-list .iw-row-header {
  gap: 0.85rem;
}

#iw-customers-list .iw-badges {
  justify-content: flex-end;
  max-width: 220px;
}

#iw-customers-list .iw-row-title {
  line-height: 1.25;
}

#iw-customers-list .iw-row-actions {
  flex-wrap: wrap;
}

.iw-billing-record .iw-row-main,
.iw-customer-review-row .iw-row-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.iw-row-heading {
  min-width: 0;
}

.iw-row-heading h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  color: #0f172a;
}

.iw-billing-record {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.iw-billing-outstanding-text,
.iw-billing-outstanding-alert {
  color: #b91c1c;
  font-weight: 800;
}

#iw-customer-review-queue .iw-row-meta,
#iw-billing-documents .iw-row-meta,
#iw-billing-payments .iw-row-meta {
  line-height: 1.5;
}

#iw-reporting-banking-metrics .iw-reporting-sales-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

@media (max-width: 1120px) {
  .iw-customer-editor-summary {
    grid-template-columns: 1fr;
  }

  #iw-customers-list .iw-badges {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 900px) {
  .iw-customer-card-detail {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .iw-customer-section-nav {
    position: static;
  }
}

@media (max-width: 720px) {
  .iw-customer-section-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .iw-customer-section-button {
    width: 100%;
  }

  .iw-billing-record .iw-row-main,
  .iw-customer-review-row .iw-row-main,
  #iw-customers-list .iw-row-header {
    flex-direction: column;
  }
}

/* 2026-04-08 CRM and reporting refinement overrides */
.iw-grid-customers {
  grid-template-columns: minmax(440px, 1.02fr) minmax(540px, 1.28fr);
  align-items: start;
}

#iw-customers-list .iw-row-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 1rem;
  align-items: start;
}

#iw-customers-list .iw-row-body {
  min-width: 0;
}

#iw-customers-list .iw-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 0.45rem;
  min-width: 0;
  max-width: none;
}

.iw-customer-card-subtitle {
  margin-top: 0.15rem;
  font-weight: 700;
  color: #334155;
}

.iw-customer-card-details {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.55rem;
  min-width: 0;
}

.iw-customer-card-detail {
  display: grid;
  grid-template-columns: minmax(112px, 132px) minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
}

.iw-customer-card-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.iw-customer-card-value {
  font-size: 0.97rem;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.iw-customer-card-value-break {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.iw-customer-editor-summary {
  align-items: start;
}

.iw-customer-editor-summary .iw-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.iw-customer-editor-summary .iw-badge {
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.iw-customer-section-nav {
  gap: 0.75rem;
}

.iw-customer-section-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.iw-lead-editor-summary {
  margin-bottom: 1rem;
}

#iw-lead-form [data-iw-lead-section] {
  scroll-margin-top: 6rem;
}

#iw-lead-form .is-section-hidden {
  display: none !important;
}

.iw-lead-section-nav {
  margin-bottom: 1rem;
}

.iw-crm-review-card {
  margin-top: 1.75rem;
}

.iw-billing-record {
  gap: 1rem;
}

.iw-billing-record-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.iw-billing-record-amounts {
  display: grid;
  gap: 0.15rem;
  text-align: right;
  min-width: 144px;
}

.iw-billing-record-total,
.iw-billing-record-balance {
  margin: 0;
}

.iw-billing-record-total {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.iw-billing-record-balance {
  font-size: 0.9rem;
  color: #475569;
}

.iw-billing-record-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
}

.iw-billing-record-meta-grid .iw-row-meta {
  margin: 0;
}

.iw-billing-outstanding-text {
  color: #b91c1c;
  font-weight: 800;
}

#iw-customer-review-queue .iw-row,
#iw-billing-documents .iw-row,
#iw-billing-payments .iw-row {
  padding: 1rem 1.05rem;
}

.iw-autofill-decoys input {
  position: absolute;
  inset: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

[data-iw-autofill-protect] {
  background-clip: padding-box;
}

@media (max-width: 1120px) {
  .iw-grid-customers {
    grid-template-columns: 1fr;
  }

  .iw-customer-editor-summary .iw-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .iw-billing-record-top {
    flex-direction: column;
  }

  .iw-billing-record-amounts {
    text-align: left;
    min-width: 0;
  }

  .iw-billing-record-meta-grid {
    grid-template-columns: 1fr;
  }

  .iw-customer-section-nav,
  .iw-lead-section-nav {
    grid-template-columns: 1fr 1fr;
  }

  #iw-customers-list .iw-row-header {
    grid-template-columns: 1fr;
  }

  #iw-customers-list .iw-badges {
    justify-content: flex-start;
  }

  .iw-customer-card-detail {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}


.iw-reporting-sales-value-positive {
  color: #15803d;
}

.iw-reporting-sales-value-negative {
  color: #b91c1c;
}

#iw-customer-form {
  container-type: inline-size;
}

#iw-customer-form .iw-form-grid {
  align-items: start;
}

#iw-customer-form .iw-field[data-iw-customer-section="contacts"] input,
#iw-customer-form .iw-field[data-iw-customer-section="contacts"] select,
#iw-customer-form .iw-field[data-iw-customer-section="contacts"] textarea,
#iw-customer-form .iw-company-fieldset[data-iw-customer-section="contacts"],
#iw-customer-form .iw-repeater-fieldset[data-iw-customer-section="contacts"] {
  min-width: 0;
}

#iw-customer-form .iw-company-fieldset[data-iw-customer-section="contacts"],
#iw-customer-form .iw-repeater-fieldset[data-iw-customer-section="contacts"] {
  padding: 1rem 1.05rem;
}

#iw-customer-form .iw-company-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

#iw-customer-form [data-iw-customer-section="contacts"].iw-field-wide,
#iw-customer-form [data-iw-customer-section="history"].iw-field-wide,
#iw-customer-form [data-iw-customer-section="documents"].iw-field-wide,
#iw-customer-form .iw-company-fieldset[data-iw-customer-section="contacts"],
#iw-customer-form .iw-repeater-fieldset[data-iw-customer-section="contacts"] {
  width: 100%;
}

.iw-customer-ticket-row .iw-row-meta {
  overflow-wrap: anywhere;
}

@container (max-width: 780px) {
  #iw-customer-form .iw-form-grid,
  #iw-customer-form .iw-company-grid {
    grid-template-columns: 1fr;
  }
}


.iw-grid-customers {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.iw-grid-customers.is-editor-open {
  grid-template-columns: minmax(420px, 0.96fr) minmax(520px, 1.12fr);
}

#iw-customer-editor-shell[hidden] {
  display: none !important;
}

.iw-card-header-editor {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

#iw-customers-list .iw-row-header {
  grid-template-columns: minmax(0, 1fr);
}

.iw-grid-customers.is-editor-open #iw-customers-list .iw-row-header {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
}

.iw-customer-row {
  cursor: default;
}

.iw-customer-card-details {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.7rem;
}

.iw-customer-card-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.18rem;
}

.iw-customer-card-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.iw-customer-card-value {
  font-size: 0.98rem;
  line-height: 1.5;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

.iw-customer-editor-summary-line {
  display: block;
}

.iw-customer-ticket-actions {
  align-items: center;
}

.iw-customer-ticket-row .fa-issue-status-pill {
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .iw-grid-customers.is-editor-open {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .iw-card-header-editor {
    flex-direction: column;
  }
}


/* 2026-04-08 CRM final pass overrides */
.iw-customer-history-toolbar,
.iw-customer-account-contacts-toolbar,
.iw-modal-account-contact-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.iw-customer-history-filter-field {
  max-width: 240px;
}

.iw-customer-account-contacts-toolbar {
  margin-bottom: 0.85rem;
}

.iw-modal-account-contact-section {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}

.iw-modal-account-contact-section h4 {
  margin: 0;
  font-size: 0.98rem;
  color: #0f172a;
}

.iw-modal-primary-toggle {
  max-width: 90px;
}

.iw-modal-remove-row {
  align-self: end;
}

[data-iw-modal-list="email"],
[data-iw-modal-list="phone"] {
  display: grid;
  gap: 0.75rem;
}

[data-iw-modal-row="email"],
[data-iw-modal-row="phone"] {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr) 90px auto;
  gap: 0.75rem;
  align-items: end;
  border: 1px solid #dbe4ee;
  border-radius: 0.85rem;
  padding: 0.85rem 0.95rem;
  background: #f8fbff;
}

@media (max-width: 720px) {
  [data-iw-modal-row="email"],
  [data-iw-modal-row="phone"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .iw-modal-primary-toggle {
    max-width: none;
  }

  .iw-modal-remove-row {
    justify-self: start;
  }
}

.iw-customer-qbo-actions {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  justify-content: start;
  align-items: center;
}

#iw-customers-list .iw-row,
#iw-leads-list .iw-row {
  overflow: hidden;
}

#iw-customers-list .iw-row-title,
#iw-leads-list .iw-row-title,
#iw-customers-list .iw-row-meta,
#iw-leads-list .iw-row-meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#iw-leads-list .iw-row-header,
#iw-customers-list .iw-row-header {
  align-items: start;
}

#iw-leads-list .iw-badges,
#iw-customers-list .iw-badges {
  align-self: start;
}

@media (max-width: 900px) {
  .iw-grid-customers.is-editor-open {
    display: flex;
    flex-direction: column;
  }

  .iw-grid-customers.is-editor-open > #iw-customer-editor-shell {
    order: -1;
  }

  #iw-customers-list .iw-row-header,
  #iw-leads-list .iw-row-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  #iw-customers-list .iw-badges,
  #iw-leads-list .iw-badges {
    justify-content: flex-start;
    max-width: none;
  }

  .iw-customer-card-details {
    gap: 0.75rem;
  }

  .iw-customer-card-detail {
    grid-template-columns: 1fr;
    gap: 0.18rem;
  }
}

@media (max-width: 720px) {
  .iw-customer-toolbar {
    grid-template-columns: 1fr;
  }

  .iw-customer-qbo-actions {
    grid-template-columns: 1fr;
  }

  [data-iw-modal-row="email"],
  [data-iw-modal-row="phone"] {
    grid-template-columns: 1fr;
  }

  .iw-customer-history-filter-field {
    max-width: none;
    width: 100%;
  }

  .iw-customer-account-contacts-toolbar > .fa-dark-outline-button,
  .iw-customer-history-toolbar > .iw-field {
    width: 100%;
  }
}


/* 2026-04-08 regression repair */
.iw-customer-qbo-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
}

.iw-customer-qbo-actions > button {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

#iw-customer-editor-shell {
  min-width: 0;
}

#iw-customers-list .iw-row,
#iw-leads-list .iw-row {
  padding: 1rem;
}

#iw-customers-list .iw-row-title,
#iw-leads-list .iw-row-title {
  font-size: 1.05rem;
}

@media (max-width: 900px) {
  .iw-grid-customers.is-editor-open > #iw-customers-list {
    order: 2;
  }

  .iw-grid-customers.is-editor-open > #iw-customer-editor-shell {
    order: 1;
    width: 100%;
  }

  #iw-customers-list .iw-row,
  #iw-leads-list .iw-row {
    padding: 1rem 0.9rem;
  }

  #iw-customers-list .iw-badges,
  #iw-leads-list .iw-badges {
    gap: 0.55rem;
  }

  .iw-customer-editor-summary .iw-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .iw-customer-qbo-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .iw-customer-qbo-actions > button {
    width: 100%;
    white-space: normal;
  }

  .iw-customer-section-nav {
    grid-template-columns: 1fr;
  }

  #iw-customers-list .iw-row-meta,
  #iw-leads-list .iw-row-meta,
  .iw-customer-card-value {
    line-height: 1.6;
  }
}


/* 2026-04-08 mobile CRM readability hardening */
#iw-customers-list .iw-row-title,
#iw-customers-list .iw-customer-card-value,
#iw-customers-list .iw-customer-card-subtitle,
#iw-customers-list .iw-row-meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#iw-customers-list .iw-row-title {
  line-height: 1.15;
}

#iw-customers-list .iw-badges {
  align-items: flex-start;
}

@media (max-width: 900px) {
  .iw-grid-customers.is-editor-open {
    display: flex;
    flex-direction: column;
  }

  .iw-grid-customers.is-editor-open > #iw-customer-editor-shell {
    order: -1;
  }

  #iw-customers-list .iw-row-header,
  #iw-leads-list .iw-row-header {
    grid-template-columns: 1fr;
    gap: 0.875rem;
    align-items: start;
  }

  #iw-customers-list .iw-badges,
  #iw-leads-list .iw-badges {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  #iw-customers-list .iw-row-actions,
  #iw-leads-list .iw-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
  }

  #iw-customers-list .iw-row-actions > *,
  #iw-leads-list .iw-row-actions > * {
    flex: 1 1 100%;
  }
}

@media (max-width: 720px) {
  #iw-customers-list .iw-row,
  #iw-leads-list .iw-row,
  .iw-customer-editor-summary {
    padding: 1rem;
  }

  #iw-customers-list .iw-customer-card-detail {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  #iw-customers-list .iw-customer-card-label {
    font-size: 0.72rem;
  }

  #iw-customers-list .iw-row-title {
    font-size: 1.5rem;
  }
}

/* 2026-04-09 desktop CRM editor full-width layout */
@media (min-width: 901px) {
  .iw-grid-customers.is-editor-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .iw-grid-customers.is-editor-open > .iw-card:first-child {
    display: none;
  }

  .iw-grid-customers.is-editor-open > #iw-customer-editor-shell {
    width: 100%;
    max-width: none;
  }
}

/* 2026-04-08 mobile customer editor readability repair */
#iw-customer-editor-shell,
#iw-customer-form,
#iw-customer-editor-summary,
#iw-customer-editor-summary-title,
#iw-customer-editor-summary-copy,
#iw-customer-editor-summary-badges,
#iw-customer-form .iw-field,
#iw-customer-form .iw-field span,
#iw-customer-form input,
#iw-customer-form textarea,
#iw-customer-form select,
#iw-customer-form .iw-badge,
#iw-customer-form .iw-customer-section-button {
  min-width: 0;
}

#iw-customer-editor-summary-title,
#iw-customer-editor-summary-copy,
#iw-customer-form .iw-badge,
#iw-customer-form .iw-customer-section-button,
#iw-customer-form .iw-field,
#iw-customer-form .iw-field span,
#iw-customer-form input,
#iw-customer-form textarea,
#iw-customer-form select {
  word-break: normal;
  overflow-wrap: break-word;
}

#iw-customer-form .iw-badges {
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  #iw-customer-editor-summary {
    grid-template-columns: 1fr;
  }

  #iw-customer-editor-summary .iw-badges {
    justify-content: flex-start;
  }

  #iw-customer-form .iw-customer-section-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  #iw-customer-form .iw-customer-section-button {
    width: 100%;
    white-space: normal;
    line-height: 1.35;
  }

  #iw-customer-form .iw-form-grid,
  #iw-customer-form .iw-company-grid {
    grid-template-columns: 1fr;
  }
}

/* 2026-04-08 mobile customer editor final hardening */
#iw-customer-editor-shell,
#iw-customer-form,
#iw-customer-editor-summary,
#iw-customer-editor-summary-main,
#iw-customer-editor-summary-title,
#iw-customer-editor-summary-copy,
#iw-customer-editor-summary-line,
#iw-customer-editor-summary-badges,
#iw-customer-form .iw-field,
#iw-customer-form .iw-field > span,
#iw-customer-form input,
#iw-customer-form textarea,
#iw-customer-form select,
#iw-customer-form .iw-badge,
#iw-customer-form .iw-customer-section-button {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#iw-customer-editor-shell {
  width: 100%;
  overflow-x: hidden;
}

#iw-customer-editor-summary-title,
#iw-customer-editor-summary-copy,
#iw-customer-editor-summary-line,
#iw-customer-form .iw-field > span,
#iw-customer-form .iw-row-meta,
#iw-customer-form .iw-customer-card-value,
#iw-customer-form input,
#iw-customer-form textarea,
#iw-customer-form select {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

#iw-customer-editor-summary .iw-badges,
#iw-customer-form .iw-badges {
  flex-wrap: wrap;
  gap: 0.55rem;
}

@media (max-width: 900px) {
  #iw-customer-editor-shell,
  #iw-customer-form {
    width: 100%;
    max-width: 100%;
  }

  #iw-customer-editor-summary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  #iw-customer-editor-summary .iw-badges {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
  }

  #iw-customer-form .iw-form-grid,
  #iw-customer-form .iw-company-grid,
  #iw-customer-form .iw-repeater-row,
  #iw-customer-form .iw-sensitive-input-wrap {
    grid-template-columns: 1fr;
  }

  #iw-customer-form .iw-sensitive-toggle {
    width: 100%;
  }
}

@media (max-width: 720px) {
  #iw-customer-form .iw-customer-section-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  #iw-customer-form .iw-customer-section-button {
    width: 100%;
    white-space: normal;
    line-height: 1.35;
  }

  #iw-customer-editor-summary-title {
    font-size: 1.25rem;
    line-height: 1.25;
  }
}


/* 2026-04-09 deterministic mobile CRM compact layout fix */
@media (max-width: 900px) {
  .iw-grid-customers.iw-grid-customers-compact,
  .iw-grid-customers.iw-grid-customers-compact.is-editor-open {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
  }

  .iw-grid-customers.iw-grid-customers-compact > #iw-customer-editor-shell {
    order: 1;
    width: 100% !important;
    max-width: 100% !important;
  }

  .iw-grid-customers.iw-grid-customers-compact > :first-child {
    order: 2;
    min-width: 0;
    width: 100%;
  }

  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-row-header,
  .iw-grid-customers.iw-grid-customers-compact.is-editor-open #iw-customers-list .iw-row-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.875rem !important;
    align-items: start !important;
  }

  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-row-body,
  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-row-title,
  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-row-meta,
  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-customer-card-value,
  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-customer-card-subtitle {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-badges,
  .iw-grid-customers.iw-grid-customers-compact.is-editor-open #iw-customers-list .iw-badges {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 0.55rem !important;
  }

  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-row-title {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    line-height: 1.2 !important;
  }

  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-row-meta,
  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-customer-card-value,
  .iw-grid-customers.iw-grid-customers-compact #iw-customers-list .iw-customer-card-subtitle {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  #iw-customer-editor-shell.iw-editor-compact,
  #iw-customer-editor-shell.iw-editor-compact #iw-customer-form,
  #iw-customer-editor-shell.iw-editor-compact #iw-customer-editor-summary,
  #iw-customer-editor-shell.iw-editor-compact .iw-customer-editor-summary-main,
  #iw-customer-editor-shell.iw-editor-compact #iw-customer-editor-summary-badges,
  #iw-customer-editor-shell.iw-editor-compact .iw-customer-section-nav,
  #iw-customer-editor-shell.iw-editor-compact .iw-form-grid,
  #iw-customer-editor-shell.iw-editor-compact .iw-company-grid,
  #iw-customer-editor-shell.iw-editor-compact .iw-repeater-row,
  #iw-customer-editor-shell.iw-editor-compact .iw-sensitive-input-wrap {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #iw-customer-editor-shell.iw-editor-compact {
    width: 100% !important;
    overflow-x: hidden !important;
  }

  #iw-customer-editor-shell.iw-editor-compact #iw-customer-editor-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 0.85rem !important;
  }

  #iw-customer-editor-shell.iw-editor-compact .iw-customer-editor-summary-main {
    display: block !important;
    width: 100% !important;
  }

  #iw-customer-editor-shell.iw-editor-compact #iw-customer-editor-summary-badges,
  #iw-customer-editor-shell.iw-editor-compact #iw-customer-editor-summary .iw-badges {
    display: flex !important;
    width: 100% !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 0.55rem !important;
  }

  #iw-customer-editor-shell.iw-editor-compact #iw-customer-editor-summary-title,
  #iw-customer-editor-shell.iw-editor-compact #iw-customer-editor-summary-copy,
  #iw-customer-editor-shell.iw-editor-compact .iw-customer-editor-summary-line,
  #iw-customer-editor-shell.iw-editor-compact .iw-field > span,
  #iw-customer-editor-shell.iw-editor-compact input,
  #iw-customer-editor-shell.iw-editor-compact textarea,
  #iw-customer-editor-shell.iw-editor-compact select,
  #iw-customer-editor-shell.iw-editor-compact .iw-badge,
  #iw-customer-editor-shell.iw-editor-compact .iw-customer-section-button {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  #iw-customer-editor-shell.iw-editor-compact .iw-customer-section-nav {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  #iw-customer-editor-shell.iw-editor-compact .iw-customer-section-button,
  #iw-customer-editor-shell.iw-editor-compact .iw-sensitive-toggle {
    width: 100% !important;
  }

  #iw-customer-editor-shell.iw-editor-compact .iw-form-grid,
  #iw-customer-editor-shell.iw-editor-compact .iw-company-grid,
  #iw-customer-editor-shell.iw-editor-compact .iw-repeater-row,
  #iw-customer-editor-shell.iw-editor-compact .iw-sensitive-input-wrap {
    grid-template-columns: 1fr !important;
  }
}


/* 2026-04-09 desktop CRM customer card layout enhancement */
@media (min-width: 901px) {
  #iw-customers-list .iw-row.iw-customer-row {
    padding: 1.35rem 1.45rem 1.2rem;
    gap: 1rem;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-row-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem 1.5rem;
    align-items: start;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-row-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    min-width: 0;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-row-title {
    font-size: 1.12rem;
    line-height: 1.2;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-customer-card-subtitle {
    margin-top: 0;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-badges {
    justify-content: flex-end;
    align-items: flex-start;
    align-content: flex-start;
    gap: 0.5rem;
    max-width: 360px;
    padding-top: 0.15rem;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-customer-card-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1.6rem;
    margin-top: 0.5rem;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-customer-card-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.22rem;
    align-content: start;
    padding-top: 0.8rem;
    border-top: 1px solid #e2e8f0;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-customer-card-label {
    font-size: 0.73rem;
    letter-spacing: 0.05em;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-customer-card-value {
    line-height: 1.45;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    padding-top: 1rem;
    margin-top: 0.1rem;
    border-top: 1px solid #dbe4ee;
  }

  #iw-customers-list .iw-row.iw-customer-row .iw-row-actions > .fa-primary-button {
    flex: 0 0 auto;
  }
}


/* 2026-04-10 reporting + billing refinement patch */
.iw-grid.iw-grid-billing-columns,
.iw-grid.iw-grid-reporting,
.iw-grid.iw-grid-reporting-secondary {
  grid-template-columns: 1fr;
}

.iw-grid.iw-grid-billing-columns {
  gap: 1.25rem;
}

.iw-reporting-metric-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#iw-pane-reporting .iw-card,
#iw-pane-billing .iw-card,
#iw-pane-maintenance .iw-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-color: #dbe7f3;
}

#iw-pane-reporting .iw-reporting-metric-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-color: #d6e5f6;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.06);
}

#iw-pane-reporting .iw-reporting-metric-card:nth-child(2n) {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

#iw-pane-reporting .iw-reporting-metric-card:nth-child(3n) {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfa 100%);
}

#iw-pane-reporting .iw-card-header,
#iw-pane-billing .iw-card-header,
#iw-pane-maintenance .iw-card-header {
  margin-bottom: 1rem;
}

#iw-pane-reporting .iw-reporting-sales-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-color: #d7e5f5;
}

#iw-pane-reporting #iw-reporting-qbo-metrics .iw-reporting-sales-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

#iw-pane-reporting .iw-reporting-bars,
#iw-pane-reporting .iw-reporting-link-list,
#iw-pane-billing .iw-list,
#iw-pane-maintenance .iw-list {
  min-height: 0;
}

.iw-reporting-estimate-row {
  display: grid;
  gap: 0.9rem;
}

.iw-reporting-estimate-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.iw-reporting-estimate-copy {
  margin: 0.2rem 0 0;
}

.iw-reporting-estimate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.iw-inline-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 180px;
}

.iw-inline-field span {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

.iw-inline-select {
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  padding: 0.55rem 0.85rem;
  background: #fff;
  color: #0f172a;
}

.iw-reporting-note {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

#iw-billing-activity .iw-row-meta,
#iw-reporting-active-estimates .iw-row-meta {
  line-height: 1.5;
}

#iw-billing-activity .iw-row-actions,
#iw-reporting-active-estimates .iw-row-actions {
  align-items: flex-end;
}

.iw-billing-activity-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.iw-pane-header-billing .iw-pane-header-actions-billing {
  border-top-color: #dbe7f3;
}

@media (max-width: 1120px) {
  .iw-reporting-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .iw-reporting-metric-grid,
  #iw-pane-reporting .iw-reporting-sales-grid {
    grid-template-columns: 1fr;
  }

  .iw-reporting-estimate-top {
    flex-direction: column;
  }

  .iw-reporting-estimate-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .iw-inline-field {
    min-width: 0;
  }
}


.iw-reporting-sync-note[hidden] {
  display: none !important;
}

.iw-reporting-estimate-status-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.iw-reporting-estimate-status-inline[hidden] {
  display: none !important;
}

.iw-reporting-estimate-status-inline .iw-inline-field {
  min-width: 220px;
}

.iw-inline-field-grow {
  flex: 1 1 220px;
}

.iw-inline-button.is-secondary {
  background: transparent;
}

.iw-appointment-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.iw-appointment-toolbar-actions,
.iw-pane-button-group,
.iw-appointment-row-badges,
.iw-calendar-target-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.iw-appointment-toolbar-grid,
.iw-appointment-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem 1rem;
}

.iw-appointment-row {
  gap: 1rem;
}

.iw-calendar-connection-row {
  gap: 1rem;
}

.iw-calendar-target-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #dbe4ee;
  border-radius: 0.85rem;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
}

.iw-calendar-target-pill span {
  color: #475569;
  font-weight: 600;
  font-size: 0.88rem;
}

.iw-appointment-target-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-top: 0.65rem;
}

.iw-appointment-target-check {
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid #dbe4ee;
  border-radius: 0.9rem;
  background: #f8fafc;
}

.iw-appointment-target-check small {
  display: block;
  color: #64748b;
  font-weight: 600;
  margin-top: 0.15rem;
}

.iw-appointment-status-scheduled,
.iw-appointment-publish-success {
  background: #ecfdf3;
  color: #166534;
  border-color: #bbf7d0;
}

.iw-appointment-status-confirmed {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.iw-appointment-status-unscheduled,
.iw-appointment-publish-pending {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.iw-appointment-status-canceled,
.iw-appointment-publish-failed,
.iw-appointment-publish-canceled {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

@media (max-width: 820px) {
  .iw-appointment-toolbar-grid,
  .iw-appointment-row-grid,
  .iw-appointment-target-picker {
    grid-template-columns: 1fr;
  }
}


.iw-appointment-modal-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.iw-technician-list .iw-row,
#iw-technician-list .iw-row {
  gap: 0.85rem;
}

#iw-pane-appointments .iw-grid-billing-columns {
  align-items: start;
}

#iw-pane-appointments .iw-card {
  min-height: 0;
}

.iw-pane-header-appointments,
.iw-pane-header-actions-appointments {
  align-items: flex-start;
}

.iw-appointments-layout {
  display: grid;
  gap: 1.5rem;
}

.iw-appointments-setup-card {
  scroll-margin-top: 110px;
}

.iw-card-header-appointments-setup {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.iw-pane-button-group-appointments {
  justify-content: flex-end;
}

.iw-appointments-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

.iw-appointments-search-field {
  min-width: 0;
  grid-column: 1 / span 2;
}

.iw-appointments-search-field input {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid #c9d7e8;
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
}

.iw-appointments-search-field input::placeholder {
  color: #64748b;
}

.iw-calendar-connection-row {
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.iw-calendar-connection-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.iw-connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #eef4ff;
  color: #1e3a8a;
  font-size: 0.82rem;
  font-weight: 700;
}

.iw-connection-badge.is-warning {
  background: #fffbeb;
  color: #92400e;
}

.iw-connection-badge.is-success {
  background: #ecfdf3;
  color: #166534;
}

.iw-calendar-target-pill.is-family {
  border-color: #bfdbfe;
  background: #eff6ff;
}


#iw-pane-appointments {
  padding-bottom: 2.5rem;
}

#iw-pane-appointments .iw-pane-header-actions,
#iw-pane-appointments .iw-row-actions,
#iw-pane-appointments .iw-pane-button-group-appointments {
  min-width: 0;
}

#iw-pane-appointments .iw-inline-button,
#iw-pane-appointments .fa-dark-outline-button,
#iw-pane-appointments .fa-primary-button {
  max-width: 100%;
}

#iw-pane-appointments label,
#iw-pane-appointments select,
#iw-pane-appointments input {
  min-width: 0;
}

.iw-appointment-toolbar-actions .iw-inline-button.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.iw-calendar-connection-row .iw-row-actions,
.iw-appointment-row .iw-row-actions {
  justify-content: flex-end;
}

@media (max-width: 1100px) {
  .iw-appointments-search-field {
    grid-column: auto;
  }

  .iw-appointments-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .iw-card-header-appointments-setup {
    flex-direction: column;
  }

  .iw-pane-button-group-appointments {
    width: 100%;
  }

  .iw-pane-button-group-appointments > * {
    flex: 1 1 220px;
  }
}

@media (max-width: 820px) {
  .iw-appointments-search-field {
    grid-column: auto;
  }

  .iw-appointments-filter-grid {
    grid-template-columns: 1fr;
  }

  .iw-appointment-toolbar-actions,
  .iw-calendar-target-list,
  .iw-row-actions,
  .iw-pane-header-actions-appointments {
    width: 100%;
  }

  .iw-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .iw-row-actions > button,
  .iw-row-actions > a,
  .iw-pane-header-actions-appointments > button {
    flex: 1 1 150px;
  }
}


.iw-inline-button.iw-inline-button-danger {
  border-color: #dc2626;
  color: #b91c1c;
  background: #fff5f5;
}

.iw-inline-button.iw-inline-button-danger:hover,
.iw-inline-button.iw-inline-button-danger:focus-visible {
  border-color: #b91c1c;
  background: #fee2e2;
  color: #991b1b;
}

.iw-appointment-travel-box {
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  background: #f8fbff;
}

.iw-appointment-travel-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.iw-appointment-travel-inline input {
  width: 100%;
}

.iw-appointment-travel-labels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.75rem;
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.88rem;
}

.iw-appointment-travel-labels span:last-child {
  visibility: hidden;
}

@media (max-width: 720px) {
  .iw-appointment-travel-inline,
  .iw-appointment-travel-labels {
    grid-template-columns: 1fr;
  }

  .iw-appointment-travel-labels span:last-child {
    display: none;
  }
}


.iw-inline-button.iw-inline-button-ui-delete {
  border-color: #b61c1c;
  color: #ffffff;
  background: #b61c1c;
}
.iw-inline-button.iw-inline-button-ui-delete:hover,
.iw-inline-button.iw-inline-button-ui-delete:focus-visible {
  border-color: #991b1b;
  color: #ffffff;
  background: #991b1b;
}
#iw-pane-appointments .iw-appointments-layout {
  display: flex;
  flex-direction: column;
}
#iw-pane-appointments .iw-card:first-child {
  order: 0;
}
#iw-pane-appointments .iw-appointment-toolbar {
  order: 1;
}


.iw-appointment-row-header {
  align-items: flex-start;
  gap: 1rem;
}

.iw-appointment-row-heading {
  min-width: 0;
}

.iw-appointment-row-grid {
  align-items: start;
}

.iw-appointment-detail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.iw-appointment-detail-label {
  color: #5f7696;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.iw-appointment-detail-value-wrap,
.iw-appointment-detail-value {
  color: #0f172a;
  font-weight: 600;
  min-width: 0;
}

.iw-appointment-ticket-stack {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.iw-phone-action-group-appointment {
  flex-wrap: wrap;
}

.iw-appointment-row .fa-danger-button,
#iw-customer-appointments .fa-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 14px;
}

@media (max-width: 820px) {
  .iw-appointment-row {
    display: flex;
    flex-direction: column;
  }

  .iw-appointment-row-header {
    display: contents;
  }

  .iw-appointment-row-heading {
    order: 1;
  }

  .iw-appointment-row-grid {
    order: 2;
  }

  .iw-appointment-row-actions {
    order: 3;
    margin-top: 0.25rem;
  }

  .iw-appointment-detail-address { order: 1; }
  .iw-appointment-detail-ticket { order: 2; }
  .iw-appointment-detail-time { order: 3; }
  .iw-appointment-detail-targets { order: 4; }
  .iw-appointment-detail-phone { order: 5; }
  .iw-appointment-detail-technician { order: 6; }

  .iw-appointment-row-actions > button,
  .iw-appointment-row-actions > a {
    flex: 1 1 140px;
  }
}


.iw-inline-button-block {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.iw-technician-schedule-grid {
  display: grid;
  gap: 0.75rem;
}

.iw-technician-schedule-row {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.iw-technician-schedule-row select {
  min-width: 0;
}

@media (max-width: 820px) {
  .iw-technician-schedule-row {
    grid-template-columns: 1fr;
  }
}


.iw-appointment-target-check.is-locked {
  opacity: 0.9;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 14px;
}

.iw-appointment-target-check.is-locked input {
  pointer-events: none;
}

.iw-appointment-scheduler-note {
  margin-bottom: 0.25rem;
}


.iw-appointment-manual-schedule[hidden],
.iw-appointment-suggestions-status[hidden],
#iw-appointment-suggestions[hidden],
.iw-appointment-travel-box[hidden],
.iw-appointment-manual-schedule.is-hidden,
.iw-appointment-suggestions-status.is-hidden,
#iw-appointment-suggestions.is-hidden,
.iw-appointment-travel-box.is-hidden {
  display: none !important;
}
.iw-appointment-manual-schedule {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(95, 118, 150, 0.18);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.92);
}

.iw-modal-form-grid-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}


.iw-appointment-availability-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid #dbe4ee;
  border-radius: 0.9rem;
  background: #f8fbff;
}

.iw-appointment-availability-card span {
  color: #475569;
  font-size: 0.92rem;
}

#iw-appointment-suggestions,
#iw-appointment-availability-summary,
#iw-appointment-override-suggestions {
  display: grid;
  gap: 0.75rem;
}

#iw-appointment-suggestions {
  margin-top: 0.35rem;
}

.iw-appointment-override-title {
  color: #7c2d12;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.iw-inline-button.iw-inline-button-warning {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.iw-inline-button.iw-inline-button-warning:hover,
.iw-inline-button.iw-inline-button-warning:focus-visible {
  border-color: #d97706;
  background: #fef3c7;
  color: #78350f;
}


#iw-appointment-reconnect-box {
  gap: 0.75rem;
}

.iw-appointment-reconnect-card,
.iw-technician-google-access {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(95, 118, 150, 0.18);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.92);
}

.iw-appointment-reconnect-card strong {
  color: #7c2d12;
}


.iw-appointment-manual-warning {
  margin-top: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid #f59e0b;
  border-radius: 0.9rem;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}

#iw-appointment-override-suggestions .iw-inline-button,
#iw-appointment-suggestions .iw-inline-button {
  margin-top: 0.45rem;
}


.iw-appointment-suggestion-button {
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.iw-appointment-suggestion-button:hover,
.iw-appointment-suggestion-button:focus-visible {
  transform: translateY(-1px);
}

.iw-appointment-suggestion-button.is-selected {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.iw-appointment-suggestion-button.is-saving {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.65);
  color: #0f172a;
  cursor: progress;
  opacity: 0.92;
}

.iw-appointment-suggestion-button[disabled] {
  opacity: 0.72;
}


.iw-modal-actions-smart-mode #iw-modal-confirm,
.iw-modal-actions-smart-mode .fa-primary-button{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

/* Internal workspace sticky section nav fix v20260427b.
   Keep the existing button layout and visual styling, but remove ancestor clipping
   that prevents the secondary nav from sticking during page scroll. */
.fa-app-shell {
  overflow: visible !important;
}

.fa-app-shell.iw-shell-view-tickets,
.fa-app-shell.iw-shell-view-maintenance,
.fa-app-shell.iw-shell-view-reporting {
  overflow: visible !important;
}

.iw-topnav {
  position: sticky !important;
  top: 82px;
  z-index: 1000;
}

@media (max-width: 720px) {
  .iw-topnav {
    position: static !important;
    top: auto !important;
    z-index: auto;
  }
}


.iw-modal-inner-startup-mode {
  max-width: 760px;
}

.iw-startup-choice-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.iw-startup-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: flex-start;
  border: 1px solid #dbe4ee;
  border-radius: 0.9rem;
  padding: 0.95rem;
  background: #f8fafc;
  cursor: pointer;
}

.iw-startup-choice:hover,
.iw-startup-choice:focus-within,
.iw-startup-choice.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.iw-startup-choice input {
  margin-top: 0.25rem;
}

.iw-startup-choice strong,
.iw-startup-choice small {
  display: block;
}

.iw-startup-choice strong {
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 800;
}

.iw-startup-choice small {
  color: #475569;
  line-height: 1.45;
  margin-top: 0.2rem;
}

body.iw-demo-mode .fa-app-title::after,
body.iw-privacy-mode .fa-app-title::after {
  display: inline-flex;
  margin-left: 0.65rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.2;
  vertical-align: middle;
  background: #e0f2fe;
  color: #075985;
}

body.iw-demo-mode .fa-app-title::after {
  content: "Demo mode";
}

body.iw-privacy-mode .fa-app-title::after {
  content: "Privacy mode";
}

body.iw-privacy-mode .iw-row:not(.is-selected):not(.is-active),
body.iw-privacy-mode .iw-open-records-list,
body.iw-privacy-mode #iw-pane-reporting .iw-card,
body.iw-privacy-mode #iw-pane-reporting .iw-row,
body.iw-privacy-mode #iw-pane-reporting .iw-reporting-metric-card,
body.iw-privacy-mode #iw-pane-billing .iw-card,
body.iw-privacy-mode #iw-pane-billing .iw-row,
body.iw-privacy-mode #iw-pane-maintenance .iw-card:not(.iw-maintenance-qbo-card) {
  filter: blur(7px);
  user-select: none;
}

body.iw-privacy-mode #iw-customer-editor-shell,
body.iw-privacy-mode #iw-lead-editor-shell,
body.iw-privacy-mode .iw-modal,
body.iw-privacy-mode .iw-modal * {
  filter: none;
  user-select: auto;
}

body.iw-privacy-mode .iw-sensitive-field,
body.iw-privacy-mode [data-iw-secure-credential-row],
body.iw-privacy-mode #iw-customer-wifi-password,
body.iw-privacy-mode #iw-customer-form input[name="wifiPassword"] {
  filter: blur(7px);
}

body.iw-privacy-mode .iw-sensitive-field:focus-within,
body.iw-privacy-mode [data-iw-secure-credential-row]:focus-within,
body.iw-privacy-mode #iw-customer-wifi-password:focus,
body.iw-privacy-mode #iw-customer-form input[name="wifiPassword"]:focus {
  filter: none;
}


/* Startup mode repair, privacy masking with per-section reveal controls. */
body.iw-privacy-mode .iw-row:not(.is-selected):not(.is-active),
body.iw-privacy-mode .iw-open-records-list,
body.iw-privacy-mode #iw-pane-reporting .iw-card,
body.iw-privacy-mode #iw-pane-reporting .iw-row,
body.iw-privacy-mode #iw-pane-reporting .iw-reporting-metric-card,
body.iw-privacy-mode #iw-pane-billing .iw-card,
body.iw-privacy-mode #iw-pane-billing .iw-row,
body.iw-privacy-mode #iw-pane-maintenance .iw-card:not(.iw-maintenance-qbo-card) {
  filter: none !important;
}

body.iw-privacy-mode .iw-privacy-mask-target {
  position: relative;
  overflow: visible;
}

body.iw-privacy-mode .iw-privacy-mask-target:not(.is-privacy-revealed) > :not(.iw-privacy-reveal-button) {
  filter: blur(7px);
  user-select: none;
  pointer-events: none;
}

body.iw-privacy-mode .iw-privacy-mask-target.is-privacy-revealed > :not(.iw-privacy-reveal-button) {
  filter: none;
  user-select: auto;
  pointer-events: auto;
}

.iw-privacy-reveal-button {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 20;
  border: 1px solid #0f172a;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0.45rem 0.65rem;
  text-transform: uppercase;
}

.iw-privacy-reveal-button:hover,
.iw-privacy-reveal-button:focus {
  background: #0f172a;
  color: #ffffff;
  outline: none;
}

body.iw-privacy-mode #iw-customer-editor-shell .iw-privacy-reveal-button,
body.iw-privacy-mode #iw-lead-editor-shell .iw-privacy-reveal-button,
body.iw-privacy-mode .iw-modal .iw-privacy-reveal-button {
  display: none;
}

body.iw-demo-mode #iw-preview-banner {
  display: block;
}

/* Privacy mode must never mask the Support Assistant tab. */
body.iw-privacy-mode #iw-pane-tickets,
body.iw-privacy-mode #iw-pane-tickets *,
body.iw-privacy-mode .fa-records-modal,
body.iw-privacy-mode .fa-records-modal * {
  filter: none !important;
  user-select: auto !important;
  pointer-events: auto !important;
}

body.iw-privacy-mode #iw-pane-tickets .iw-privacy-reveal-button {
  display: none !important;
}

/* Gmail composer and recent interactions */
.iw-gmail-composer {
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 18px;
  background: #ffffff;
  padding: 16px;
  margin: 12px 0 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.iw-gmail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  margin: 8px 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: #f8fafc;
}

.iw-gmail-editor {
  min-height: 180px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  padding: 14px;
  line-height: 1.55;
  overflow: auto;
}

.iw-gmail-editor:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: rgba(37, 99, 235, 0.65);
}

.iw-gmail-editor a {
  color: #1155cc;
  text-decoration: underline;
  cursor: pointer;
}

.iw-gmail-editor ul,
.iw-gmail-editor ol {
  margin: 0.5rem 0 0.5rem 1.5rem;
  padding-left: 1.25rem;
}

.iw-gmail-editor ul {
  list-style: disc outside;
}

.iw-gmail-editor ol {
  list-style: decimal outside;
}

.iw-gmail-editor li {
  display: list-item;
  margin: 0.15rem 0;
}

.iw-gmail-send-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 12px;
}

.iw-gmail-list {
  gap: 12px;
}

.iw-gmail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 16px;
  background: #ffffff;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.iw-gmail-row:hover,
.iw-gmail-row:focus-within {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.10);
}

.iw-gmail-row-main {
  min-width: 0;
}

.iw-gmail-row-header {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.iw-gmail-subject {
  margin: 0;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.iw-gmail-date,
.iw-gmail-meta,
.iw-gmail-snippet {
  margin: 3px 0;
  color: #334155;
  line-height: 1.45;
}

.iw-gmail-date {
  white-space: nowrap;
  font-size: 0.88rem;
  color: #64748b;
}

.iw-gmail-snippet {
  color: #475569;
}

.iw-gmail-full {
  margin-top: 10px;
}

.iw-gmail-full summary {
  cursor: pointer;
  color: #1d4ed8;
  font-weight: 700;
}

.iw-gmail-full pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 360px;
  overflow: auto;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 12px;
  margin: 8px 0 0;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.92rem;
}

.iw-gmail-row-actions {
  display: flex;
  justify-content: flex-end;
}

.iw-gmail-more-actions {
  justify-content: center;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .iw-gmail-send-options,
  .iw-gmail-row {
    grid-template-columns: 1fr;
  }

  .iw-gmail-row-header {
    display: block;
  }

  .iw-gmail-row-actions {
    justify-content: flex-start;
  }
}


/* Gmail precision refinements */

.iw-gmail-signature a {
  color: #1155cc;
  text-decoration: underline;
  cursor: pointer;
}

.iw-gmail-editor .iw-gmail-signature a {
  pointer-events: auto;
}

.iw-gmail-signature {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.22;
  color: #202124;
}

.iw-gmail-toolbar .iw-gmail-tool-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  padding: 6px 10px;
}

.iw-gmail-toolbar input[type="color"] {
  width: 28px;
  height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.iw-gmail-tool-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
}

.iw-gmail-meta-from,
.iw-gmail-meta-to {
  margin-bottom: 10px;
}

.iw-gmail-snippet {
  margin-top: 12px;
  white-space: pre-wrap;
}

.iw-gmail-row {
  line-height: 1.55;
}

.iw-gmail-row-header {
  margin-bottom: 12px;
}

.iw-gmail-read-receipt-option {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  align-self: end;
  min-height: 42px;
  width: auto;
  max-width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  padding: 10px 12px;
  font-weight: 700;
  line-height: 1.2;
}

.iw-gmail-read-receipt-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
}

.iw-gmail-read-receipt-option span {
  display: inline-block;
}

/* Gmail follow-up refinements */
.iw-gmail-editor .iw-gmail-signature,
.iw-gmail-signature {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  color: #202124;
  margin-top: 0;
  white-space: normal;
}

.iw-gmail-editor .iw-gmail-signature div,
.iw-gmail-signature div {
  display: block;
  line-height: 1.35;
  margin: 0;
  padding: 0;
}

.iw-gmail-signature-spacer {
  display: block;
  min-height: 1em;
  line-height: 1.35;
}

.iw-gmail-send-options {
  align-items: start;
  margin-bottom: 14px;
}

.iw-gmail-read-receipt-option {
  align-self: start;
  margin-top: 0;
  margin-bottom: 8px;
}

.iw-gmail-composer > .iw-row-actions {
  margin-top: 14px;
  padding-top: 0;
}

.iw-gmail-attachments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.iw-gmail-attachment-button {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.iw-gmail-attachment-button span {
  color: #64748b;
  font-weight: 700;
}


/* Gmail attachment and preview readability fixes */
.iw-gmail-snippet {
  white-space: pre-wrap;
  margin-top: 14px;
  margin-bottom: 10px;
}

.iw-gmail-attachments-inline {
  margin: 10px 0 8px;
  padding: 10px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.iw-gmail-attachment-button.is-loading,
.iw-gmail-attachment-button:disabled {
  opacity: 0.75;
  cursor: wait;
}

.iw-gmail-more-actions {
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.iw-gmail-read-receipt-option {
  margin-bottom: 14px;
}

.iw-gmail-composer > .iw-row-actions {
  margin-top: 16px;
}


/* Gmail render and composer refinements */
.iw-gmail-row-incoming {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.55);
}

.iw-gmail-row-outgoing {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.35);
}

.iw-gmail-html-preview,
.iw-gmail-html-full {
  margin-top: 14px;
  color: #1f2937;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.iw-gmail-html-preview {
  max-height: 520px;
  overflow: hidden;
}

.iw-gmail-html-preview p,
.iw-gmail-html-preview div,
.iw-gmail-html-full p,
.iw-gmail-html-full div {
  margin-top: 0;
  margin-bottom: 6px;
}

.iw-gmail-html-preview a,
.iw-gmail-html-full a {
  color: #1155cc;
  text-decoration: underline;
}

.iw-gmail-full .iw-gmail-html-full {
  max-height: 520px;
  overflow: auto;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 14px;
  margin: 8px 0 0;
}

.iw-gmail-full pre {
  display: none;
}

.iw-gmail-open-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(218, 220, 224, 0.95);
  background: #ffffff;
  color: #1f1f1f;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.iw-gmail-open-button:hover,
.iw-gmail-open-button:focus {
  background: #f8fafd;
  border-color: rgba(66, 133, 244, 0.55);
  color: #174ea6;
  text-decoration: none;
}

.iw-gmail-open-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ea4335 0 25%, #fbbc04 25% 50%, #34a853 50% 75%, #4285f4 75% 100%);
  color: #ffffff;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 900;
}

.iw-gmail-color-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 12px;
  padding: 6px 8px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
}

.iw-gmail-color-chip {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  border-radius: 999px;
  background: var(--iw-chip-color, #202124);
  cursor: pointer;
  padding: 0;
}

.iw-gmail-color-chip:hover,
.iw-gmail-color-chip:focus {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.iw-gmail-spellcheck-button[aria-pressed="true"] {
  background: #dff3ff;
  color: #075985;
  border-color: rgba(14, 165, 233, 0.35);
}

.iw-gmail-spellcheck-button[aria-pressed="false"] {
  background: #fff7ed;
  color: #9a3412;
  border-color: rgba(251, 146, 60, 0.45);
}


/* Gmail regression fixes */
.iw-gmail-spellcheck-button {
  cursor: pointer;
  user-select: none;
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.iw-gmail-spellcheck-button[aria-pressed="true"] {
  background: #e0f2fe;
  color: #075985;
  border-color: rgba(14, 165, 233, 0.45);
}

.iw-gmail-spellcheck-button[aria-pressed="false"] {
  background: #fff7ed;
  color: #9a3412;
  border-color: rgba(251, 146, 60, 0.55);
}

.iw-gmail-color-chip {
  cursor: pointer;
}

.iw-gmail-color-chip:active {
  transform: translateY(1px);
}


/* Gmail targeted fixes */
.iw-gmail-logo {
  display: inline-block;
  width: 24px;
  height: 18px;
  flex: 0 0 auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath fill='%23fff' d='M4 3h32v24H4z'/%3E%3Cpath fill='%23ea4335' d='M4 3l16 12L36 3v6L20 21 4 9z'/%3E%3Cpath fill='%234285f4' d='M4 9v18h6V13.5z'/%3E%3Cpath fill='%2334a853' d='M36 9v18h-6V13.5z'/%3E%3Cpath fill='%23fbbc04' d='M10 27h20v-6H10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.iw-gmail-html-preview img,
.iw-gmail-html-full img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.iw-gmail-row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.iw-gmail-color-chip {
  cursor: pointer;
}

.iw-gmail-spellcheck-button {
  cursor: pointer;
  user-select: none;
}


/* Gmail attachment UX refinements */
.iw-gmail-attachments-inline {
  display: block;
  margin: 14px 0 10px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  background: #f8fbff;
}

.iw-gmail-attachment-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  margin-bottom: 10px;
}

.iw-gmail-attachment-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.9rem;
}

.iw-gmail-attachment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

.iw-gmail-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.iw-gmail-attachment-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid rgba(37, 99, 235, 0.32);
  border-radius: 12px;
  background: #ffffff;
  color: #174ea6;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.iw-gmail-attachment-button:hover,
.iw-gmail-attachment-button:focus {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.55);
  color: #0b57d0;
  outline: none;
}

.iw-gmail-attachment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.iw-gmail-attachment-name {
  color: #174ea6;
  overflow-wrap: anywhere;
}

.iw-gmail-attachment-size {
  color: #64748b;
  font-weight: 800;
  white-space: nowrap;
}

.iw-gmail-row-actions .iw-gmail-reply,
.iw-gmail-row-actions .iw-gmail-reply-all,
.iw-gmail-row-actions .iw-gmail-open-button {
  width: max-content;
  justify-content: center;
}

/* Contract package module */
.iw-shell-view-contracts .iw-pane-header-actions {
  flex-wrap: wrap;
}

#iw-pane-contracts .iw-list-card {
  gap: 14px;
}

#iw-pane-contracts .iw-list-card-actions,
#iw-pane-contracts .iw-pane-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#iw-pane-contracts .iw-alert-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff1f2;
  color: #991b1b;
  font-weight: 800;
}

#iw-pane-contracts .iw-danger-button {
  border-color: #dc2626;
  color: #991b1b;
  background: #fff5f5;
}

#iw-pane-contracts .iw-danger-button:hover,
#iw-pane-contracts .iw-danger-button:focus-visible {
  border-color: #b91c1c;
  background: #fee2e2;
  color: #991b1b;
}

#iw-pane-contracts .iw-inline-button-ui-delete {
  border-color: #b61c1c;
  color: #ffffff;
  background: #b61c1c;
}

#iw-pane-contracts .iw-inline-button-ui-delete:hover,
#iw-pane-contracts .iw-inline-button-ui-delete:focus-visible {
  border-color: #991b1b;
  color: #ffffff;
  background: #991b1b;
}

/* Contract package UX fixes */
.iw-shell-view-contracts .iw-grid-billing-columns {
  grid-template-columns: 1fr;
  align-items: start;
}

#iw-pane-contracts .iw-card {
  min-width: 0;
}

#iw-pane-contracts #iw-contract-detail {
  scroll-margin-top: 120px;
}

#iw-pane-contracts .iw-contract-package-card.is-selected {
  border-color: #0f172a;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.14), 0 16px 36px rgba(15, 23, 42, 0.08);
}

#iw-pane-contracts .iw-contract-detail-card {
  display: grid;
  gap: 1rem;
}

.iw-contract-detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.iw-contract-detail-heading h3 {
  margin-bottom: 0.3rem;
}

.iw-contract-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1.25rem;
}

.iw-contract-detail-grid p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.iw-contract-actions {
  padding-top: 0.25rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.iw-contract-actions .iw-inline-button {
  white-space: nowrap;
  flex: 0 0 auto;
}

.iw-contract-warning-text {
  color: #991b1b;
  font-weight: 800;
}

.iw-modal-inner-contract-create .iw-modal-copy {
  display: block;
}

.iw-contract-create-form {
  display: grid;
  gap: 1rem;
}

.iw-contract-modal-note {
  border: 1px solid #bfdbfe;
  border-radius: 0.95rem;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 0.85rem 1rem;
  font-weight: 700;
  line-height: 1.45;
}

#iw-contract-create-error {
  margin: 0.2rem 0 0;
  color: #991b1b;
  font-weight: 800;
}

@media (max-width: 760px) {
  .iw-contract-detail-heading,
  #iw-pane-contracts .iw-list-card-actions,
  #iw-pane-contracts .iw-pane-button-group {
    align-items: stretch;
    flex-direction: column;
  }

  .iw-contract-detail-grid {
    grid-template-columns: 1fr;
  }

  #iw-pane-contracts .iw-inline-button,
  #iw-pane-contracts .fa-dark-outline-button,
  #iw-pane-contracts .fa-primary-button {
    width: 100%;
    justify-content: center;
  }
}


/* Contract package containment fixes */
.fa-app-shell.iw-shell-view-contracts #iw-pane-contracts {
  overflow: visible;
  padding-bottom: 3rem;
}

.fa-app-shell.iw-shell-view-contracts #iw-pane-contracts .iw-grid-billing-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.fa-app-shell.iw-shell-view-contracts #iw-pane-contracts .iw-card,
.fa-app-shell.iw-shell-view-contracts #iw-pane-contracts .iw-list,
.fa-app-shell.iw-shell-view-contracts #iw-pane-contracts .iw-list-card,
.fa-app-shell.iw-shell-view-contracts #iw-pane-contracts .iw-contract-detail-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.fa-app-shell.iw-shell-view-contracts #iw-pane-contracts .iw-contract-actions {
  max-width: 100%;
  overflow-wrap: normal;
}

/* Startup QuickBooks and Reporting progress modal */
.iw-modal-inner-sync-progress .iw-modal-copy {
  display: block;
}

.iw-sync-progress-modal {
  display: grid;
  gap: 0.85rem;
}

.iw-sync-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.iw-sync-progress-row strong,
.iw-sync-progress-row span {
  color: #0f172a;
  font-weight: 900;
}

.iw-sync-progress-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
}

.iw-sync-progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0f766e);
  transition: width 0.25s ease;
}

.iw-sync-progress-note {
  margin: 0;
  color: #475569;
  font-weight: 700;
  line-height: 1.45;
}

/* Contract list spacing refinement */
#iw-pane-contracts .iw-contract-package-card {
  padding: 1.2rem 1.35rem;
  gap: 1rem;
  align-items: flex-start;
}

#iw-pane-contracts .iw-contract-package-card .iw-list-card-main {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

#iw-pane-contracts .iw-contract-package-card h3,
#iw-pane-contracts .iw-contract-package-card p {
  margin: 0;
  line-height: 1.45;
}

#iw-pane-contracts .iw-contract-package-card .iw-list-card-actions {
  margin-top: 0.35rem;
}


.iw-startup-sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.iw-startup-sync-overlay[hidden] {
  display: none !important;
}

.iw-startup-sync-card {
  width: min(560px, calc(100vw - 2.5rem));
  padding: 1.35rem;
  border-radius: 1.2rem;
  border: 1px solid #d9e2ef;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.iw-startup-sync-card h2 {
  margin: 0 0 1rem;
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 900;
}

/* Contract package link copy modal */
.iw-contract-link-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.9rem;
  padding: 0.75rem;
  border: 1px solid #d9e2ef;
  border-radius: 0.9rem;
  background: #f8fafc;
}

.iw-contract-link-copy-row code {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  color: #12263f;
  font-weight: 800;
  line-height: 1.45;
}

.iw-icon-copy-button {
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid #c9d6e8;
  border-radius: 0.85rem;
  background: #ffffff;
  color: #12263f;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

.iw-icon-copy-button:hover,
.iw-icon-copy-button:focus-visible {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

#iw-pane-contracts .iw-contract-package-card {
  padding: 1.45rem 1.6rem;
}

#iw-pane-contracts .iw-contract-package-card .iw-list-card-actions {
  margin-top: 0.7rem;
}


.iw-contract-email-draft {
  margin-top: 1rem;
  border: 1px solid #d9e2ef;
  border-radius: 16px;
  padding: 1rem;
  background: #fbfdff;
  max-height: 68vh;
  overflow: auto;
}

.iw-contract-email-draft h4 {
  margin: 0 0 0.75rem;
}

.iw-contract-email-preview {
  border: 1px solid #d9e2ef;
  border-radius: 14px;
  background: #fff;
  padding: 1rem;
  margin: 0.75rem 0;
  max-height: 320px;
  overflow: auto;
}


.iw-contract-email-draft .iw-field-label {
  display: block;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
  font-weight: 800;
}

.iw-contract-email-draft .iw-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.iw-contract-email-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

.iw-contract-email-grid .iw-field-label,
.iw-contract-email-grid .iw-input,
.iw-contract-email-subject-row {
  grid-column: 1 / -1;
  width: 100%;
}

.iw-contract-email-signer-check {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d9e2ef;
  border-radius: 12px;
  background: #fff;
  font-size: 0.9rem;
}

.iw-contract-email-signer-check.is-warning {
  border-color: #f4b4b4;
  background: #fff5f5;
  color: #9f1239;
}

.iw-contract-email-editor {
  min-height: 420px;
  max-height: 56vh;
  overflow: auto;
  border: 1px solid #d9e2ef;
  border-radius: 14px;
  background: #fff;
  padding: 1rem;
  line-height: 1.55;
  white-space: normal;
}

.iw-contract-email-editor p,
.iw-contract-email-editor div {
  margin: 0;
}

.iw-contract-email-editor br {
  line-height: 1.35;
}

.iw-contract-email-editor .iw-email-thanks {
  margin: 0;
}

.iw-contract-email-editor:focus {
  outline: 3px solid rgba(59, 130, 246, 0.18);
  border-color: #94bdf8;
}

.iw-contract-email-actions {
  margin-top: 0.85rem;
}
