body[data-nv-space="service_client"] {
  --nv-accent: #cb2d8c;
  --nv-accent-soft: #fff0f8;
  --nv-space-color: #cb2d8c;
  --nv-space-rgb: 37, 99, 235;
  --loader-mark-bg: #cb2d8c;
  --loader-mark-border: #e9a7d0;
}
.sc-main {
  padding-top: 36px;
  padding-bottom: 48px;
  color: #1e293b;
}
.sc-heading,
.sc-title,
.sc-toolbar,
.sc-actions,
.sc-dialog-heading,
.sc-form-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sc-heading,
.sc-toolbar,
.sc-dialog-heading {
  justify-content: space-between;
}
.sc-heading h1 {
  font-size: 32px;
  margin: 0 0 5px;
}
.sc-heading p {
  margin: 0;
  color: #64748b;
}
.sc-heading .sc-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #cb2d8c;
  margin-bottom: 5px;
}
.sc-monogram {
  display: grid;
  place-items: center;
  background: #cb2d8c;
  color: white;
  width: 70px;
  height: 70px;
  border-radius: 20px;
  font-size: 32px;
  font-weight: 800;
  flex-shrink: 0;
}
.sc-button {
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: white;
  padding: 10px 16px;
  color: #334155;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.sc-button:hover {
  border-color: #cb2d8c;
  color: #a22172;
}
.sc-button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.sc-primary {
  background: #cb2d8c;
  color: white;
  border-color: #cb2d8c;
}
.sc-primary:hover {
  background: #a22172;
  color: white;
}
.sc-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.sc-kpi {
  padding: 18px 22px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: white;
}
.sc-kpi span {
  display: block;
  font-size: 12px;
  color: #64748b;
}
.sc-kpi strong {
  display: block;
  font-size: 29px;
  color: #a22172;
  margin-top: 4px;
}
.sc-toolbar {
  margin-bottom: 18px;
}
.sc-tabs {
  display: flex;
  gap: 4px;
  background: #eaf0f8;
  padding: 5px;
  border-radius: 12px;
}
.sc-tabs button {
  font: inherit;
  padding: 10px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}
.sc-tabs [aria-selected="true"] {
  background: white;
  color: #a22172;
  font-weight: 800;
  box-shadow: 0 2px 6px #0f172a0a;
}
.sc-filters {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.sc-filters label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: #64748b;
}
.sc-filters label:first-child {
  flex: 1;
  min-width: 180px;
}
.sc-filters input,
.sc-filters select,
.sc-form-grid input,
.sc-form-grid select,
.sc-form-grid textarea {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  color: #1e293b;
  border: 1px solid #dbe3ef;
  background: white;
  border-radius: 9px;
  padding: 10px 12px;
  min-height: 42px;
}
.sc-filters .sc-check,
.sc-form-grid .sc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}
.sc-check input {
  width: 18px;
  min-height: 18px;
  flex-shrink: 0;
}
.sc-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.sc-column {
  background: #edf2f8;
  border-radius: 16px;
  padding: 12px;
  min-height: 220px;
}
.sc-column h2 {
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  margin: 5px 5px 14px;
}
.sc-column h2 span {
  background: white;
  padding: 2px 7px;
  border-radius: 6px;
  color: #64748b;
}
.sc-ticket {
  display: block;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 3px 8px #1e293b04;
  color: #334155;
}
.sc-ticket:hover {
  border-color: #e9a7d0;
}
.sc-ticket h3 {
  font-size: 14px;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.sc-ticket p {
  font-size: 12px;
  margin: 6px 0;
  color: #64748b;
}
.sc-ticket-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
}
.sc-badge {
  display: inline-block;
  border-radius: 5px;
  padding: 3px 7px;
  background: #fff0f8;
  color: #cb2d8c;
  font-size: 11px;
}
.sc-badge[data-priority="urgente"],
.sc-late {
  color: #be123c;
  background: #fff1f2;
}
.sc-badge[data-priority="haute"] {
  color: #b45309;
  background: #fffbeb;
}
.sc-empty {
  padding: 22px;
  color: #64748b;
  text-align: center;
  font-size: 13px;
}
.sc-table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}
.sc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.sc-table th {
  padding: 13px 16px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
}
.sc-table td {
  padding: 14px 16px;
  border-top: 1px solid #edf2f7;
  vertical-align: top;
}
.sc-table button {
  font: inherit;
  color: #a22172;
  font-weight: 700;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}
.sc-table small {
  display: block;
  margin-top: 4px;
  color: #64748b;
}
.sc-status {
  padding: 12px 16px;
  border: 1px solid #efc0dc;
  background: #fff0f8;
  color: #a22172;
  border-radius: 10px;
}
.sc-status[data-tone="error"],
#scFormError {
  color: #be123c;
  border-color: #fecdd3;
  background: #fff1f2;
}
.sc-mail-status {
  font-size: 12px;
  color: #64748b;
  margin-top: 24px;
}
.sc-dialog {
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  padding: 24px;
  width: min(660px, calc(100vw - 36px));
  max-height: 90vh;
  box-sizing: border-box;
  color: #1e293b;
  background: white;
}
.sc-dialog::backdrop {
  background: #0f172a66;
  backdrop-filter: blur(3px);
}
.sc-detail-dialog {
  width: min(1100px, calc(100vw - 36px));
}
.sc-dialog-heading {
  position: sticky;
  top: -24px;
  background: white;
  z-index: 1;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf2f7;
  margin-bottom: 20px;
}
.sc-dialog-heading h2 {
  margin: 0;
  font-size: 21px;
  overflow-wrap: anywhere;
}
.sc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.sc-form-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.sc-form-grid .sc-wide {
  grid-column: 1/-1;
}
.sc-form-grid textarea {
  resize: vertical;
  min-height: 92px;
}
.sc-form-grid .sc-help {
  font-weight: 400;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}
.sc-form-footer {
  justify-content: end;
  margin-top: 20px;
}
.sc-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.sc-detail-actions button {
  font-size: 12px;
  padding: 9px 12px;
}
.sc-client-contact {
  color: #64748b;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sc-section {
  border-top: 1px solid #edf2f7;
  padding-top: 20px;
  margin-top: 22px;
}
.sc-section h3 {
  font-size: 15px;
  margin: 0 0 14px;
}
.sc-historical-links {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #efc0dc;
  border-radius: 12px;
  background: #fff0f8;
}
.sc-historical-links h4 {
  margin: 0 0 6px;
  color: #1e40af;
}
.sc-historical-links .sc-help {
  margin: 0 0 12px;
}
.sc-historical-link,
.sc-ticket-historical {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.sc-historical-link + .sc-historical-link {
  border-top: 1px solid #efc0dc;
  margin-top: 12px;
  padding-top: 12px;
}
.sc-ticket-historical {
  padding: 10px 12px;
  border-left: 3px solid #cb2d8c;
  background: #fff0f8;
  border-radius: 6px;
}
.sc-sale {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.sc-sale-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.sc-sale p {
  font-size: 12px;
  color: #64748b;
  line-height: 1.7;
  margin: 8px 0;
}
.sc-history {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sc-history li {
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.sc-history small {
  display: block;
  font-size: 11px;
  color: #64748b;
}
.sc-history p {
  white-space: pre-wrap;
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.sc-ticket-detail {
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  margin-bottom: 12px;
}
.sc-ticket-detail h4 {
  margin: 0 0 10px;
}
.sc-ticket-detail > p {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
}
.sc-stock-preview {
  padding: 12px;
  background: #fff0f8;
  border-radius: 10px;
  margin: 0;
  color: #a22172;
}
.sc-stock-preview[data-negative="true"] {
  background: #fff7ed;
  color: #c2410c;
}
.sc-dialog [hidden],
.sc-main [hidden] {
  display: none !important;
}
:is(
  .sc-button,
  .sc-ticket,
  .sc-tabs button,
  input,
  select,
  textarea
):focus-visible {
  outline: 3px solid #e9a7d0;
  outline-offset: 2px;
}
@media (max-width: 1000px) {
  .sc-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sc-toolbar {
    align-items: start;
    flex-wrap: wrap;
  }
  .sc-heading h1 {
    font-size: 27px;
  }
}
@media (max-width: 600px) {
  .sc-main {
    padding-top: 22px;
  }
  .sc-heading {
    align-items: start;
  }
  .sc-monogram {
    width: 48px;
    height: 48px;
    font-size: 25px;
    border-radius: 14px;
  }
  .sc-title {
    gap: 10px;
  }
  .sc-heading h1 {
    font-size: 23px;
  }
  .sc-heading p {
    font-size: 12px;
  }
  .sc-heading > button {
    padding: 8px;
    font-size: 11px;
  }
  .sc-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
  }
  .sc-kpi {
    padding: 14px;
  }
  .sc-tabs {
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
  }
  .sc-tabs button {
    font-size: 12px;
    padding: 9px;
  }
  .sc-actions {
    gap: 8px;
  }
  .sc-actions button {
    font-size: 12px;
  }
  .sc-board {
    grid-template-columns: 1fr;
  }
  .sc-column {
    min-height: 120px;
  }
  .sc-form-grid {
    grid-template-columns: 1fr;
  }
  .sc-dialog {
    padding: 18px;
  }
  .sc-dialog-heading {
    top: -18px;
  }
  .sc-filters select {
    max-width: 155px;
  }
  .sc-table td,
  .sc-table th {
    padding: 12px;
    white-space: nowrap;
  }
}

/* Conversation client : lecture rétroactive des mails, réponses et notes. */
#scDetail.sc-detail-dialog {
  width: min(1220px, calc(100vw - 28px));
}
.sc-ticket-detail {
  overflow: hidden;
  padding: 0;
  border: 1px solid #dbe6f3;
  border-radius: 20px;
  background: #f7faff;
  box-shadow: 0 12px 34px rgba(30, 64, 175, 0.07);
}
.sc-ticket-detail + .sc-ticket-detail {
  margin-top: 22px;
}
.sc-ticket-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.sc-ticket-detail-title {
  min-width: 0;
}
.sc-ticket-detail-title > span {
  display: block;
  margin-bottom: 4px;
  color: #cb2d8c;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
}
.sc-ticket-detail-title h4 {
  margin: 0 0 10px;
  color: #17243a;
  font-size: 20px;
  line-height: 1.25;
}
.sc-ticket-detail-title > div {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.sc-ticket-detail-title .sc-ticket-duration {
  width: auto;
  margin: 0;
  padding: 4px 9px;
  border-radius: 999px;
}
.sc-ticket-tools {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}
.sc-ticket-tools .sc-button {
  padding: 8px 11px;
  font-size: 11px;
}
.sc-ticket-context {
  padding: 18px 24px;
  background: #fff;
}
.sc-ticket-context > p {
  margin: 0 0 15px;
  color: #334155;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.sc-ticket-context dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.sc-ticket-context dl > div {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
}
.sc-ticket-context dt {
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sc-ticket-context dd {
  margin: 3px 0 0;
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.sc-ticket-summary {
  margin: 0 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.sc-ticket-summary summary {
  padding: 10px 12px;
  color: #334155;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}
.sc-ticket-summary p {
  margin: 0;
  padding: 0 12px 12px;
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.sc-conversation {
  padding: 20px 24px 24px;
  background: linear-gradient(180deg, #f4f8fd 0%, #eef4fb 100%);
  border-top: 1px solid #dbe6f3;
}
.sc-conversation-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.sc-conversation-heading > div {
  display: grid;
  gap: 2px;
}
.sc-conversation-heading span {
  color: #cb2d8c;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
}
.sc-conversation-heading strong {
  color: #17243a;
  font-size: 16px;
}
.sc-conversation-heading small {
  color: #64748b;
  font-size: 10px;
}
.sc-conversation-thread {
  display: grid;
  gap: 14px;
  min-height: 110px;
  padding: 18px;
  border: 1px solid #dbe6f3;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}
.sc-message {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}
.sc-message[data-lane="outgoing"] {
  flex-direction: row-reverse;
}
.sc-message[data-lane="internal"] {
  justify-content: center;
}
.sc-message-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  background: #f9d9ed;
  color: #a22172;
  font-size: 10px;
  font-weight: 850;
}
.sc-message[data-lane="outgoing"] .sc-message-avatar {
  background: #cb2d8c;
  color: #fff;
}
.sc-message[data-lane="internal"] .sc-message-avatar {
  display: none;
}
.sc-message-content {
  display: grid;
  gap: 5px;
  width: fit-content;
  max-width: min(76%, 680px);
}
.sc-message[data-lane="outgoing"] .sc-message-content {
  justify-items: end;
}
.sc-message[data-lane="internal"] .sc-message-content {
  width: min(82%, 720px);
  max-width: 82%;
}
.sc-message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 4px;
  color: #64748b;
  font-size: 9px;
}
.sc-message-meta strong {
  color: #334155;
  font-size: 10px;
}
.sc-message[data-lane="outgoing"] .sc-message-meta {
  flex-direction: row-reverse;
}
.sc-message[data-lane="internal"] .sc-message-meta {
  justify-content: center;
}
.sc-message-bubble {
  min-width: 150px;
  padding: 12px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 6px 16px 16px 16px;
  background: #fff;
  color: #1e293b;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.sc-message[data-lane="outgoing"] .sc-message-bubble {
  border-color: #cb2d8c;
  border-radius: 16px 6px 16px 16px;
  background: #cb2d8c;
  color: #fff;
}
.sc-message[data-lane="internal"] .sc-message-bubble {
  width: 100%;
  box-sizing: border-box;
  border-color: #fde68a;
  border-radius: 12px;
  background: #fffbeb;
  color: #713f12;
  text-align: center;
  box-shadow: none;
}
.sc-message-subject {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}
.sc-message-bubble p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sc-message-route {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 9px;
  overflow-wrap: anywhere;
}
.sc-message-route b {
  font-size: 12px;
}
.sc-message-route em {
  width: 100%;
  font-style: normal;
}
.sc-message[data-lane="outgoing"] .sc-message-route {
  color: #f9d9ed;
}
.sc-message-details {
  margin-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, .28);
}
.sc-message-details summary {
  padding-top: 7px;
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.sc-message[data-lane="outgoing"] .sc-message-details summary {
  color: #f9d9ed;
}
.sc-message-details > p {
  max-height: 260px;
  margin-top: 8px;
  padding: 9px;
  overflow: auto;
  border-radius: 8px;
  background: rgba(15, 23, 42, .04);
  font-size: 10px;
  line-height: 1.45;
}
.sc-message[data-lane="outgoing"] .sc-message-details > p {
  background: rgba(255, 255, 255, .1);
}
.sc-conversation-archive {
  border: 1px dashed #cbd5e1;
  border-radius: 11px;
  background: rgba(255, 255, 255, .6);
}
.sc-conversation-archive > summary {
  padding: 10px 12px;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  cursor: pointer;
}
.sc-conversation-archive > div {
  display: grid;
  gap: 12px;
  padding: 4px 12px 12px;
}
.sc-message-draft {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff;
  color: #a22172;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}
.sc-conversation-empty {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 80px;
  color: #64748b;
  text-align: center;
  font-size: 12px;
}
.sc-conversation-empty strong {
  color: #334155;
}
.sc-conversation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.sc-conversation-actions .sc-button {
  padding: 9px 12px;
  font-size: 11px;
}
.sc-conversation-actions .sc-conversation-reply {
  border-color: #cb2d8c;
  background: #cb2d8c;
  color: #fff;
}
.sc-conversation-actions .sc-conversation-reply:hover {
  background: #a22172;
  color: #fff;
}

@media (max-width: 760px) {
  .sc-ticket-detail-header,
  .sc-conversation-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .sc-ticket-tools {
    justify-content: flex-start;
  }
  .sc-ticket-context dl {
    grid-template-columns: 1fr;
  }
  .sc-ticket-detail-header,
  .sc-ticket-context,
  .sc-conversation {
    padding-left: 15px;
    padding-right: 15px;
  }
  .sc-conversation-thread {
    padding: 12px;
  }
  .sc-message-content,
  .sc-message[data-lane="internal"] .sc-message-content {
    max-width: calc(100% - 42px);
  }
  .sc-message[data-lane="internal"] .sc-message-content {
    width: 100%;
  }
  .sc-conversation-actions .sc-button {
    flex: 1 1 100%;
  }
}

.system-loading-screen[data-system="service_client"] {
  --loader-mark-bg: #cb2d8c;
  --loader-mark-ink: #fff;
  --loader-mark-border: #e9a7d0;
}
.system-loading-screen[data-system="service_client"]
  .system-loading-title::before {
  content: "Chargement du Service Client";
}

.sc-mail-connection h2 {
  font-size: 1.1rem;
}
.sc-mail-field {
  display: grid;
  gap: 0.4rem;
}
.sc-mail-field input {
  width: 100%;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--sc-border, #dbe5ef);
  border-radius: 0.65rem;
}

/* These dialogs contain their own content, so they need an opaque surface
   despite the shared transparent-dialog rule used by other modules. */
body[data-nv-space="service_client"] .sc-dialog {
  --nv-ink: #0f172a;
  --nv-muted: #475569;
  color-scheme: light;
  color: #0f172a;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  font-family: var(--nv-font);
  font-size: 15px;
  line-height: 1.6;
  overflow-y: auto;
  overscroll-behavior: contain;
}
body[data-nv-space="service_client"] .sc-dialog::backdrop {
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(4px);
}
.sc-dialog .sc-dialog-heading {
  background: #ffffff;
  align-items: flex-start;
  border-bottom-color: #cbd5e1;
  z-index: 3;
}
.sc-dialog .sc-dialog-heading h2 {
  color: #0f172a;
  font-size: 23px;
  line-height: 1.35;
  padding-top: 8px;
}
.sc-dialog .sc-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.sc-dialog :is(.sc-form-grid label, .sc-mail-field) {
  color: #334155;
  font-size: 14px;
  min-width: 0;
  gap: 8px;
}
.sc-dialog label > span {
  color: #334155 !important;
  font-size: 14px !important;
  line-height: 1.5;
}
.sc-dialog
  :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  color: #0f172a !important;
  background: #ffffff !important;
  border: 1px solid #7a8ca5 !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
  min-width: 0;
}
.sc-dialog :is(input, textarea)::placeholder {
  color: #64748b !important;
  opacity: 1;
}
.sc-dialog
  :is(
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea
  ):focus {
  border-color: #cb2d8c !important;
  box-shadow: 0 0 0 3px #f9d9ed !important;
}
.sc-dialog :is(input, select, textarea):disabled,
.sc-dialog input[readonly] {
  color: #475569 !important;
  background: #f1f5f9 !important;
  opacity: 1;
}
.sc-dialog
  :is(
    .sc-help,
    .sc-mail-status,
    .sc-client-contact,
    .sc-sale p,
    .sc-history small,
    .sc-empty
  ) {
  color: #475569;
  font-size: 14px;
  line-height: 1.65;
}
.sc-dialog .sc-form-grid .sc-help {
  color: #475569;
}
.sc-dialog .sc-history li,
.sc-dialog .sc-ticket-detail > p {
  font-size: 14px;
  color: #1e293b;
}
.sc-dialog .sc-form-footer {
  position: sticky;
  bottom: -24px;
  padding: 16px 0 4px;
  background: #ffffff;
  border-top: 1px solid #cbd5e1;
  z-index: 2;
  gap: 12px;
}
.sc-dialog .sc-button {
  font-size: 14px;
  min-height: 44px;
}
.sc-dialog :is(.sc-section, .sc-history li) {
  border-color: #e2e8f0;
}
@media (max-width: 600px) {
  .sc-dialog .sc-form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .sc-dialog .sc-dialog-heading h2 {
    font-size: 20px;
  }
  .sc-dialog .sc-form-footer {
    bottom: -18px;
    flex-wrap: wrap;
  }
  .sc-dialog .sc-form-footer .sc-button {
    flex: 1 1 auto;
  }
}

/* Client dossier: a blue identity banner, coloured indicators and readable contact cards. */
.sc-client-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 25px;
  border-radius: 20px;
  background: linear-gradient(120deg, #15477c, #24669a);
  color: #fff;
  margin-bottom: 18px;
}
.sc-client-avatar {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #ffffff24;
  border: 1px solid #ffffff66;
  font-weight: 750;
  font-size: 26px;
}
.sc-client-eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #d9edff;
}
#scDetail .sc-client-hero h3 {
  color: #fff !important;
  font-size: 26px;
  margin: 8px 0;
}
.sc-client-hero p {
  color: #e5f1fc;
  margin: 0;
  line-height: 1.5;
  font-size: 14px;
}
.sc-client-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.sc-client-summary > div {
  background: #edf5ff;
  border: 1px solid #c4d9f2;
  border-radius: 15px;
  padding: 16px;
  color: #193e6c;
  display: grid;
  gap: 5px;
}
.sc-client-summary > div:nth-child(2) {
  background: #e9f8f3;
  border-color: #b7ddce;
  color: #18563e;
}
.sc-client-summary > div:nth-child(3) {
  background: #fff4e5;
  border-color: #edcf9c;
  color: #77490b;
}
.sc-client-summary > div:nth-child(4) {
  background: #f3efff;
  border-color: #d8ccef;
  color: #573a80;
}
.sc-client-summary strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}
.sc-client-summary span {
  font-size: 13px;
  font-weight: 600;
}
.sc-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sc-contact-grid > div {
  border: 1px solid #d0dceb;
  border-radius: 14px;
  padding: 16px;
  background: #f7faff;
}
.sc-contact-grid span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #516982;
  margin-bottom: 8px;
}
.sc-contact-grid strong {
  font-size: 15px;
  color: #163855;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.sc-client-note {
  background: #fffaec;
  border-left: 4px solid #d9aa36;
  border-radius: 10px;
  padding: 16px;
  color: #5b4618;
  white-space: pre-wrap;
  line-height: 1.6;
}
#scDetail .sc-section > h3 {
  color: #194e7d;
  border-left: 4px solid #4386c2;
  padding-left: 12px;
}
#scDetail .sc-section:nth-of-type(2) > h3 {
  border-color: #32a58c;
}
#scDetail .sc-section:nth-of-type(4) > h3 {
  border-color: #9170c0;
}
#scDetail .sc-section:nth-of-type(5) > h3 {
  border-color: #dc9562;
}
.sc-ticket-duration {
  display: block;
  margin-top: 12px;
  padding: 8px 11px;
  background: #eaf3ff;
  border-radius: 8px;
  color: #234f7c;
  font-weight: 650;
  font-size: 12px;
}
.sc-button-share {
  background: #eaf6f2;
  border-color: #90c5b2;
  color: #1b5a45;
}
@media (max-width: 600px) {
  .sc-client-hero {
    padding: 18px;
    gap: 12px;
    align-items: flex-start;
  }
  .sc-client-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 19px;
  }
  .sc-client-hero h3 {
    font-size: 21px;
    overflow-wrap: anywhere;
  }
  .sc-client-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sc-contact-grid {
    grid-template-columns: 1fr;
  }
}

.sc-client-identity {
  flex: 1;
  min-width: 0;
}
.sc-client-rating {
  flex: 0 0 260px;
  display: grid;
  gap: 7px;
  padding: 17px;
  border-radius: 16px;
  background: #ffffff18;
  border: 1px solid #ffffff55;
  color: #fff;
}
.sc-rating-label {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #e7f3ff;
}
.sc-rating-score {
  color: #ffdf8a;
  font-size: 27px;
}
.sc-rating-score small {
  color: #fff1c9;
  font-size: 15px;
}
.sc-rating-criteria,
.sc-rating-date {
  color: #f0f7ff;
  font-size: 12px;
  line-height: 1.5;
}
#scDetail .sc-client-rating .sc-button {
  background: #ffdf8a;
  border-color: #ffe9b1;
  color: #573c0d;
  margin-top: 5px;
}
@media (max-width: 800px) {
  .sc-client-hero {
    flex-wrap: wrap;
  }
  .sc-client-rating {
    flex: 1 1 100%;
  }
}

.sc-payment-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid;
}
.sc-payment-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.sc-payment-badge[data-payment-state="paid"] {
  background: #e3f7eb;
  color: #176039;
  border-color: #95ceb0;
}
.sc-payment-badge[data-payment-state="partial"] {
  background: #fff1d9;
  color: #805007;
  border-color: #deb66c;
}
.sc-payment-badge[data-payment-state="unpaid"] {
  background: #ffebeb;
  color: #a2222f;
  border-color: #e2a0a7;
}
.sc-payment-badge[data-payment-state="none"] {
  background: #edf1f6;
  color: #52657a;
  border-color: #c3cedc;
}
.sc-sale-heading {
  flex-wrap: wrap;
}

.sc-mail-auto-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #a9d8c4;
  background: #e8f8f1;
  color: #185942;
  font-size: 13px;
  font-weight: 650;
}
.sc-mail-auto-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.sc-mail-auto-state[data-state="off"] {
  border-color: #e0bd76;
  background: #fff4df;
  color: #7b500b;
}
.sc-mail-settings-grid {
  margin: 14px 0;
}
.sc-mail-auto-check {
  align-self: end;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #b9c9db;
  border-radius: 10px;
  background: #f5f9fd;
}
.sc-mail-credentials {
  margin-top: 18px;
  border: 1px solid #b9c9db;
  border-radius: 14px;
  background: #f7faff;
  padding: 0 16px 16px;
}
.sc-mail-credentials summary {
  cursor: pointer;
  padding: 15px 0;
  color: #194e7d;
  font-weight: 700;
}
.sc-mail-credentials[open] summary {
  border-bottom: 1px solid #d5e0ec;
  margin-bottom: 14px;
}

/* Guided client and ticket creation. */
.sc-dialog[data-form-kind="client"],
.sc-dialog[data-form-kind="ticket"] {
  width: min(820px, calc(100vw - 36px));
  padding: 0;
  overflow: hidden;
}
.sc-dialog[data-form-kind="client"] #scForm,
.sc-dialog[data-form-kind="ticket"] #scForm {
  max-height: min(88vh, 900px);
  overflow-y: auto;
  padding: 26px 28px 0;
}
.sc-dialog[data-form-kind="client"] .sc-dialog-heading,
.sc-dialog[data-form-kind="ticket"] .sc-dialog-heading {
  top: -26px;
  margin: -26px -28px 22px;
  padding: 24px 28px 18px;
  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.05);
}
.sc-dialog-heading > div:first-child {
  min-width: 0;
}
.sc-form-intro {
  margin: 5px 0 0;
  color: #526178;
  font-size: 14px;
  line-height: 1.55;
}
.sc-dialog[data-form-kind="client"] #scFormFields,
.sc-dialog[data-form-kind="ticket"] #scFormFields {
  display: block;
}
.sc-form-card {
  margin-bottom: 16px;
  padding: 19px;
  border: 1px solid #dbe5f2;
  border-radius: 16px;
  background: #fbfdff;
}
.sc-form-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.sc-form-step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #cb2d8c, #15529a);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.2);
}
.sc-form-card-heading h3 {
  margin: 1px 0 2px;
  color: #17243a;
  font-size: 16px;
  line-height: 1.35;
}
.sc-form-card-heading p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}
.sc-form-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.sc-form-card-grid .sc-wide {
  grid-column: 1 / -1;
}
.sc-friendly-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}
.sc-friendly-field > span:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sc-required {
  color: #a22172;
  background: #eaf2ff;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sc-form-card-grid textarea {
  min-height: 116px;
}
.sc-client-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #f5c46c;
  border-radius: 12px;
  background: #fff8e6;
  color: #78350f;
}
.sc-client-match[hidden] {
  display: none;
}
.sc-client-match div {
  display: grid;
  gap: 2px;
}
.sc-client-match strong,
.sc-client-match span {
  color: #78350f !important;
  font-size: 13px !important;
}
.sc-client-match .sc-button {
  min-height: 38px;
  flex-shrink: 0;
  border-color: #d69b2d;
  color: #78350f;
  background: #ffffff;
}
.sc-missing-client {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #efc0dc;
  border-radius: 12px;
  background: #fff0f8;
}
.sc-missing-client div {
  display: grid;
  gap: 2px;
}
.sc-missing-client strong {
  color: #17243a;
  font-size: 13px;
}
.sc-missing-client span {
  color: #526178;
  font-size: 12px;
}
.sc-missing-client .sc-button {
  min-height: 38px;
  flex-shrink: 0;
}
.sc-form-more {
  margin-top: 2px;
  border: 1px dashed #b9c7d9;
  border-radius: 14px;
  background: #ffffff;
}
.sc-form-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  color: #334155;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
}
.sc-form-more summary span {
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 700;
  text-transform: uppercase;
}
.sc-form-more[open] summary {
  border-bottom: 1px solid #e2e8f0;
}
.sc-form-more .sc-form-card-grid {
  padding: 17px;
}
.sc-selected-client {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #bcd1ed;
  border-radius: 13px;
  background: #f0f6ff;
}
.sc-selected-client-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  color: #ffffff !important;
  background: #cb2d8c;
  font-size: 15px !important;
  font-weight: 800;
}
.sc-selected-client div {
  display: grid;
}
.sc-selected-client strong {
  color: #17243a;
  font-size: 14px;
}
.sc-selected-client small {
  color: #526178;
  overflow-wrap: anywhere;
}
.sc-new-ticket-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #efc0dc;
  border-radius: 12px;
  background: #fff0f8;
}
.sc-new-ticket-state > span {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #cb2d8c;
  box-shadow: 0 0 0 4px #f9d9ed;
}
.sc-new-ticket-state div {
  display: grid;
  gap: 1px;
}
.sc-new-ticket-state strong {
  color: #1e3a8a;
  font-size: 13px;
}
.sc-new-ticket-state small {
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}
#scTicketSearchHint[data-tone="warning"] {
  color: #a13f12;
  font-weight: 700;
}
.sc-dialog[data-form-kind="client"] .sc-form-footer,
.sc-dialog[data-form-kind="ticket"] .sc-form-footer {
  bottom: 0;
  margin: 0 -28px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(8px);
}

@media (max-width: 600px) {
  .sc-dialog[data-form-kind="client"],
  .sc-dialog[data-form-kind="ticket"] {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
  }
  .sc-dialog[data-form-kind="client"] #scForm,
  .sc-dialog[data-form-kind="ticket"] #scForm {
    max-height: calc(100vh - 18px);
    padding: 20px 16px 0;
  }
  .sc-dialog[data-form-kind="client"] .sc-dialog-heading,
  .sc-dialog[data-form-kind="ticket"] .sc-dialog-heading {
    top: -20px;
    margin: -20px -16px 16px;
    padding: 18px 16px 14px;
  }
  .sc-form-card {
    padding: 15px;
    border-radius: 14px;
  }
  .sc-form-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sc-client-match {
    align-items: stretch;
    flex-direction: column;
  }
  .sc-client-match .sc-button {
    width: 100%;
  }
  .sc-missing-client {
    align-items: stretch;
    flex-direction: column;
  }
  .sc-missing-client .sc-button {
    width: 100%;
  }
  .sc-dialog[data-form-kind="client"] .sc-form-footer,
  .sc-dialog[data-form-kind="ticket"] .sc-form-footer {
    margin: 0 -16px;
    padding: 13px 16px;
  }
}
