
trix-editor {
  border: 1px solid #bbb;
  border-radius: 3px;
  margin: 0;
  padding: 0.4em 0.6em;
  min-height: 5em;
  outline: none;
}

trix-toolbar * {
  box-sizing: border-box;
}
trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  overflow-x: auto;
}
trix-toolbar .trix-button-group {
  display: flex;
  margin-bottom: 10px;
  border: 1px solid #bbb;
  border-top-color: #ccc;
  border-bottom-color: #888;
  border-radius: 3px;
}
trix-toolbar .trix-button-group:not(:first-child) {
  margin-left: 1.5vw;
}
@media (max-width: 768px) {
  trix-toolbar .trix-button-group:not(:first-child) {
    margin-left: 0;
  }
}
trix-toolbar .trix-button-group-spacer {
  flex-grow: 1;
}
@media (max-width: 768px) {
  trix-toolbar .trix-button-group-spacer {
    display: none;
  }
}
trix-toolbar .trix-button {
  position: relative;
  float: left;
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.75em;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 0.5em;
  margin: 0;
  outline: none;
  border: none;
  border-bottom: 1px solid #ddd;
  border-radius: 0;
  background: transparent;
}
trix-toolbar .trix-button:not(:first-child) {
  border-left: 1px solid #ccc;
}
trix-toolbar .trix-button.trix-active {
  background: #cbeefa;
  color: rgb(0, 0, 0);
}
trix-toolbar .trix-button:not(:disabled) {
  cursor: pointer;
}
trix-toolbar .trix-button:disabled {
  color: rgba(0, 0, 0, 0.125);
}
@media (max-width: 768px) {
  trix-toolbar .trix-button {
    letter-spacing: -0.01em;
    padding: 0 0.3em;
  }
}
trix-toolbar .trix-button--icon {
  font-size: inherit;
  width: 2.6em;
  height: 1.6em;
  max-width: calc(0.8em + 4vw);
  text-indent: -9999px;
}
@media (max-width: 768px) {
  trix-toolbar .trix-button--icon {
    height: 2em;
    max-width: calc(0.8em + 3.5vw);
  }
}
trix-toolbar .trix-button--icon::before {
  display: inline-block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0.6;
  content: "";
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}
@media (max-width: 768px) {
  trix-toolbar .trix-button--icon::before {
    right: 6%;
    left: 6%;
  }
}
trix-toolbar .trix-button--icon.trix-active::before {
  opacity: 1;
}
trix-toolbar .trix-button--icon:disabled::before {
  opacity: 0.125;
}
trix-toolbar .trix-button--icon-attach::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.5%2018V7.5c0-2.25%203-2.25%203%200V18c0%204.125-6%204.125-6%200V7.5c0-6.375%209-6.375%209%200V18%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
  top: 8%;
  bottom: 4%;
}
trix-toolbar .trix-button--icon-bold::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.522%2019.242a.5.5%200%200%201-.5-.5V5.35a.5.5%200%200%201%20.5-.5h5.783c1.347%200%202.46.345%203.24.982.783.64%201.216%201.562%201.216%202.683%200%201.13-.587%202.129-1.476%202.71a.35.35%200%200%200%20.049.613c1.259.56%202.101%201.742%202.101%203.22%200%201.282-.483%202.334-1.363%203.063-.876.726-2.132%201.12-3.66%201.12h-5.89ZM9.27%207.347v3.362h1.97c.766%200%201.347-.17%201.733-.464.38-.291.587-.716.587-1.27%200-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0%205.606v3.791h2.389c.832%200%201.448-.177%201.853-.497.399-.315.614-.786.614-1.423%200-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-italic::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9%205h6.5v2h-2.23l-2.31%2010H13v2H6v-2h2.461l2.306-10H9V5Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-link::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.948%205.258a4.337%204.337%200%200%200-6.108%200L11.217%206.87a.993.993%200%200%200%200%201.41c.392.39%201.027.39%201.418%200l1.623-1.613a2.323%202.323%200%200%201%203.271%200%202.29%202.29%200%200%201%200%203.251l-2.393%202.38a3.021%203.021%200%200%201-4.255%200l-.05-.049a1.007%201.007%200%200%200-1.418%200%20.993.993%200%200%200%200%201.41l.05.049a5.036%205.036%200%200%200%207.091%200l2.394-2.38a4.275%204.275%200%200%200%200-6.072Zm-13.683%2013.6a4.337%204.337%200%200%200%206.108%200l1.262-1.255a.993.993%200%200%200%200-1.41%201.007%201.007%200%200%200-1.418%200L9.954%2017.45a2.323%202.323%200%200%201-3.27%200%202.29%202.29%200%200%201%200-3.251l2.344-2.331a2.579%202.579%200%200%201%203.631%200c.392.39%201.027.39%201.419%200a.993.993%200%200%200%200-1.41%204.593%204.593%200%200%200-6.468%200l-2.345%202.33a4.275%204.275%200%200%200%200%206.072Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-strike::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6%2014.986c.088%202.647%202.246%204.258%205.635%204.258%203.496%200%205.713-1.728%205.713-4.463%200-.275-.02-.536-.062-.781h-3.461c.398.293.573.654.573%201.123%200%201.035-1.074%201.787-2.646%201.787-1.563%200-2.773-.762-2.91-1.924H6ZM6.432%2010h3.763c-.632-.314-.914-.715-.914-1.273%200-1.045.977-1.739%202.432-1.739%201.475%200%202.52.723%202.617%201.914h2.764c-.05-2.548-2.11-4.238-5.39-4.238-3.145%200-5.392%201.719-5.392%204.316%200%20.363.04.703.12%201.02ZM4%2011a1%201%200%201%200%200%202h15a1%201%200%201%200%200-2H4Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-quote::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.581%208.471c.44-.5%201.056-.834%201.758-.995C8.074%207.17%209.201%207.822%2010%208.752c1.354%201.578%201.33%203.555.394%205.277-.941%201.731-2.788%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419%200c.44-.5%201.055-.834%201.758-.995%201.734-.306%202.862.346%203.66%201.276%201.355%201.578%201.33%203.555.395%205.277-.941%201.731-2.789%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.672-2.701c0-.905.283-1.59.72-2.088Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-heading-1::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.5%207.5v-3h-12v3H14v13h3v-13h4.5ZM9%2013.5h3.5v-3h-10v3H6v7h3v-7Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-code::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.293%2011.293a1%201%200%200%200%200%201.414l4%204a1%201%200%201%200%201.414-1.414L5.414%2012l3.293-3.293a1%201%200%200%200-1.414-1.414l-4%204Zm13.414%205.414%204-4a1%201%200%200%200%200-1.414l-4-4a1%201%200%201%200-1.414%201.414L18.586%2012l-3.293%203.293a1%201%200%200%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-bullet-list::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%207.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203ZM8%206a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-2.5-5a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200ZM5%2019.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-number-list::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%204h2v4H4V5H3V4Zm5%202a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-3.5-7H6v1l-1.5%202H6v1H3v-1l1.667-2H3v-1h2.5ZM3%2017v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-undo::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%2014a1%201%200%200%200%201%201h6a1%201%200%201%200%200-2H6.257c2.247-2.764%205.151-3.668%207.579-3.264%202.589.432%204.739%202.356%205.174%205.405a1%201%200%200%200%201.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084%207.25%207.63%208.377%205%2011.39V8a1%201%200%200%200-2%200v6Zm2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-redo::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2014a1%201%200%200%201-1%201h-6a1%201%200%201%201%200-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739%202.356-5.174%205.405a1%201%200%200%201-1.98-.283c.564-3.95%203.415-6.526%206.826-7.095%203.08-.513%206.534.614%209.164%203.626V8a1%201%200%201%201%202%200v6Zm-2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-decrease-nesting-level::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-3.707-5.707a1%201%200%200%200%200%201.414l2%202a1%201%200%201%200%201.414-1.414L4.414%2012l1.293-1.293a1%201%200%200%200-1.414-1.414l-2%202Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-button--icon-increase-nesting-level::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-2.293-2.293%202-2a1%201%200%200%200%200-1.414l-2-2a1%201%200%201%200-1.414%201.414L3.586%2012l-1.293%201.293a1%201%200%201%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}
trix-toolbar .trix-dialogs {
  position: relative;
}
trix-toolbar .trix-dialog {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  font-size: 0.75em;
  padding: 15px 10px;
  background: #fff;
  box-shadow: 0 0.3em 1em #ccc;
  border-top: 2px solid #888;
  border-radius: 5px;
  z-index: 5;
}
trix-toolbar .trix-input--dialog {
  font-size: inherit;
  font-weight: normal;
  padding: 0.5em 0.8em;
  margin: 0 10px 0 0;
  border-radius: 3px;
  border: 1px solid #bbb;
  background-color: #fff;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
trix-toolbar .trix-input--dialog.validate:invalid {
  box-shadow: #F00 0px 0px 1.5px 1px;
}
trix-toolbar .trix-button--dialog {
  font-size: inherit;
  padding: 0.5em;
  border-bottom: none;
}
trix-toolbar .trix-dialog--link {
  max-width: 600px;
}
trix-toolbar .trix-dialog__link-fields {
  display: flex;
  align-items: baseline;
}
trix-toolbar .trix-dialog__link-fields .trix-input {
  flex: 1;
}
trix-toolbar .trix-dialog__link-fields .trix-button-group {
  flex: 0 0 content;
  margin: 0;
}

trix-editor [data-trix-mutable]:not(.attachment__caption-editor) {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

trix-editor [data-trix-mutable] ::-moz-selection, trix-editor [data-trix-mutable]::-moz-selection,
trix-editor [data-trix-cursor-target]::-moz-selection {
  background: none;
}
trix-editor [data-trix-mutable] ::selection, trix-editor [data-trix-mutable]::selection,
trix-editor [data-trix-cursor-target]::selection {
  background: none;
}

trix-editor [data-trix-mutable].attachment__caption-editor:focus::-moz-selection {
  background: highlight;
}
trix-editor [data-trix-mutable].attachment__caption-editor:focus::selection {
  background: highlight;
}

trix-editor [data-trix-mutable].attachment.attachment--file {
  box-shadow: 0 0 0 2px highlight;
  border-color: transparent;
}
trix-editor [data-trix-mutable].attachment img {
  box-shadow: 0 0 0 2px highlight;
}
trix-editor .attachment {
  position: relative;
}
trix-editor .attachment:hover {
  cursor: default;
}
trix-editor .attachment--preview .attachment__caption:hover {
  cursor: text;
}
trix-editor .attachment__progress {
  position: absolute;
  z-index: 1;
  height: 20px;
  top: calc(50% - 10px);
  left: 5%;
  width: 90%;
  opacity: 0.9;
  transition: opacity 200ms ease-in;
}
trix-editor .attachment__progress[value="100"] {
  opacity: 0;
}
trix-editor .attachment__caption-editor {
  display: inline-block;
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
  color: inherit;
  text-align: center;
  vertical-align: top;
  border: none;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
trix-editor .attachment__toolbar {
  position: absolute;
  z-index: 1;
  top: -0.9em;
  left: 0;
  width: 100%;
  text-align: center;
}
trix-editor .trix-button-group {
  display: inline-flex;
}
trix-editor .trix-button {
  position: relative;
  float: left;
  color: #666;
  white-space: nowrap;
  font-size: 80%;
  padding: 0 0.8em;
  margin: 0;
  outline: none;
  border: none;
  border-radius: 0;
  background: transparent;
}
trix-editor .trix-button:not(:first-child) {
  border-left: 1px solid #ccc;
}
trix-editor .trix-button.trix-active {
  background: #cbeefa;
}
trix-editor .trix-button:not(:disabled) {
  cursor: pointer;
}
trix-editor .trix-button--remove {
  text-indent: -9999px;
  display: inline-block;
  padding: 0;
  outline: none;
  width: 1.8em;
  height: 1.8em;
  line-height: 1.8em;
  border-radius: 50%;
  background-color: #fff;
  border: 2px solid highlight;
  box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.25);
}
trix-editor .trix-button--remove::before {
  display: inline-block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0.7;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M19%206.41%2017.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 90%;
}
trix-editor .trix-button--remove:hover {
  border-color: #333;
}
trix-editor .trix-button--remove:hover::before {
  opacity: 1;
}
trix-editor .attachment__metadata-container {
  position: relative;
}
trix-editor .attachment__metadata {
  position: absolute;
  left: 50%;
  top: 2em;
  transform: translate(-50%, 0);
  max-width: 90%;
  padding: 0.1em 0.6em;
  font-size: 0.8em;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
}
trix-editor .attachment__metadata .attachment__name {
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
trix-editor .attachment__metadata .attachment__size {
  margin-left: 0.2em;
  white-space: nowrap;
}

.trix-content {
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}
.trix-content * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.trix-content h1 {
  font-size: 1.2em;
  line-height: 1.2;
}
.trix-content blockquote {
  border: 0 solid #ccc;
  border-left-width: 0.3em;
  margin-left: 0.3em;
  padding-left: 0.6em;
}
.trix-content [dir=rtl] blockquote,
.trix-content blockquote[dir=rtl] {
  border-width: 0;
  border-right-width: 0.3em;
  margin-right: 0.3em;
  padding-right: 0.6em;
}
.trix-content li {
  margin-left: 1em;
}
.trix-content [dir=rtl] li {
  margin-right: 1em;
}
.trix-content pre {
  display: inline-block;
  width: 100%;
  vertical-align: top;
  font-family: monospace;
  font-size: 0.9em;
  padding: 0.5em;
  white-space: pre;
  background-color: #eee;
  overflow-x: auto;
}
.trix-content img {
  max-width: 100%;
  height: auto;
}
.trix-content .attachment {
  display: inline-block;
  position: relative;
  max-width: 100%;
}
.trix-content .attachment a {
  color: inherit;
  text-decoration: none;
}
.trix-content .attachment a:hover, .trix-content .attachment a:visited:hover {
  color: inherit;
}
.trix-content .attachment__caption {
  text-align: center;
}
.trix-content .attachment__caption .attachment__name + .attachment__size::before {
  content: " •";
}
.trix-content .attachment--preview {
  width: 100%;
  text-align: center;
}
.trix-content .attachment--preview .attachment__caption {
  color: #666;
  font-size: 0.9em;
  line-height: 1.2;
}
.trix-content .attachment--file {
  color: #333;
  line-height: 1;
  margin: 0 2px 2px 2px;
  padding: 0.4em 1em;
  border: 1px solid #bbb;
  border-radius: 5px;
}
.trix-content .attachment-gallery {
  display: flex;
  flex-wrap: wrap;
  position: relative;
}
.trix-content .attachment-gallery .attachment {
  flex: 1 0 33%;
  padding: 0 0.5em;
  max-width: 33%;
}
.trix-content .attachment-gallery.attachment-gallery--2 .attachment, .trix-content .attachment-gallery.attachment-gallery--4 .attachment {
  flex-basis: 50%;
  max-width: 50%;
}
/*
 * Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
 * the trix-editor content (whether displayed or under editing). Feel free to incorporate this
 * inclusion directly in any other asset bundle and remove this file.
 *

*/

/*
 * We need to override trix.css’s image gallery styles to accommodate the
 * <action-text-attachment> element we wrap around attachments. Otherwise,
 * images in galleries will be squished by the max-width: 33%; rule.
*/
.trix-content .attachment-gallery > action-text-attachment,
.trix-content .attachment-gallery > .attachment {
  flex: 1 0 33%;
  padding: 0 0.5em;
  max-width: 33%;
}

.trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--2 > .attachment, .trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
  flex-basis: 50%;
  max-width: 50%;
}

.trix-content action-text-attachment .attachment {
  padding: 0 !important;
  max-width: 100% !important;
}
/* ===========================================
   Proflemsa CRM — Modern Admin Dashboard
   Bootstrap 5.3 + Dark Mode + Mobile First
   =========================================== */

/* ── Light theme (default) ────────────────── */
:root,
[data-bs-theme="light"] {
  --crm-bg:              #f0f2f5;
  --crm-surface:         #ffffff;
  --crm-surface-alt:     #f8f9fa;
  --crm-border:          #e2e6ea;
  --crm-border-light:    #f0f2f5;
  --crm-text:            #1a1d23;
  --crm-text-secondary:  #5a6070;
  --crm-text-muted:      #8c919d;
  --crm-accent:          #4f6ef7;
  --crm-accent-hover:    #3b57db;
  --crm-accent-light:    #eef1fe;
  --crm-hover:           #f4f5f7;
  --crm-sidebar-bg:      #ffffff;
  --crm-topbar-bg:       #ffffff;
  --crm-shadow:          0 1px 3px rgba(26, 29, 35, 0.06);
  --crm-shadow-md:       0 4px 14px rgba(26, 29, 35, 0.10);
  --crm-shadow-lg:       0 12px 36px rgba(26, 29, 35, 0.14);
  --crm-kanban-col-bg:   #f4f5f7;
  --crm-trix-toolbar-bg: #f4f5f7;
  --crm-spinner-bg:      rgba(255,255,255,0.85);
  --crm-scroll-thumb:    #c4c9d4;
  --crm-scroll-track:    transparent;

  /* Sidebar */
  --crm-sidebar-width:     260px;
  --crm-sidebar-collapsed: 72px;
  --crm-radius:            14px;
  --crm-radius-sm:         10px;
  --crm-radius-xs:         6px;
}

/* ── Dark theme ──────────────────────────── */
[data-bs-theme="dark"] {
  --crm-bg:              #0f1117;
  --crm-surface:         #1a1d26;
  --crm-surface-alt:     #22252f;
  --crm-border:          #2a2d38;
  --crm-border-light:    #1f222b;
  --crm-text:            #e4e6ec;
  --crm-text-secondary:  #9da2b0;
  --crm-text-muted:      #6b7080;
  --crm-accent:          #6b8aff;
  --crm-accent-hover:    #8aa2ff;
  --crm-accent-light:    rgba(107, 138, 255, 0.12);
  --crm-hover:           #22252f;
  --crm-sidebar-bg:      #1a1d26;
  --crm-topbar-bg:       #1a1d26;
  --crm-shadow:          0 1px 3px rgba(0,0,0,0.25);
  --crm-shadow-md:       0 4px 14px rgba(0,0,0,0.35);
  --crm-shadow-lg:       0 12px 36px rgba(0,0,0,0.45);
  --crm-kanban-col-bg:   #22252f;
  --crm-trix-toolbar-bg: #22252f;
  --crm-spinner-bg:      rgba(15, 17, 23, 0.88);
  --crm-scroll-thumb:    #3a3d48;
  --crm-scroll-track:    transparent;
}

/* ── Bootstrap dark-mode overrides ────────── */
[data-bs-theme="dark"] .card {
  background-color: var(--crm-surface);
  border-color: var(--crm-border);
}
[data-bs-theme="dark"] .form-control {
  background-color: var(--crm-surface-alt);
  border-color: var(--crm-border);
  color: var(--crm-text);
}
[data-bs-theme="dark"] .form-control:focus {
  background-color: var(--crm-surface-alt);
  border-color: var(--crm-accent);
  color: var(--crm-text);
}
[data-bs-theme="dark"] .form-select {
  background-color: var(--crm-surface-alt);
  border-color: var(--crm-border);
  color: var(--crm-text);
}
[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--crm-surface);
  border-color: var(--crm-border);
}
[data-bs-theme="dark"] .dropdown-item:hover {
  background-color: var(--crm-hover);
  color: var(--crm-text);
}
[data-bs-theme="dark"] .dropdown-item {
  color: var(--crm-text-secondary);
}
[data-bs-theme="dark"] .btn-light {
  background-color: var(--crm-surface-alt);
  border-color: var(--crm-border);
  color: var(--crm-text-secondary);
}
[data-bs-theme="dark"] .btn-light:hover {
  background-color: var(--crm-hover);
  color: var(--crm-text);
}
[data-bs-theme="dark"] .list-group-item {
  background-color: transparent;
  border-color: var(--crm-border);
  color: var(--crm-text);
}
[data-bs-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--crm-border);
  --bs-table-color: var(--crm-text);
  --bs-table-striped-bg: var(--crm-surface-alt);
  --bs-table-hover-bg: var(--crm-hover);
}
[data-bs-theme="dark"] .modal-content {
  background-color: var(--crm-surface);
  border-color: var(--crm-border);
}
[data-bs-theme="dark"] .progress {
  background-color: var(--crm-surface-alt);
}
[data-bs-theme="dark"] .offcanvas {
  background-color: var(--crm-surface);
}
[data-bs-theme="dark"] .badge.bg-success-subtle {
  background-color: rgba(25, 135, 84, 0.15) !important;
  color: #5cd6a0 !important;
}
[data-bs-theme="dark"] .badge.bg-danger-subtle {
  background-color: rgba(220, 53, 69, 0.15) !important;
  color: #f58da0 !important;
}

/* ── Base ─────────────────────────────────── */
.admin-body {
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--crm-bg);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--crm-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════
   Sales Cycle Modal — mobile app sheet + Turbo Native
   ═══════════════════════════════════════════ */

.sales-cycle-modal .modal-dialog,
.sales-cycle-modal-dialog {
  margin: 0.75rem auto;
  max-width: min(720px, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
}

.sales-cycle-modal-content {
  background: var(--crm-surface);
  border-radius: var(--crm-radius);
  border: 1px solid var(--crm-border);
  overflow: hidden;
  box-shadow: var(--crm-shadow-lg);
  max-height: calc(100dvh - 1.5rem);
  display: flex;
  flex-direction: column;
}

.sales-cycle-modal-handle {
  flex-shrink: 0;
  width: 2.25rem;
  height: 0.25rem;
  margin: 0.5rem auto 0;
  border-radius: 999px;
  background: var(--crm-border);
}

.sales-cycle-modal-header {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem 0.65rem;
  border-bottom: 1px solid var(--crm-border);
  background: var(--crm-surface);
}

.sales-cycle-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: var(--crm-text-secondary);
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sales-cycle-modal-close:hover,
.sales-cycle-modal-close:focus-visible {
  color: var(--crm-text);
  background: var(--crm-hover);
}

.sales-cycle-modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: var(--crm-text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sales-cycle-modal-header-spacer {
  width: 2.75rem;
}

.sales-cycle-modal-tabs-wrap {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--crm-border);
  background: var(--crm-surface-alt);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.sales-cycle-modal-tabs-wrap::-webkit-scrollbar {
  display: none;
}

.sales-cycle-modal-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: none;
  min-width: min-content;
}

.sales-cycle-modal-tabs .nav-item {
  flex: 0 0 auto;
}

.sales-cycle-modal-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--crm-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sales-cycle-modal-tabs .nav-link:hover {
  color: var(--crm-text);
  background: var(--crm-hover);
}

.sales-cycle-modal-tabs .nav-link.active {
  color: var(--crm-accent);
  background: var(--crm-accent-light);
  border-color: color-mix(in srgb, var(--crm-accent) 25%, transparent);
}

.sales-cycle-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  background: var(--crm-accent-light);
  color: var(--crm-accent);
}

.sales-cycle-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 0.75rem;
  padding-bottom: calc(0.75rem + 4.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--crm-bg);
}

.sales-cycle-modal-panels {
  background: transparent;
}

.sales-cycle-tab-content {
  padding: 0;
}

.sales-cycle-tab-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sales-cycle-tab-stack > .sales-cycle-form-section:last-child {
  margin-bottom: 0;
}

.sales-cycle-tab-placeholder,
.sales-cycle-tab-stack > p.text-muted:only-child {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5.5rem;
  margin: 0;
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--crm-text-muted);
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  box-shadow: var(--crm-shadow);
}

.sales-cycle-tab-empty {
  font-size: 0.88rem;
  color: var(--crm-text-muted);
}

.sales-cycle-tab-empty-state {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--crm-text-muted);
}
.sales-cycle-tab-empty-state i {
  display: block;
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  opacity: 0.35;
}
.sales-cycle-tab-empty-state p {
  margin: 0;
  color: var(--crm-text-secondary);
  font-weight: 600;
}
.sales-cycle-tab-empty-state .small {
  font-weight: 400;
  color: var(--crm-text-muted);
}

.sales-cycle-tab-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sales-cycle-field-hint {
  font-size: 0.78rem;
  color: var(--crm-text-muted);
}

.sales-cycle-inline-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--crm-text-secondary);
}
.sales-cycle-inline-hint i {
  color: var(--crm-accent);
}

.sales-cycle-kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--crm-border-light);
}
.sales-cycle-kv:last-child {
  border-bottom: none;
}
.sales-cycle-kv--total {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--crm-border);
  border-bottom: none;
}
.sales-cycle-kv__label {
  font-size: 0.82rem;
  color: var(--crm-text-muted);
}
.sales-cycle-kv__value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--crm-text);
  text-align: right;
}
.sales-cycle-kv--total .sales-cycle-kv__label,
.sales-cycle-kv--total .sales-cycle-kv__value {
  font-weight: 700;
  color: var(--crm-accent);
}

.sales-cycle-quote-folio {
  font-size: 1rem;
  font-weight: 700;
  color: var(--crm-text);
}
.sales-cycle-quote-meta {
  font-size: 0.82rem;
  color: var(--crm-text-muted);
}
.sales-cycle-quote-notes {
  padding: 0.75rem;
  border-radius: var(--crm-radius-xs);
  background: color-mix(in srgb, var(--crm-bg) 55%, var(--crm-surface));
  border: 1px solid var(--crm-border-light);
  font-size: 0.88rem;
  color: var(--crm-text-secondary);
}
.sales-cycle-quote-table thead th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--crm-text-muted);
  border-bottom-color: var(--crm-border-light);
}
.sales-cycle-quote-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sales-cycle-quote-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--crm-border-light);
  font-size: 0.88rem;
}
.sales-cycle-quote-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.sales-cycle-quote-item:first-child {
  padding-top: 0;
}

.sales-cycle-order-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.5rem 1rem;
  border: 2px dashed color-mix(in srgb, var(--crm-accent) 35%, var(--crm-border));
  border-radius: var(--crm-radius-xs);
  background: color-mix(in srgb, var(--crm-accent) 6%, var(--crm-surface));
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sales-cycle-order-dropzone:hover,
.sales-cycle-order-dropzone:focus-within {
  border-color: var(--crm-accent);
  background: color-mix(in srgb, var(--crm-accent) 10%, var(--crm-surface));
}
.sales-cycle-order-dropzone__icon {
  font-size: 2rem;
  color: var(--crm-accent);
  margin-bottom: 0.25rem;
}
.sales-cycle-order-dropzone__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--crm-text);
}
.sales-cycle-order-dropzone__hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--crm-text-muted);
}

.sales-cycle-order-dropzone--active {
  border-color: var(--crm-accent);
  background: color-mix(in srgb, var(--crm-accent) 12%, var(--crm-surface));
}
.sales-cycle-order-pending {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--crm-border-light);
  border-radius: var(--crm-radius-xs);
  background: color-mix(in srgb, var(--crm-bg) 40%, var(--crm-surface));
}

.sales-cycle-order-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sales-cycle-order-doc {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--crm-border-light);
  border-radius: var(--crm-radius-xs);
  background: color-mix(in srgb, var(--crm-bg) 40%, var(--crm-surface));
}
.sales-cycle-order-doc__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--crm-radius-xs);
  background: color-mix(in srgb, #e63946 12%, var(--crm-surface));
  color: #e63946;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sales-cycle-order-doc__folio {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--crm-text);
}
.sales-cycle-order-doc__meta {
  font-size: 0.75rem;
  color: var(--crm-text-muted);
}
.sales-cycle-order-doc__actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
}
.sales-cycle-order-doc__actions .sales-cycle-btn-action {
  min-height: 2.35rem;
  min-width: 2.35rem;
  padding: 0.35rem 0.5rem;
}

.sales-cycle-invoice-dropzone {
  min-height: 8.5rem;
}
.sales-cycle-invoice-pair-form .sales-cycle-tab-actions {
  display: flex;
  gap: 0.5rem;
}

.sales-cycle-list-card {
  padding: 0.85rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--crm-border-light);
  border-radius: var(--crm-radius-xs);
  background: color-mix(in srgb, var(--crm-bg) 35%, var(--crm-surface));
}
.sales-cycle-list-card:last-child {
  margin-bottom: 0;
}
.sales-cycle-list-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.sales-cycle-list-card__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--crm-text);
}
.sales-cycle-list-card__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #e63946;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sales-cycle-list-card__meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: var(--crm-text-secondary);
}
.sales-cycle-list-card__body {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--crm-text-secondary);
  line-height: 1.45;
}
.sales-cycle-list-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.35rem;
  border-top: 1px solid var(--crm-border-light);
  font-size: 0.75rem;
  color: var(--crm-text-muted);
}

.sales-cycle-modal .note-card {
  border-radius: var(--crm-radius-xs) !important;
  border: 1px solid var(--crm-border-light) !important;
  box-shadow: none !important;
  padding: 0.85rem !important;
  margin-bottom: 0.5rem !important;
}
.sales-cycle-modal .note-card:last-child {
  margin-bottom: 0 !important;
}
.sales-cycle-modal .note-card h5 {
  font-size: 0.92rem !important;
}

.sales-cycle-check {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  padding: 0.35rem 0;
}

.sales-cycle-geo-btn {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  z-index: 5;
  min-height: 2.25rem;
}
.sales-cycle-geo-spinner {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  z-index: 5;
}

/* Legacy tab panel — replaced by tab-stack */
.sales-cycle-tab-panel {
  overflow: visible;
  max-height: none;
}

.sales-cycle-form-section {
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  margin-bottom: 0.75rem;
  overflow: visible;
  box-shadow: var(--crm-shadow);
  position: relative;
  z-index: 0;
}

.sales-cycle-form-section:focus-within {
  z-index: 5;
}

.sales-cycle-search-wrap {
  position: relative;
  z-index: 1;
}

.sales-cycle-search-wrap:focus-within {
  z-index: 10;
}

.sales-cycle-form-section:last-child {
  margin-bottom: 0;
}

.sales-cycle-form-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
  border-bottom: 1px solid var(--crm-border-light);
  background: var(--crm-surface-alt);
}

.sales-cycle-form-section__title i {
  color: var(--crm-accent);
  font-size: 0.85rem;
}

.sales-cycle-form-section__body {
  padding: 1rem;
}

.sales-cycle-form-section__body .crm-field-label {
  display: block;
  margin-bottom: 0.35rem;
}

.sales-cycle-input,
.sales-cycle-modal .form-control.sales-cycle-input,
.sales-cycle-modal .form-select.sales-cycle-input {
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  font-size: 1rem;
  border-radius: var(--crm-radius-xs);
  border: 1px solid var(--crm-border);
  background: var(--crm-surface);
  color: var(--crm-text);
  box-shadow: none;
  touch-action: manipulation;
}

.sales-cycle-input:focus,
.sales-cycle-modal .form-control.sales-cycle-input:focus,
.sales-cycle-modal .form-select.sales-cycle-input:focus {
  border-color: var(--crm-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--crm-accent) 18%, transparent);
}

.sales-cycle-stage-display {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--crm-radius-xs);
  border: 1px solid var(--crm-border);
  background: var(--crm-surface-alt);
  color: var(--crm-text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.sales-cycle-input-group .input-group-text {
  min-height: 2.75rem;
  border-radius: var(--crm-radius-xs) 0 0 var(--crm-radius-xs);
  border-color: var(--crm-border);
  background: var(--crm-surface-alt);
  color: var(--crm-text-muted);
  font-weight: 600;
}

.sales-cycle-input-group .form-control {
  min-height: 2.75rem;
  border-radius: 0 var(--crm-radius-xs) var(--crm-radius-xs) 0;
  border-color: var(--crm-border);
  font-size: 1rem;
}

.sales-cycle-trix,
.sales-cycle-modal .trix-content.sales-cycle-trix {
  min-height: 6rem;
  border-radius: var(--crm-radius-xs);
  border: 1px solid var(--crm-border);
  background: var(--crm-surface);
  box-shadow: none;
}

.crm-search-results,
.sales-cycle-contact-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1070;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 0.25rem;
  border-radius: var(--crm-radius-xs);
  border: 1px solid var(--crm-border);
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow-md);
  -webkit-overflow-scrolling: touch;
}

.crm-search-results .list-group-item,
.sales-cycle-contact-results .list-group-item {
  background-color: var(--crm-surface);
}

.crm-search-results .list-group-item:hover,
.crm-search-results .list-group-item.active,
.sales-cycle-contact-results .list-group-item:hover,
.sales-cycle-contact-results .list-group-item.active {
  background-color: var(--crm-hover);
}

[data-bs-theme="dark"] .crm-search-results .list-group-item,
[data-bs-theme="dark"] .sales-cycle-contact-results .list-group-item {
  background-color: var(--crm-surface);
}

.sales-cycle-contact-display {
  margin-top: 0.5rem;
}

.sales-cycle-new-contact {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--crm-radius-xs);
  border: 1px dashed color-mix(in srgb, var(--crm-accent) 35%, var(--crm-border));
  background: var(--crm-accent-light);
}

.sales-cycle-new-contact__title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--crm-text);
}

.sales-cycle-new-contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sales-cycle-delivery-destinations__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sales-cycle-delivery-destination {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-xs);
  background: var(--crm-surface);
  cursor: pointer;
}

.sales-cycle-delivery-destination:has(input:checked) {
  border-color: color-mix(in srgb, var(--crm-accent) 55%, var(--crm-border));
  background: var(--crm-accent-light);
}

.sales-cycle-delivery-destination .form-check-input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.sales-cycle-delivery-destination__content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.sales-cycle-delivery-destination__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--crm-text);
}

.sales-cycle-delivery-destination__subtitle {
  font-size: 0.78rem;
  color: var(--crm-text-muted);
}

.sales-cycle-delivery-destination__meta {
  font-size: 0.78rem;
  color: var(--crm-text-muted);
  line-height: 1.35;
}

.sales-cycle-delivery-destinations__hint {
  font-size: 0.82rem;
}

.sales-cycle-modal-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 2;
  border-top: 1px solid var(--crm-border);
  background: var(--crm-surface);
  padding: 0.65rem 0.85rem;
  padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  padding-left: calc(0.85rem + env(safe-area-inset-left, 0px));
  padding-right: calc(0.85rem + env(safe-area-inset-right, 0px));
  box-shadow: 0 -4px 24px rgba(26, 29, 35, 0.08);
}

[data-bs-theme="dark"] .sales-cycle-modal-footer {
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

.sales-cycle-modal-footer__inner {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  max-width: 720px;
  margin: 0 auto;
}

.sales-cycle-btn-action {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  font-weight: 600;
  border-radius: var(--crm-radius-xs);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sales-cycle-btn-submit {
  flex: 1 1 auto;
  font-size: 1rem;
}

.sales-cycle-btn-cancel {
  flex: 0 0 auto;
}

.sales-cycles-page {
  min-width: 0;
  max-width: 100%;
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .sales-cycles-page {
    padding-bottom: 0;
  }

  .sales-cycle-modal .modal-dialog,
  .sales-cycle-modal-dialog {
    margin: 1.75rem auto;
    max-width: min(720px, calc(100vw - 3.5rem));
    max-height: calc(100dvh - 3.5rem);
  }

  .sales-cycle-modal-content {
    border-radius: 1.25rem;
    max-height: calc(100dvh - 3.5rem);
  }

  .sales-cycle-modal-body {
    padding: 1rem 1.25rem;
    padding-bottom: calc(1rem + 4rem);
  }

  .sales-cycle-form-section {
    margin-bottom: 1rem;
  }

  .sales-cycle-form-section__body {
    padding: 1.15rem 1.25rem;
  }

  .sales-cycle-modal-title {
    font-size: 1.1rem;
  }

  .sales-cycle-btn-submit {
    flex: 0 0 auto;
    min-width: 8rem;
  }
}

/* ═══════════════════════════════════════════
   Sales Cycles — view toggle + calendar
   ═══════════════════════════════════════════ */
.sc-view-toggle {
  display: inline-flex;
  flex: 1 1 auto;
  padding: 0.2rem;
  gap: 0.15rem;
  background: color-mix(in srgb, var(--crm-surface) 80%, var(--crm-bg));
  border: 1px solid var(--crm-border);
  border-radius: 999px;
  min-height: 2.75rem;
}
.sc-view-toggle__btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.35rem;
  padding: 0 0.85rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--crm-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.sc-view-toggle__btn.active {
  background: var(--crm-surface);
  color: var(--crm-accent);
  box-shadow: var(--crm-shadow);
}
.sc-view-toggle__btn:focus-visible {
  outline: 2px solid var(--crm-accent);
  outline-offset: 2px;
}

.sc-calendar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
.sc-calendar-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  box-shadow: var(--crm-shadow);
  position: sticky;
  top: 60px;
  z-index: 20;
}
.sc-calendar-toolbar__modes {
  display: flex;
  padding: 0.2rem;
  gap: 0.15rem;
  background: color-mix(in srgb, var(--crm-bg) 70%, var(--crm-surface));
  border-radius: 999px;
}
.sc-calendar-mode-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--crm-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sc-calendar-mode-btn.active {
  background: var(--crm-surface);
  color: var(--crm-accent);
  box-shadow: var(--crm-shadow);
}
.sc-calendar-toolbar__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.sc-calendar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.65rem;
  border: 1px solid var(--crm-border);
  border-radius: 999px;
  background: var(--crm-surface);
  color: var(--crm-text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sc-calendar-nav-btn--today {
  flex: 1 1 auto;
  max-width: 8rem;
  color: var(--crm-accent);
  border-color: color-mix(in srgb, var(--crm-accent) 35%, var(--crm-border));
  background: var(--crm-accent-light);
}
.sc-calendar-nav-btn:active {
  transform: scale(0.97);
}
.sc-calendar-toolbar__label {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--crm-text);
  letter-spacing: -0.02em;
}

.sc-calendar-body {
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

/* Week — mobile agenda */
.sc-calendar-week-agenda {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.sc-calendar-week-grid {
  display: none;
}
.sc-calendar-agenda-day {
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  overflow: hidden;
  box-shadow: var(--crm-shadow);
}
.sc-calendar-agenda-day--today {
  border-color: color-mix(in srgb, var(--crm-accent) 45%, var(--crm-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--crm-accent) 20%, transparent);
}
.sc-calendar-agenda-day__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: color-mix(in srgb, var(--crm-bg) 50%, var(--crm-surface));
  border-bottom: 1px solid var(--crm-border-light);
}
.sc-calendar-agenda-day--today .sc-calendar-agenda-day__header {
  background: var(--crm-accent-light);
}
.sc-calendar-agenda-day__weekday {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
}
.sc-calendar-agenda-day__date {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--crm-text);
  line-height: 1;
}
.sc-calendar-agenda-day__count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--crm-accent-light);
  color: var(--crm-accent);
}
.sc-calendar-agenda-day__events {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem;
}
.sc-calendar-empty-day {
  margin: 0;
  padding: 0.35rem 0.15rem;
  font-size: 0.82rem;
  color: var(--crm-text-muted);
}

/* Events */
.sc-calendar-event {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--sc-event-color, var(--crm-accent)) 35%, var(--crm-border));
  border-left: 3px solid var(--sc-event-color, var(--crm-accent));
  border-radius: 8px;
  background: color-mix(in srgb, var(--sc-event-color, var(--crm-accent)) 8%, var(--crm-surface));
  color: var(--crm-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.sc-calendar-event:active {
  transform: scale(0.99);
}
.sc-calendar-event--chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.75rem;
  min-height: 2rem;
}
.sc-calendar-event__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--sc-event-color, var(--crm-accent));
  flex-shrink: 0;
}
.sc-calendar-event--card,
.sc-calendar-event--card-full {
  padding: 0.65rem 0.75rem;
  min-height: 2.75rem;
}
.sc-calendar-event__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.sc-calendar-event__stage {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--sc-event-color, var(--crm-accent));
}
.sc-calendar-event__priority {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sc-priority-color, #94a3b8) 12%, transparent);
  color: var(--sc-priority-color, var(--crm-text-secondary));
}
.sc-calendar-event__priority.priority-high {
  --sc-priority-color: #e63946;
}
.sc-calendar-event__priority.priority-medium {
  --sc-priority-color: #d97706;
}
.sc-calendar-event__priority.priority-low {
  --sc-priority-color: #94a3b8;
}
.sc-calendar-event__priority-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--sc-priority-color, #94a3b8);
  flex-shrink: 0;
}
.sc-calendar-event__dots {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.sc-calendar-event__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--crm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-calendar-event--card-full .sc-calendar-event__title {
  white-space: normal;
}
.sc-calendar-event__meta {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--crm-text-secondary);
  line-height: 1.35;
}
.sc-calendar-more {
  display: block;
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.2rem 0.35rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--crm-accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

/* Month view */
.sc-calendar-month {
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  box-shadow: var(--crm-shadow);
  overflow: hidden;
}
.sc-calendar-month__header,
.sc-calendar-month__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.sc-calendar-month__header {
  border-bottom: 1px solid var(--crm-border-light);
  background: color-mix(in srgb, var(--crm-bg) 55%, var(--crm-surface));
}
.sc-calendar-month-head {
  padding: 0.45rem 0.15rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--crm-text-muted);
}
.sc-calendar-month-cell {
  min-height: 4.5rem;
  padding: 0.25rem 0.2rem;
  border-right: 1px solid var(--crm-border-light);
  border-bottom: 1px solid var(--crm-border-light);
  cursor: default;
}
.sc-calendar-month-cell:nth-child(7n) {
  border-right: none;
}
.sc-calendar-month-cell--outside {
  opacity: 0.45;
}
.sc-calendar-month-cell--today {
  background: color-mix(in srgb, var(--crm-accent) 10%, var(--crm-surface));
}
.sc-calendar-month-cell--today .sc-calendar-month-cell__num {
  background: var(--crm-accent);
  color: #fff;
}
.sc-calendar-month-cell__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-bottom: 0.15rem;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--crm-text);
}
.sc-calendar-month-cell__events {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sc-calendar-day-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  max-height: min(70dvh, 520px);
  display: flex;
  flex-direction: column;
  background: var(--crm-surface);
  border-top: 1px solid var(--crm-border);
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sc-calendar-day-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--crm-border-light);
}
.sc-calendar-day-panel__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--crm-text);
  text-transform: capitalize;
}
.sc-calendar-day-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--crm-bg) 60%, var(--crm-surface));
  color: var(--crm-text-secondary);
  cursor: pointer;
}
.sc-calendar-day-panel__events {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
  .crm-page-header__actions .sc-view-toggle {
    flex: 0 0 auto;
    min-width: 11rem;
  }

  .sc-calendar-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
  }
  .sc-calendar-toolbar__modes {
    flex: 0 0 auto;
    min-width: 14rem;
  }
  .sc-calendar-toolbar__nav {
    flex: 0 0 auto;
  }
  .sc-calendar-toolbar__label {
    flex: 1 1 auto;
    text-align: center;
    order: 3;
    width: 100%;
  }

  .sc-calendar-week-agenda {
    display: none;
  }
  .sc-calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
    min-height: 50vh;
  }
  .sc-calendar-week-col {
    display: flex;
    flex-direction: column;
    min-height: 12rem;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-sm);
    overflow: hidden;
    box-shadow: var(--crm-shadow);
  }
  .sc-calendar-week-col--today {
    border-color: color-mix(in srgb, var(--crm-accent) 45%, var(--crm-border));
  }
  .sc-calendar-week-col__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.55rem 0.35rem;
    border-bottom: 1px solid var(--crm-border-light);
    background: color-mix(in srgb, var(--crm-bg) 50%, var(--crm-surface));
  }
  .sc-calendar-week-col--today .sc-calendar-week-col__header {
    background: var(--crm-accent-light);
  }
  .sc-calendar-week-col__weekday {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--crm-text-muted);
  }
  .sc-calendar-week-col__date {
    font-size: 1rem;
    font-weight: 800;
    color: var(--crm-text);
  }
  .sc-calendar-week-col__events {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem;
    flex: 1 1 auto;
  }

  .sc-calendar-month-cell {
    min-height: 6.5rem;
    padding: 0.35rem;
  }
  .sc-calendar-month-cell[data-day-key] {
    cursor: pointer;
  }
  .sc-calendar-month-cell[data-day-key]:hover {
    background: color-mix(in srgb, var(--crm-accent) 6%, var(--crm-surface));
  }

  .sc-calendar-day-panel {
    position: static;
    max-height: none;
    border-radius: var(--crm-radius-sm);
    box-shadow: var(--crm-shadow);
    margin-top: 0.5rem;
  }
}

@supports (-webkit-touch-callout: none) {
  .sales-cycle-modal-footer {
    backdrop-filter: blur(12px);
    background-color: color-mix(in srgb, var(--crm-surface) 92%, transparent);
  }

  .sales-cycle-modal-tabs .nav-link,
  .sales-cycle-modal-close,
  .sales-cycle-btn-action {
    -webkit-tap-highlight-color: transparent;
  }
}


/* Custom scrollbar */
.admin-body ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.admin-body ::-webkit-scrollbar-thumb {
  background: var(--crm-scroll-thumb);
  border-radius: 3px;
}
.admin-body ::-webkit-scrollbar-track {
  background: var(--crm-scroll-track);
}

/* ── Loading spinner overlay ──────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--crm-spinner-bg);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  will-change: opacity, visibility;
}
.loading-overlay.loading-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.loading-overlay .spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--crm-border);
  border-top-color: var(--crm-accent);
  border-radius: 50%;
  animation: crm-spin 0.75s linear infinite;
}
@keyframes crm-spin {
  to { transform: rotate(360deg); }
}

/* ── Inventory import progress overlay ───── */
.import-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

.import-progress-overlay--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.import-progress-panel {
  width: min(100%, 420px);
  padding: 2rem 1.75rem;
  background: var(--crm-topbar-bg, #fff);
  animation: import-panel-enter 0.35s ease;
}

@keyframes import-panel-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.import-progress-panel__icon {
  width: 64px;
  height: 64px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: rgba(79, 70, 229, 0.12);
  color: var(--crm-accent, #4f46e5);
  font-size: 1.75rem;
  animation: import-icon-pulse 1.6s ease-in-out infinite;
}

@keyframes import-icon-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

.import-progress-track {
  height: 10px;
  background: var(--crm-border, #e2e8f0);
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .import-progress-track {
    height: 8px;
  }
}

.import-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--crm-accent, #4f46e5), #6366f1);
  transition: width 0.35s ease;
  position: relative;
  overflow: hidden;
}

.import-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  animation: import-bar-shimmer 1.4s linear infinite;
}

@keyframes import-bar-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.import-progress-percent {
  font-size: 1.25rem;
  color: var(--crm-accent, #4f46e5);
}

.import-progress-eta {
  font-size: 0.85rem;
  text-align: right;
}

.import-card {
  position: relative;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.import-card--active,
.import-card--busy {
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18), var(--crm-shadow, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
}

.import-card--active::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
  animation: import-card-glow 2s ease-in-out infinite;
}

@keyframes import-card-glow {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.import-card-indicator {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: min(100%, 220px);
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.16);
  animation: import-indicator-enter 0.35s ease;
}

@keyframes import-indicator-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.import-card-indicator__pulse {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--crm-accent, #4f46e5);
  box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.45);
  animation: import-card-pulse 1.5s ease-out infinite;
}

@keyframes import-card-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.45);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

.import-card-indicator__content {
  flex: 1;
  min-width: 0;
}

.import-card-indicator__label {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--crm-accent, #4f46e5);
  margin-right: 0.5rem;
}

.import-card-indicator__percent {
  font-size: 0.95rem;
  color: var(--crm-accent, #4f46e5);
}

.import-card-indicator__message {
  font-size: 0.82rem;
  color: var(--crm-text-secondary, #64748b);
}

.import-card-indicator__bar {
  min-width: 0;
}

/* ── Mobile top navbar ────────────────────── */
.admin-mobile-nav {
  height: 60px;
  z-index: 1040;
  background-color: var(--crm-topbar-bg);
  border-bottom: 1px solid var(--crm-border);
  box-shadow: var(--crm-shadow);
}
.admin-mobile-nav .navbar-brand {
  color: var(--crm-text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.admin-mobile-nav .btn {
  color: var(--crm-text-secondary);
}
.admin-mobile-nav .btn:hover {
  color: var(--crm-text);
  background-color: var(--crm-hover);
}

/* ── Wrapper ──────────────────────────────── */
.admin-wrapper {
  min-height: 100vh;
  padding-top: 60px;
}

/* ── Sidebar ──────────────────────────────── */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--crm-sidebar-width);
  height: 100vh;
  z-index: 1050;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--crm-sidebar-bg);
  border-right: 1px solid var(--crm-border);
  box-shadow: var(--crm-shadow);
}

/* Sidebar brand */
.admin-sidebar .sidebar-brand-text {
  color: var(--crm-text);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
}

/* Sidebar navigation links — large icons */
.admin-sidebar .nav-link {
  padding: 0.75rem 1rem;
  margin: 0.15rem 0.625rem;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--crm-text-secondary);
  border-radius: var(--crm-radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.admin-sidebar .nav-link i {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.1rem;
  color: var(--crm-text-muted);
  transition: color 0.18s ease, transform 0.18s ease;
}
.admin-sidebar .nav-link:hover {
  background-color: var(--crm-hover);
  color: var(--crm-text);
  transform: translateX(2px);
}
.admin-sidebar .nav-link:hover i {
  color: var(--crm-text);
  transform: scale(1.08);
}
.admin-sidebar .nav-link.active {
  background-color: var(--crm-accent-light);
  color: var(--crm-accent);
  font-weight: 600;
}
.admin-sidebar .nav-link.active i {
  color: var(--crm-accent);
  transform: scale(1.08);
}

/* Submenu */
.submenu .nav-link {
  padding-left: 3.25rem;
  font-size: 0.875rem;
  font-weight: 400;
  gap: 0.6rem;
}
.submenu .nav-link i {
  width: 1.15rem;
  height: 1.15rem;
  font-size: 0.85rem;
}
.submenu-toggle .fa-chevron-down {
  transition: transform 0.3s ease;
  color: var(--crm-text-muted);
  font-size: 0.65rem;
}
.submenu-toggle.rotate-180 .fa-chevron-down {
  transform: rotate(180deg);
}
.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}
.submenu.open {
  max-height: 500px;
  opacity: 1;
}

/* Sidebar collapse button */
.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: var(--crm-text-secondary);
  padding: 0.35rem 0.6rem;
  border-radius: var(--crm-radius-xs);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.sidebar-collapse-btn:hover {
  color: var(--crm-text);
  background-color: var(--crm-hover);
}

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid var(--crm-border);
}

/* ── Overlay ──────────────────────────────── */
.admin-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.admin-sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ── Main content ─────────────────────────── */
.admin-main {
  width: 100%;
  min-height: calc(100vh - 60px);
  background-color: var(--crm-bg);
}
.admin-content {
  max-width: 1440px;
  margin: 0 auto;
}

/* ── Topbar ───────────────────────────────── */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: var(--crm-topbar-bg);
  border-bottom: 1px solid var(--crm-border);
  height: 60px;
  box-shadow: var(--crm-shadow);
}

/* ── Cards ─────────────────────────────────── */
.card {
  border: none !important;
  border-radius: var(--crm-radius) !important;
  background-color: var(--crm-surface);
  box-shadow: var(--crm-shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover {
  box-shadow: var(--crm-shadow-md);
}
.card-header {
  background-color: transparent;
  border-bottom: none;
  padding: 1.25rem 1.5rem 0.5rem;
}
.card-header .card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--crm-text);
  letter-spacing: -0.01em;
}
.card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* Stat cards — subtle hover lift */
.card.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--crm-shadow-md);
}

/* ── Modern badges (chip style) ────────────── */
.badge {
  font-weight: 500;
  border-radius: 8px;
  letter-spacing: 0.01em;
}
.badge.badge-chip {
  border-radius: 50rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Buttons ──────────────────────────────── */
.btn {
  --btn-shadow: none;
  --btn-shadow-hover: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: var(--crm-radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  line-height: 1.25;
  border-width: 1.5px;
  box-shadow: var(--btn-shadow);
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.22s ease,
    transform 0.18s ease;
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--btn-shadow), 0 0 0 3px rgba(79, 110, 247, 0.28);
}
.btn:active {
  transform: scale(0.98);
}
.btn.btn-lg {
  padding: 0.7rem 1.35rem;
  font-size: 0.9375rem;
  border-radius: var(--crm-radius-sm);
  letter-spacing: 0.015em;
}
.btn.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--crm-radius-xs);
}

/* Primary — gradient fill + soft glow */
.btn-primary {
  --btn-shadow: 0 1px 2px rgba(79, 110, 247, 0.18), 0 4px 12px rgba(79, 110, 247, 0.12);
  --btn-shadow-hover: 0 2px 4px rgba(79, 110, 247, 0.22), 0 8px 20px rgba(79, 110, 247, 0.28);
  background: linear-gradient(135deg, var(--crm-accent) 0%, #6378f8 100%);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: linear-gradient(135deg, var(--crm-accent-hover) 0%, #5068e8 100%);
  border-color: transparent;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow-hover);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 1px 3px rgba(79, 110, 247, 0.2);
}

/* Outline primary */
.btn-outline-primary {
  --btn-shadow: none;
  --btn-shadow-hover: 0 2px 8px rgba(79, 110, 247, 0.14);
  color: var(--crm-accent);
  border-color: rgba(79, 110, 247, 0.35);
  background-color: transparent;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
  color: var(--crm-accent-hover);
  background-color: var(--crm-accent-light);
  border-color: rgba(79, 110, 247, 0.5);
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow-hover);
}

/* Outline secondary */
.btn-outline-secondary {
  --btn-shadow: none;
  --btn-shadow-hover: 0 2px 8px rgba(26, 29, 35, 0.08);
  color: var(--crm-text-secondary);
  border-color: var(--crm-border);
  background-color: transparent;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  color: var(--crm-text);
  background-color: var(--crm-hover);
  border-color: var(--crm-text-muted);
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow-hover);
}

/* Outline danger */
.btn-outline-danger {
  --btn-shadow: none;
  --btn-shadow-hover: 0 2px 8px rgba(220, 53, 69, 0.16);
  color: #dc3545;
  border-color: rgba(220, 53, 69, 0.35);
  background-color: transparent;
}
.btn-outline-danger:hover,
.btn-outline-danger:focus-visible {
  color: #bb2d3b;
  background-color: rgba(220, 53, 69, 0.08);
  border-color: rgba(220, 53, 69, 0.5);
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow-hover);
}
[data-bs-theme="dark"] .btn-outline-danger {
  color: #f58da0;
  border-color: rgba(245, 141, 160, 0.35);
}
[data-bs-theme="dark"] .btn-outline-danger:hover,
[data-bs-theme="dark"] .btn-outline-danger:focus-visible {
  color: #ffb3c1;
  background-color: rgba(220, 53, 69, 0.15);
  border-color: rgba(245, 141, 160, 0.5);
}

/* Ghost / light */
.btn-light {
  background-color: var(--crm-surface);
  border-color: var(--crm-border);
  color: var(--crm-text-secondary);
  --btn-shadow: 0 1px 2px rgba(26, 29, 35, 0.04);
}
.btn-light:hover,
.btn-light:focus-visible {
  background-color: var(--crm-hover);
  border-color: var(--crm-border);
  color: var(--crm-text);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(26, 29, 35, 0.08);
}

/* Compact icon-only action buttons (tables, toolbars) */
.btn-action {
  --btn-action-size: 2.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--btn-action-size);
  height: var(--btn-action-size);
  padding: 0;
  flex-shrink: 0;
  border-radius: var(--crm-radius-xs);
  border: 1.5px solid transparent;
  background-color: var(--crm-surface-alt);
  color: var(--crm-text-muted);
  font-size: 0.8125rem;
  line-height: 1;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.btn-action i {
  display: block;
  line-height: 1;
  pointer-events: none;
}
.btn-action:hover,
.btn-action:focus-visible {
  transform: translateY(-1px);
}
.btn-action.btn-action-view:hover,
.btn-action.btn-action-view:focus-visible {
  color: var(--crm-text-secondary);
  background-color: var(--crm-hover);
  border-color: var(--crm-border);
  box-shadow: 0 2px 6px rgba(26, 29, 35, 0.08);
}
.btn-action.btn-action-edit {
  color: var(--crm-accent);
  background-color: var(--crm-accent-light);
}
.btn-action.btn-action-edit:hover,
.btn-action.btn-action-edit:focus-visible {
  color: #fff;
  background-color: var(--crm-accent);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(79, 110, 247, 0.3);
}
.btn-action.btn-action-delete {
  color: #dc3545;
  background-color: rgba(220, 53, 69, 0.08);
}
.btn-action.btn-action-delete:hover,
.btn-action.btn-action-delete:focus-visible {
  color: #fff;
  background-color: #dc3545;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(220, 53, 69, 0.28);
}
[data-bs-theme="dark"] .btn-action.btn-action-delete {
  color: #f58da0;
  background-color: rgba(220, 53, 69, 0.12);
}

/* Inline action group */
.btn-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-actions .button_to {
  display: inline-flex;
  margin: 0;
}

/* Mobile action buttons with label */
.btn-action-label {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  border-radius: var(--crm-radius-xs);
  border-width: 1.5px;
  font-weight: 600;
}
.btn-action-label.btn-outline-secondary {
  background-color: var(--crm-surface-alt);
}
.btn-action-label.btn-outline-primary {
  background-color: var(--crm-accent-light);
}
.btn-action-label.btn-outline-danger {
  background-color: rgba(220, 53, 69, 0.06);
}

[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:focus-visible {
  border-color: var(--crm-text-muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
[data-bs-theme="dark"] .btn-outline-primary {
  border-color: rgba(107, 138, 255, 0.35);
}
[data-bs-theme="dark"] .btn-primary {
  --btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(107, 138, 255, 0.18);
  --btn-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.25), 0 8px 20px rgba(107, 138, 255, 0.28);
  background: linear-gradient(135deg, var(--crm-accent) 0%, #7b94ff 100%);
}
[data-bs-theme="dark"] .btn-action {
  background-color: var(--crm-surface-alt);
}
[data-bs-theme="dark"] .btn-action.btn-action-view:hover,
[data-bs-theme="dark"] .btn-action.btn-action-view:focus-visible {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Filter / submit CTA inside cards */
.btn-filter {
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  border-radius: var(--crm-radius-sm);
}

/* ── Progress bars ────────────────────────── */
.progress {
  height: 8px;
  border-radius: 50rem;
  background-color: var(--crm-surface-alt);
}
.progress-bar {
  border-radius: 50rem;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 992px) {
  .progress {
    height: 10px;
  }
}

/* ── List groups ──────────────────────────── */
.list-group-item {
  border-color: var(--crm-border);
  background-color: transparent;
  transition: background-color 0.15s ease;
}
.list-group-item:hover {
  background-color: var(--crm-hover);
}
.list-group-item:last-child {
  border-bottom: none;
}

/* ── Forms ────────────────────────────────── */
.form-control {
  border-color: var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding: 0.65rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus {
  border-color: var(--crm-accent);
  box-shadow: 0 0 0 0.25rem rgba(79, 110, 247, 0.12);
}
.form-label {
  font-weight: 600;
  color: var(--crm-text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

/* ── Dropdowns ────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--crm-border);
  box-shadow: var(--crm-shadow-md);
  border-radius: var(--crm-radius-sm);
  padding: 0.5rem;
}
.dropdown-item {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--crm-text);
  border-radius: var(--crm-radius-xs);
  padding: 0.5rem 0.85rem;
  transition: background-color 0.15s ease;
}
.dropdown-item:hover {
  background-color: var(--crm-hover);
  color: var(--crm-text);
}

/* ── Table modernization ──────────────────── */
.table thead th {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--crm-text-muted);
  border-bottom-width: 1px;
  padding: 1rem 1.25rem;
}
.table tbody td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  color: var(--crm-text);
}
.table tbody tr {
  transition: background-color 0.15s ease;
}

/* ── Empty states ─────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}
.empty-state i {
  font-size: 4rem;
  color: var(--crm-text-muted);
  opacity: 0.4;
}
.empty-state h5 {
  font-weight: 700;
  color: var(--crm-text-secondary);
  margin-top: 1.25rem;
}
.empty-state p {
  color: var(--crm-text-muted);
  font-size: 0.95rem;
}

/* ── Password validator requirements ─────── */
.password-requirements {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--crm-surface-alt);
  border-radius: var(--crm-radius-xs);
  border: 1px solid var(--crm-border);
}
.password-requirements p {
  margin: 0 0 0.375rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--crm-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.password-requirements ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.password-requirements li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--crm-text-muted);
  transition: color 0.2s ease;
}
.password-requirements li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 0.75rem;
  height: 0.75rem;
  border: 1.5px solid var(--crm-border);
  border-radius: 50%;
  transition: all 0.2s ease;
  text-align: center;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 0.75rem;
  color: transparent;
}
.password-requirements li.met {
  color: #059669;
}
.password-requirements li.met::before {
  content: "\2714";
  background: #22c55e;
  border-color: #22c55e;
  color: #ffffff;
}
.password-requirements li.unmet {
  color: #ef4444;
}
.password-requirements li.unmet::before {
  content: "\2717";
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}
[data-bs-theme="dark"] .password-requirements li.met::before {
  background: #34d399;
  border-color: #34d399;
}
[data-bs-theme="dark"] .password-requirements li.unmet::before {
  background: #f87171;
  border-color: #f87171;
}

/* ═══════════════════════════════════════════
   Kanban — Trello-like, mobile first
   ═══════════════════════════════════════════ */
.admin-content:has(.kanban-board) {
  max-width: none;
  min-width: 0;
  overflow-x: clip;
}
.kanban-board {
  overflow: visible;
  padding: 0.5rem 0 1.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 70vh;
  height: auto;
  background: transparent;
}
.kanban-sticky-headers {
  position: sticky;
  top: 60px;
  z-index: 30;
  overflow: hidden;
  margin-bottom: 0.35rem;
  background-color: var(--crm-bg);
}
.kanban-headers-track {
  width: max-content;
  min-width: 100%;
  will-change: transform;
}
.kanban-sticky-headers .kanban-stage-header {
  position: static;
  top: auto;
  z-index: auto;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border-bottom: none;
  box-shadow: none;
}
.kanban-hscroll-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  scroll-padding-left: 0.25rem;
  scrollbar-gutter: stable;
  padding-bottom: 0.35rem;
}
.kanban-hscroll-viewport::-webkit-scrollbar {
  height: 8px;
}
.kanban-hscroll-viewport::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--crm-border) 35%, transparent);
  border-radius: 999px;
}
.kanban-hscroll-viewport::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--crm-text-muted) 55%, var(--crm-border));
  border-radius: 999px;
}
.kanban-hscroll-viewport::-webkit-scrollbar-thumb:hover {
  background: var(--crm-text-muted);
}
.kanban-row {
  display: flex;
  flex-wrap: nowrap !important;
  align-items: flex-start;
  gap: 0.75rem;
  width: max-content;
  min-width: 100%;
  margin-left: 0;
  margin-right: 0;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}

/* Column sizing — mobile first (next column peeks) */
.kanban-row > .kanban-column-wrapper,
.kanban-column-wrapper {
  scroll-snap-align: start;
  flex: 0 0 min(84vw, 320px);
  width: min(84vw, 320px);
  min-width: min(84vw, 320px);
  max-width: min(84vw, 320px);
  padding-left: 0;
  padding-right: 0;
  margin-top: 0;
}
.kanban-column {
  display: flex;
  flex-direction: column;
  background-color: color-mix(in srgb, var(--crm-surface) 55%, var(--crm-bg));
  border-radius: 12px;
  height: auto;
  padding: 0.35rem 0.35rem 0.5rem;
  border: 1px solid var(--crm-border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* Stage header */
.kanban-stage-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: sticky;
  top: 60px;
  z-index: 25;
  margin: 0 0 0.4rem;
  padding: 0.5rem 0.55rem;
  background-color: color-mix(in srgb, var(--crm-surface) 55%, var(--crm-bg));
  border-radius: 10px;
}
.kanban-stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-stage-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--crm-text);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.kanban-stage-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--crm-text-secondary);
  background-color: var(--crm-border);
  padding: 0.1rem 0.5rem;
  border-radius: 50rem;
  flex-shrink: 0;
  min-width: 1.5rem;
  text-align: center;
}
.kanban-stage-menu {
  background: transparent;
  border: none;
  color: var(--crm-text-secondary);
  padding: 0.25rem 0.45rem;
  border-radius: var(--crm-radius-xs);
  font-size: 0.8rem;
  transition: background-color 0.2s ease;
}
.kanban-stage-menu:hover {
  background-color: var(--crm-border);
  color: var(--crm-text);
}

/* Task list */
.kanban-tasks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 40px;
  flex: 0 0 auto;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border-radius: 8px;
  padding: 0.15rem;
}
.kanban-tasks.drag-over {
  background-color: color-mix(in srgb, var(--crm-accent) 12%, transparent);
  box-shadow: inset 0 0 0 2px var(--crm-accent);
}

/* Kanban cards — flat, Trello-like */
.kanban-card {
  background: var(--crm-surface);
  border-radius: 8px;
  padding: 0.7rem 0.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  cursor: grab;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  border: 1px solid var(--crm-border);
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.kanban-card:hover {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  border-color: color-mix(in srgb, var(--crm-accent) 45%, var(--crm-border));
}
.kanban-card:active {
  cursor: grabbing;
}
.kanban-card.dragging {
  opacity: 0.65;
  transform: rotate(1.5deg);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
}

/* Card priority — shared indicator (Kanban + Calendar) */
.priority-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  color: var(--crm-text-secondary);
}
.priority-indicator__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--sc-priority-color, #94a3b8);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sc-priority-color, #94a3b8) 25%, transparent);
}
.priority-indicator.priority-high {
  --sc-priority-color: #e63946;
}
.priority-indicator.priority-medium {
  --sc-priority-color: #d97706;
}
.priority-indicator.priority-low {
  --sc-priority-color: #94a3b8;
}
.priority-indicator__label {
  letter-spacing: 0.01em;
}

/* Kanban card priority accent */
.kanban-card--priority-high,
.kanban-card--priority-medium,
.kanban-card--priority-low {
  overflow: hidden;
}
.kanban-card--priority-high::before,
.kanban-card--priority-medium::before,
.kanban-card--priority-low::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0.65rem;
  right: 0.65rem;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--sc-priority-color, #94a3b8);
  opacity: 0.85;
}

/* Legacy pill — kept for demo kanban and repair cycles */
.kanban-card-priority {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 50rem;
}
.kanban-card-priority.priority-high {
  color: #e63946;
  background-color: rgba(230, 57, 70, 0.12);
}
.kanban-card-priority.priority-medium {
  color: #c98a0e;
  background-color: rgba(230, 168, 23, 0.14);
}
.kanban-card-priority.priority-low {
  color: var(--crm-text-muted);
  background-color: rgba(108, 112, 128, 0.12);
}

/* Card menu — always visible on touch (no hover) */
.kanban-card-menu {
  background: transparent;
  border: none;
  color: var(--crm-text-muted);
  padding: 0.25rem 0.45rem;
  border-radius: var(--crm-radius-xs);
  font-size: 0.8rem;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.kanban-card-menu:hover {
  background-color: var(--crm-hover);
  color: #e63946;
}

/* Card title */
.kanban-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--crm-text);
  margin-bottom: 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Card tags */
.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.kanban-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--crm-text-secondary);
  background-color: var(--crm-surface-alt);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  letter-spacing: 0.01em;
  border: 1px solid var(--crm-border);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Card meta */
.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--crm-border);
  font-size: 0.8rem;
  color: var(--crm-text-secondary);
}
.kanban-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--crm-accent) 18%, transparent);
  color: var(--crm-accent);
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--crm-accent) 35%, transparent);
}
.kanban-card-date {
  font-size: 0.72rem;
  color: var(--crm-text-muted);
  display: inline-flex;
  align-items: center;
}

/* Add card button */
.kanban-add-card {
  width: 100%;
  text-align: center;
  padding: 0.6rem;
  color: var(--crm-text-muted);
  background-color: transparent;
  border: 1px dashed var(--crm-border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.kanban-add-card:hover {
  background-color: var(--crm-surface);
  color: var(--crm-accent);
  border-color: var(--crm-accent);
  border-style: solid;
}

/* Hide hover-only affordances on touch devices already handled by always-on.
   On devices that DO support hover, keep delete button subtle until hover. */
@media (hover: hover) and (pointer: fine) {
  .kanban-card-menu {
    opacity: 0;
  }
  .kanban-card:hover .kanban-card-menu,
  .kanban-card-menu:focus-visible {
    opacity: 1;
  }
}

/* Tablet and up — fixed comfortable column width */
@media (min-width: 768px) {
  .kanban-board {
    min-height: calc(100vh - 220px);
  }
  .kanban-row {
    gap: 1rem;
  }
  .kanban-row > .kanban-column-wrapper,
  .kanban-column-wrapper {
    flex: 0 0 290px;
    width: 290px;
    min-width: 290px;
    max-width: 290px;
  }
}

/* ═══════════════════════════════════════════
   Trix editor — modern styling
   ═══════════════════════════════════════════ */
trix-editor {
  min-height: 180px;
  border: 1px solid var(--crm-border) !important;
  border-top: none !important;
  border-radius: 0 0 var(--crm-radius-sm) var(--crm-radius-sm) !important;
  padding: 1rem;
  background-color: var(--crm-surface);
  color: var(--crm-text);
  font-size: 0.95rem;
  line-height: 1.65;
}
trix-toolbar {
  background: var(--crm-trix-toolbar-bg) !important;
  border: 1px solid var(--crm-border) !important;
  border-bottom: none !important;
  border-radius: var(--crm-radius-sm) var(--crm-radius-sm) 0 0 !important;
  padding: 0.35rem 0.5rem;
}
trix-toolbar .trix-button-row {
  flex-wrap: wrap;
  gap: 0.15rem;
}
trix-toolbar .trix-button-group {
  margin-bottom: 0.25rem;
}
trix-toolbar .trix-button-group:not(:last-child) {
  margin-right: 0.35rem;
}
trix-toolbar .trix-button {
  border-radius: var(--crm-radius-xs) !important;
  color: var(--crm-text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}
trix-toolbar .trix-button:hover {
  background-color: var(--crm-hover);
  color: var(--crm-text);
}
trix-toolbar .trix-button.trix-active {
  background-color: var(--crm-accent-light);
  color: var(--crm-accent);
}
[data-bs-theme="dark"] trix-editor {
  background-color: var(--crm-surface-alt);
}

/* ═══════════════════════════════════════════
   Charts responsive
   ═══════════════════════════════════════════ */
canvas {
  max-height: 400px;
}

/* ═══════════════════════════════════════════
   Animations & effects
   ═══════════════════════════════════════════ */
@keyframes crm-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-in-up {
  animation: crm-fade-in-up 0.4s ease forwards;
}
.animate-delay-1 { animation-delay: 0.05s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.10s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.15s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.20s; opacity: 0; }

/* Pulse glow on stat icon */
@keyframes crm-pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.05); }
}
.stat-icon-glow {
  animation: crm-pulse-glow 2.5s ease-in-out infinite;
}

/* ── Desktop overrides ────────────────────── */
@media (min-width: 992px) {
  /* Sidebar: fixed to viewport, always visible */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    height: 100vh;
    width: var(--crm-sidebar-width);
    z-index: 1050;
    box-shadow: none;
  }
  .admin-sidebar.open {
    transform: none;
    box-shadow: none;
  }

  /* Main content: offset by sidebar width, natural scroll */
  .admin-main {
    margin-left: var(--crm-sidebar-width);
    width: auto;
    min-width: 0;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.sidebar-collapsed .admin-main {
    margin-left: var(--crm-sidebar-collapsed);
  }

  .admin-wrapper {
    padding-top: 0;
  }

  .admin-sidebar-overlay {
    display: none !important;
  }

  /* Collapsed sidebar */
  .admin-sidebar.collapsed {
    width: var(--crm-sidebar-collapsed);
    overflow: visible;
  }
  .admin-sidebar.collapsed .sidebar-brand-text,
  .admin-sidebar.collapsed .nav-link span,
  .admin-sidebar.collapsed .nav-section-title,
  .admin-sidebar.collapsed .sidebar-footer {
    display: none !important;
  }
  .admin-sidebar.collapsed .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0.35rem;
    margin-right: 0.35rem;
  }
  .admin-sidebar.collapsed .nav-link i {
    margin-right: 0;
  }
  .admin-sidebar.collapsed .submenu {
    display: none !important;
  }
  .admin-sidebar.collapsed .submenu-toggle {
    display: none !important;
  }

  /* Tooltip on hover for collapsed */
  .admin-sidebar.collapsed .nav-link {
    position: relative;
  }
  .admin-sidebar.collapsed .nav-link::after {
    content: attr(data-label);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--crm-text);
    color: var(--crm-surface);
    padding: 0.4rem 0.7rem;
    border-radius: var(--crm-radius-xs);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    margin-left: 0.75rem;
    z-index: 1060;
    pointer-events: none;
    box-shadow: var(--crm-shadow-md);
  }
  .admin-sidebar.collapsed .nav-link:hover::after {
    opacity: 1;
    visibility: visible;
  }
}

/* ── Mobile-first submenu overrides ───────── */
@media (max-width: 991.98px) {
  /* Off-screen drawer behaviour — mobile only */
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--crm-shadow-lg);
  }
  .submenu .nav-link {
    padding-left: 3.5rem;
  }
  .admin-sidebar .nav-link {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
  }
}

/* ── Accessibility & motion ───────────────── */
@media (prefers-reduced-motion: reduce) {
  .admin-sidebar,
  .submenu,
  .admin-sidebar-overlay,
  .kanban-card,
  .card,
  .btn,
  .animate-fade-in-up,
  .stat-icon-glow {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Pagination (Kaminari) ────────────────── */
.crm-pagination-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  padding-top: 0.5rem;
}

.crm-pagination-meta {
  font-size: 0.85rem;
  line-height: 1.4;
}

.crm-pagination-per-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.crm-pagination-per-page-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-pagination-per-page-group .btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.65rem;
  font-weight: 600;
  border-radius: var(--crm-radius-xs);
}

.crm-pagination-per-page-group .btn:first-child {
  border-top-left-radius: var(--crm-radius-sm);
  border-bottom-left-radius: var(--crm-radius-sm);
}

.crm-pagination-per-page-group .btn:last-child {
  border-top-right-radius: var(--crm-radius-sm);
  border-bottom-right-radius: var(--crm-radius-sm);
}

.crm-pagination-nav {
  width: 100%;
  display: flex;
  justify-content: center;
}

.crm-pagination-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.crm-pagination-item {
  display: flex;
}

.crm-pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  background: var(--crm-surface);
  color: var(--crm-text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.crm-pagination-link:hover {
  background: var(--crm-hover);
  border-color: var(--crm-accent);
  color: var(--crm-accent);
}

.crm-pagination-link.is-current {
  background: var(--crm-accent);
  border-color: var(--crm-accent);
  color: #fff;
  box-shadow: var(--crm-shadow-md);
}

.crm-pagination-link.is-gap {
  border-color: transparent;
  background: transparent;
  color: var(--crm-text-muted);
  min-width: 2rem;
  padding-inline: 0.25rem;
}

.crm-pagination-link--nav {
  padding-inline: 0.85rem;
}

.crm-pagination-nav-text {
  display: none;
}

@media (min-width: 576px) {
  .crm-pagination-bar {
    gap: 1.15rem;
  }

  .crm-pagination-per-page {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }

  .crm-pagination-nav-text {
    display: inline;
  }
}

@media (min-width: 768px) {
  .crm-pagination-bar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .crm-pagination-meta {
    flex: 1 1 auto;
    text-align: left;
  }

  .crm-pagination-per-page {
    flex: 0 0 auto;
  }

  .crm-pagination-nav {
    flex: 1 1 100%;
    justify-content: center;
    margin-top: 0.25rem;
  }
}

@media (min-width: 992px) {
  .crm-pagination-bar {
    flex-wrap: nowrap;
    gap: 1.5rem;
  }

  .crm-pagination-nav {
    flex: 1 1 auto;
    margin-top: 0;
    justify-content: flex-end;
  }
}

/* ═══════════════════════════════════════════
   Detail / show pages — mobile-first + Turbo Native
   ═══════════════════════════════════════════ */

.crm-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
}

.crm-show-avatar {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--crm-accent-light);
  color: var(--crm-accent);
  font-weight: 700;
  font-size: 1rem;
}

.crm-show-hero__total {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.crm-show-hero__breakdown {
  display: grid;
  gap: 0.5rem;
}

.crm-show-hero__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.9rem;
}

.crm-show-hero__row dt {
  margin: 0;
  color: var(--crm-text-muted);
  font-weight: 500;
}

.crm-show-hero__row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.crm-detail-list {
  display: grid;
  gap: 0.85rem;
}

.crm-detail-list__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.crm-detail-list__item dt {
  margin: 0;
  font-size: 0.85rem;
  color: var(--crm-text-muted);
  font-weight: 500;
}

.crm-detail-list__item dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.crm-detail-list__item--total dt,
.crm-detail-list__item--total dd {
  font-size: 1.1rem;
  font-weight: 700;
}

.crm-detail-meta {
  display: grid;
  gap: 0.65rem;
}

.crm-detail-meta__item dt {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
}

.crm-detail-meta__item dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--crm-text-secondary);
}

.crm-quote-item-card {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--crm-border);
}

.crm-quote-item-card:first-child {
  border-top: none;
}

.crm-quote-item-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
}

.crm-quote-item-card__grid dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--crm-text-muted);
}

.crm-quote-item-card__grid dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.crm-quote-item-card__total {
  border-top: 1px dashed var(--crm-border);
}

.crm-quote-item-card__note {
  padding: 0.65rem 0.75rem;
  border-radius: var(--crm-radius-xs);
  background-color: var(--crm-surface-alt);
}

.crm-quote-observations {
  font-size: 0.95rem;
  color: var(--crm-text-secondary);
  line-height: 1.55;
}

.crm-quote-observations p:last-child {
  margin-bottom: 0;
}

/* Sticky action bar — mobile / Turbo Native */
.quote-show-page {
  padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .quote-show-page {
    padding-bottom: 0;
  }
}

.crm-show-actions-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1035;
  background-color: var(--crm-surface);
  border-top: 1px solid var(--crm-border);
  box-shadow: 0 -4px 24px rgba(26, 29, 35, 0.1);
  padding: 0.65rem 0.85rem;
  padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  padding-left: calc(0.85rem + env(safe-area-inset-left, 0px));
  padding-right: calc(0.85rem + env(safe-area-inset-right, 0px));
}

.crm-show-actions-sticky__inner {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  max-width: 1440px;
  margin: 0 auto;
}

.crm-show-actions-sticky .btn-action-label {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.crm-show-actions-sticky .btn-action-label:not(.flex-grow-1) {
  flex: 0 0 2.75rem;
  width: 2.75rem;
  padding-inline: 0;
}

[data-bs-theme="dark"] .crm-show-actions-sticky {
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

/* ── Turbo Native adjustments ─────────────── */
@supports (-webkit-touch-callout: none) {
  .admin-sidebar {
    overscroll-behavior-y: contain;
  }
  .kanban-board,
  .kanban-hscroll-viewport {
    -webkit-overflow-scrolling: touch;
  }
  .btn,
  .crm-pagination-link,
  .kanban-card,
  .kanban-card-menu,
  .crm-show-actions-sticky .btn-action-label {
    -webkit-tap-highlight-color: transparent;
  }
  .crm-show-actions-sticky {
    backdrop-filter: blur(12px);
    background-color: color-mix(in srgb, var(--crm-surface) 92%, transparent);
  }
}

/* ── Page transition helper ───────────────── */
.turbo-progress-bar {
  background-color: var(--crm-accent) !important;
  height: 3px !important;
}

/* ── Custom font sizes for mobile stat cards ── */
.fs-7 {
  font-size: 0.7rem !important;
}
.fs-md-6 {
  font-size: 0.875rem !important;
}
@media (min-width: 768px) {
  .fs-md-6 {
    font-size: 0.875rem !important;
  }
}

/* ═══════════════════════════════════════════
   Customer form — Input groups with internal buttons
   ═══════════════════════════════════════════ */

/* Ensure input group buttons match the form-control height and radius */
.input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group .form-control:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.input-group .btn {
  border-radius: 0;
  font-weight: 600;
  font-size: 0.85rem;
}
.input-group .btn:first-child {
  border-top-left-radius: var(--crm-radius-sm);
  border-bottom-left-radius: var(--crm-radius-sm);
}
.input-group .btn:last-child {
  border-top-right-radius: var(--crm-radius-sm);
  border-bottom-right-radius: var(--crm-radius-sm);
}
.input-group .btn:not(:last-child) {
  border-right: none;
}

/* Loading spinner inside geolocation button */
[data-geolocation-target="spinner"] .spinner-border-sm {
  width: 0.9rem;
  height: 0.9rem;
  border-width: 0.15em;
}

/* Breadcrumb overrides for dark mode consistency */
[data-bs-theme="dark"] .breadcrumb-item a {
  color: var(--crm-accent);
}
[data-bs-theme="dark"] .breadcrumb-item.active {
  color: var(--crm-text-muted);
}

/* ═══════════════════════════════════════════
   Notes — Google Keep style masonry layout
   ═══════════════════════════════════════════ */

/* Color CSS variables for note backgrounds */
:root,
[data-bs-theme="light"] {
  --note-color-default: #ffffff;
  --note-text-default: #1a1d23;
  --note-color-red: #f28b82;
  --note-text-red: #5f1410;
  --note-color-orange: #fbbc04;
  --note-text-orange: #5c3d00;
  --note-color-yellow: #fff475;
  --note-text-yellow: #5c5200;
  --note-color-green: #ccff90;
  --note-text-green: #1b4d00;
  --note-color-blue: #a7ffeb;
  --note-text-blue: #004d3d;
  --note-color-purple: #d7aefb;
  --note-text-purple: #3d005f;
  --note-color-pink: #fdcfe8;
  --note-text-pink: #5c0033;
}

[data-bs-theme="dark"] {
  --note-color-default: #1a1d26;
  --note-text-default: #e4e6ec;
  --note-color-red: #5c2b29;
  --note-text-red: #f58da0;
  --note-color-orange: #614a19;
  --note-text-orange: #f5b840;
  --note-color-yellow: #635d19;
  --note-text-yellow: #f5e840;
  --note-color-green: #345920;
  --note-text-green: #a8f070;
  --note-color-blue: #16504b;
  --note-text-blue: #70f0d0;
  --note-color-purple: #42275e;
  --note-text-purple: #d0a0f0;
  --note-color-pink: #5b2245;
  --note-text-pink: #f0a0d0;
}

/* Note background classes */
.note-bg-default { background-color: var(--note-color-default); color: var(--note-text-default); }
.note-bg-red     { background-color: var(--note-color-red);     color: var(--note-text-red); }
.note-bg-orange  { background-color: var(--note-color-orange);  color: var(--note-text-orange); }
.note-bg-yellow  { background-color: var(--note-color-yellow);  color: var(--note-text-yellow); }
.note-bg-green   { background-color: var(--note-color-green);   color: var(--note-text-green); }
.note-bg-blue    { background-color: var(--note-color-blue);    color: var(--note-text-blue); }
.note-bg-purple  { background-color: var(--note-color-purple);  color: var(--note-text-purple); }
.note-bg-pink    { background-color: var(--note-color-pink);    color: var(--note-text-pink); }

/* Masonry grid for notes */
.notes-masonry {
  column-count: 1;
  column-gap: 1.25rem;
}
@media (min-width: 576px) {
  .notes-masonry { column-count: 2; }
}
@media (min-width: 992px) {
  .notes-masonry { column-count: 3; }
}
@media (min-width: 1200px) {
  .notes-masonry { column-count: 4; }
}

/* Note card styles */
.note-card {
  break-inside: avoid;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.2s ease;
  position: relative;
  cursor: pointer;
}
.note-card:hover {
  box-shadow: var(--crm-shadow-md);
  transform: translateY(-2px);
}
.note-card .stretched-link::after {
  z-index: 1;
}
.note-card .dropdown {
  position: relative;
  z-index: 2;
}

/* Note preview text */
.note-preview {
  color: var(--crm-text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Color swatches in form */
.color-swatch {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.color-swatch:hover {
  transform: scale(1.15);
}
.color-swatch.active {
  border-color: var(--crm-text);
  box-shadow: 0 0 0 2px var(--crm-surface), 0 0 0 4px var(--crm-text);
}
.color-swatch-default { background-color: var(--note-color-default); border: 1px solid var(--crm-border); }
.color-swatch-red     { background-color: var(--note-color-red); }
.color-swatch-orange  { background-color: var(--note-color-orange); }
.color-swatch-yellow  { background-color: var(--note-color-yellow); }
.color-swatch-green   { background-color: var(--note-color-green); }
.color-swatch-blue    { background-color: var(--note-color-blue); }
.color-swatch-purple  { background-color: var(--note-color-purple); }
.color-swatch-pink    { background-color: var(--note-color-pink); }

.cursor-pointer {
  cursor: pointer;
}

/* Dark mode note card overrides */
[data-bs-theme="dark"] .note-card {
  box-shadow: var(--crm-shadow);
}

/* Masonry items (wrapper around note cards) keep columns intact */
.notes-masonry > * {
  break-inside: avoid;
}

/* Note card footer / chips */
.note-card__footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
[data-bs-theme="dark"] .note-card__footer {
  border-top-color: rgba(255, 255, 255, 0.12);
}
.note-card__chip {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  background-color: rgba(0, 0, 0, 0.06);
  color: inherit;
}
.note-card__chip--link {
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-bs-theme="dark"] .note-card__chip {
  background-color: rgba(255, 255, 255, 0.12);
}
.note-card__menu {
  color: inherit;
  opacity: 0.55;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
.note-card__menu:hover,
.note-card__menu:focus-visible {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.08);
}
[data-bs-theme="dark"] .note-card__menu:hover,
[data-bs-theme="dark"] .note-card__menu:focus-visible {
  background-color: rgba(255, 255, 255, 0.14);
}

/* Color filter toolbar (index) */
.crm-note-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  box-shadow: var(--crm-shadow);
}
.crm-note-toolbar__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
}
.crm-note-toolbar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.crm-note-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--crm-border);
  background: var(--crm-surface-alt);
  color: var(--crm-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 2.25rem;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.crm-note-chip:hover,
.crm-note-chip:focus-visible {
  color: var(--crm-text);
  border-color: var(--crm-accent);
  transform: translateY(-1px);
}
.crm-note-chip.is-active {
  background: var(--crm-accent);
  border-color: var(--crm-accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(79, 110, 247, 0.3);
}
.crm-note-chip__dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.crm-note-chip.is-active .crm-note-chip__dot {
  border-color: rgba(255, 255, 255, 0.7);
}

/* Note detail hero */
.crm-note-hero__badge {
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}
[data-bs-theme="dark"] .crm-note-hero__badge {
  background: rgba(255, 255, 255, 0.14);
}
.crm-note-hero__footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
[data-bs-theme="dark"] .crm-note-hero__footer {
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* Note form actions */
.crm-note-form__actions .btn {
  min-height: 2.75rem;
}
@media (max-width: 575.98px) {
  .crm-note-form__actions .btn {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════
   Delivery route — app-style mobile-first UI
   ═══════════════════════════════════════════ */

.delivery-route-app {
  --dr-accent: #0a84ff;
  --dr-accent-soft: rgba(10, 132, 255, 0.1);
  --dr-accent-border: rgba(10, 132, 255, 0.22);
  --dr-success: #34c759;
  --dr-success-soft: rgba(52, 199, 89, 0.12);
  --dr-warning: #ff9500;
  --dr-warning-soft: rgba(255, 149, 0, 0.12);
  --dr-rail: #d1d1d6;
  --dr-metric-bg: #f2f2f7;
  min-height: 60vh;
  padding-bottom: 0.5rem;
}

[data-bs-theme="dark"] .delivery-route-app {
  --dr-accent: #409cff;
  --dr-accent-soft: rgba(64, 156, 255, 0.14);
  --dr-accent-border: rgba(64, 156, 255, 0.28);
  --dr-success: #30d158;
  --dr-success-soft: rgba(48, 209, 88, 0.14);
  --dr-warning: #ff9f0a;
  --dr-warning-soft: rgba(255, 159, 10, 0.14);
  --dr-rail: #48484a;
  --dr-metric-bg: #2c2c2e;
}

.delivery-route-app__header {
  margin-bottom: 1rem;
}

.delivery-route-app__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--dr-metric-bg);
  color: var(--crm-text);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 1px solid var(--crm-border);
}

.delivery-route-app__badge i {
  color: var(--dr-accent);
}

/* Hero metrics — iOS/Material-style surface card */
.delivery-route-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--crm-radius);
  margin-bottom: 1rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  box-shadow: var(--crm-shadow);
  color: var(--crm-text);
}

.delivery-route-hero__glow {
  display: none;
}

.delivery-route-hero__content {
  position: relative;
  padding: 1rem 1.05rem 1.05rem;
}

.delivery-route-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dr-accent);
  margin-bottom: 0.85rem;
  letter-spacing: 0.01em;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--dr-accent-soft);
}

.delivery-route-hero__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.delivery-route-hero__metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.65rem 0.35rem;
  border-radius: 12px;
  background: var(--dr-metric-bg);
  border: 1px solid var(--crm-border-light);
}

.delivery-route-hero__metric-value {
  font-size: clamp(1.15rem, 4.5vw, 1.4rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--crm-text);
  font-variant-numeric: tabular-nums;
}

.delivery-route-hero__metric-label {
  font-size: 0.65rem;
  color: var(--crm-text-muted);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.delivery-route-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.delivery-route-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--dr-metric-bg);
  color: var(--crm-text-secondary);
  border: 1px solid var(--crm-border-light);
}

.delivery-route-chip--success {
  background: var(--dr-success-soft);
  color: var(--dr-success);
  border-color: transparent;
}

.delivery-route-chip--warning {
  background: var(--dr-warning-soft);
  color: var(--dr-warning);
  border-color: transparent;
}

.delivery-route-chip--accent {
  background: var(--dr-accent-soft);
  color: var(--dr-accent);
  border-color: transparent;
}

.delivery-route-hero__note {
  font-size: 0.72rem;
  color: var(--crm-text-muted);
  line-height: 1.45;
  margin: 0 0 0.75rem;
}

/* Origin card */
.delivery-route-origin {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius);
  box-shadow: var(--crm-shadow);
}

.delivery-route-origin__icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--dr-metric-bg);
  color: var(--dr-accent);
  font-size: 1.1rem;
  border: 1px solid var(--crm-border-light);
}

.delivery-route-origin__body {
  flex: 1;
  min-width: 0;
}

.delivery-route-origin__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
  margin-bottom: 0.2rem;
}

.delivery-route-origin__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  color: var(--crm-text);
}

.delivery-route-origin__address {
  font-size: 0.82rem;
  color: var(--crm-text-secondary);
  margin-bottom: 0.45rem;
  line-height: 1.4;
}

.delivery-route-origin__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
}

.delivery-route-origin__status--ok {
  background: var(--dr-success-soft);
  color: var(--dr-success);
}

.delivery-route-origin__status--warn {
  background: var(--dr-warning-soft);
  color: var(--dr-warning);
}

.delivery-route-origin__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.delivery-route-origin__map-btn {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--crm-border);
  background: var(--dr-metric-bg);
  color: var(--dr-accent);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.delivery-route-origin__map-btn:hover,
.delivery-route-origin__map-btn:focus-visible {
  background: var(--dr-accent-soft);
  border-color: var(--dr-accent-border);
  color: var(--dr-accent);
}

/* Alert */
.delivery-route-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: var(--dr-warning-soft);
  border: 1px solid rgba(255, 149, 0, 0.22);
  color: var(--crm-text);
  font-size: 0.82rem;
  line-height: 1.45;
}

.delivery-route-alert i {
  color: var(--dr-warning);
  margin-top: 0.1rem;
  flex-shrink: 0;
}

/* Timeline */
.delivery-route-timeline {
  margin-bottom: 1rem;
}

.delivery-route-timeline__header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.75rem;
}

.delivery-route-timeline__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--crm-text);
}

.delivery-route-timeline__hint {
  font-size: 0.78rem;
  color: var(--crm-text-muted);
  margin: 0;
}

.delivery-route-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 80px;
}

.delivery-route-list.drag-over {
  background: var(--dr-accent-soft);
  border-radius: var(--crm-radius-sm);
}

/* Stop item */
.delivery-route-item {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.65rem;
  cursor: grab;
  touch-action: manipulation;
  transition: opacity 0.25s ease;
}

.delivery-route-item:hover .delivery-route-item__card {
  border-color: var(--dr-accent-border);
  box-shadow: var(--crm-shadow);
}

.delivery-route-item.dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.delivery-route-item.dragging .delivery-route-item__card {
  transform: scale(0.98);
}

.delivery-route-item--removed {
  opacity: 0;
  transform: translateX(100%);
}

.delivery-route-item__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.35rem;
}

.delivery-route-item__dot {
  flex-shrink: 0;
}

.delivery-route-item__connector {
  flex: 1;
  width: 2px;
  min-height: 1rem;
  margin: 0.25rem 0;
  background: var(--dr-rail);
  border-radius: 2px;
}

.delivery-route-stop-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: var(--dr-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  border: none;
  box-shadow: 0 2px 6px rgba(10, 132, 255, 0.28);
}

.delivery-route-item__card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem;
  margin-bottom: 0.65rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  box-shadow: var(--crm-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.delivery-route-item--last .delivery-route-item__card {
  margin-bottom: 0;
}

.delivery-route-item-main {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.delivery-route-item-body {
  flex: 1;
  min-width: 0;
}

.delivery-route-item-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.delivery-route-item-title {
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--crm-text);
}

.delivery-route-gps-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.delivery-route-gps-badge--ok {
  background: var(--dr-success-soft);
  color: var(--dr-success);
}

.delivery-route-gps-badge--warn {
  background: var(--dr-warning-soft);
  color: var(--dr-warning);
}

.delivery-route-item-customer {
  font-size: 0.88rem;
  color: var(--crm-text-secondary);
  font-weight: 500;
}

.delivery-route-address {
  font-size: 0.82rem;
  color: var(--crm-text-secondary);
  line-height: 1.4;
}

.delivery-route-distance {
  font-size: 0.76rem;
  color: var(--dr-accent);
  font-weight: 600;
}

.delivery-route-distance--muted {
  color: var(--crm-text-muted);
  font-weight: 500;
}

.delivery-route-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.delivery-route-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--crm-text-secondary);
  background: var(--dr-metric-bg);
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--crm-border-light);
}

.delivery-route-item-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.delivery-route-btn-delivered {
  background-color: var(--dr-success);
  border-color: var(--dr-success);
}

.delivery-route-btn-delivered:hover,
.delivery-route-btn-delivered:focus-visible {
  background-color: #2db84d;
  border-color: #2db84d;
}

[data-bs-theme="dark"] .delivery-route-stop-number {
  box-shadow: 0 2px 8px rgba(64, 156, 255, 0.35);
}

.delivery-route-btn-delivered,
.delivery-route-btn-map {
  min-height: 44px;
  font-weight: 600;
  font-size: 0.84rem;
  border-radius: var(--crm-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.delivery-route-reorder {
  display: flex;
  gap: 0.45rem;
  grid-column: 1 / -1;
}

.delivery-route-btn-move {
  flex: 1;
  min-height: 40px;
  border-radius: var(--crm-radius-sm);
  touch-action: manipulation;
}

/* Secondary actions */
.delivery-route-secondary-actions {
  margin-bottom: 1rem;
}

/* Sticky dock */
.delivery-route-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1035;
  background-color: color-mix(in srgb, var(--crm-surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--crm-border);
  box-shadow: 0 -4px 24px rgba(26, 29, 35, 0.1);
  padding: 0.65rem 0.85rem;
  padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  padding-left: calc(0.85rem + env(safe-area-inset-left, 0px));
  padding-right: calc(0.85rem + env(safe-area-inset-right, 0px));
}

.delivery-route-dock__inner {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  max-width: 1440px;
  margin: 0 auto;
}

.delivery-route-dock__btn {
  flex: 1;
  min-height: 48px;
  font-weight: 700;
  border-radius: var(--crm-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.delivery-route-dock__btn--primary {
  flex: 1.35;
  background-color: var(--dr-success);
  border-color: var(--dr-success);
}

.delivery-route-dock__btn--primary:hover,
.delivery-route-dock__btn--primary:focus-visible {
  background-color: #2db84d;
  border-color: #2db84d;
}

.delivery-route-dock .btn-primary {
  background-color: var(--dr-accent);
  border-color: var(--dr-accent);
}

.delivery-route-dock .btn-primary:hover,
.delivery-route-dock .btn-primary:focus-visible {
  background-color: #0070e0;
  border-color: #0070e0;
}

.delivery-route-dock__btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.delivery-route-dock-spacer {
  height: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

[data-bs-theme="dark"] .delivery-route-dock {
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

/* Empty state */
.delivery-route-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.25rem;
  background: var(--crm-surface);
  border: 2px dashed var(--crm-border);
  border-radius: var(--crm-radius);
}

.delivery-route-empty__icon {
  width: 4.5rem;
  height: 4.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--dr-metric-bg);
  color: var(--crm-text-muted);
  font-size: 2rem;
  margin-bottom: 1rem;
  border: 1px solid var(--crm-border-light);
}

.delivery-route-empty__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--crm-text);
}

.delivery-route-empty__text {
  font-size: 0.88rem;
  color: var(--crm-text-muted);
  max-width: 28rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .delivery-route-app__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .delivery-route-hero__content {
    padding: 1.25rem 1.5rem 1.35rem;
  }

  .delivery-route-item {
    grid-template-columns: 2.75rem 1fr;
    gap: 0.85rem;
  }

  .delivery-route-item__card {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    padding: 1rem 1.15rem;
  }

  .delivery-route-item-main {
    flex: 1;
  }

  .delivery-route-item-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 148px;
    grid-template-columns: none;
  }

  .delivery-route-reorder {
    grid-column: auto;
  }
}

@media (min-width: 992px) {
  .delivery-route-item-actions {
    flex-direction: row;
    align-items: center;
    min-width: auto;
    gap: 0.45rem;
  }

  .delivery-route-reorder {
    flex-direction: column;
    width: auto;
  }

  .delivery-route-btn-move {
    width: 40px;
    flex: 0 0 auto;
  }

  .delivery-route-dock__inner {
    max-width: 480px;
    margin-inline: auto;
  }
}

/* ═══════════════════════════════════════════
   Customers index — mobile-first modern list
   ═══════════════════════════════════════════ */

/* Page header */
.crm-page-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.crm-page-header__title {
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--crm-text);
  margin: 0;
}
.crm-page-header__subtitle {
  font-size: 0.875rem;
  color: var(--crm-text-secondary);
  margin: 0;
}
.crm-page-header__actions {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}
.crm-page-header__actions .btn {
  flex: 1 1 auto;
  min-height: 2.75rem;
}

/* Filter bar */
.crm-filter-bar {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0;
}
.crm-filter-bar__search {
  position: relative;
}
.crm-filter-bar__search .form-control {
  padding-left: 2.5rem;
}
.crm-filter-bar__search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--crm-text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.crm-filter-bar__actions {
  display: flex;
  gap: 0.5rem;
}
.crm-filter-bar__actions .btn {
  min-height: 2.75rem;
  flex: 1 1 auto;
}

/* Customer cards (mobile) */
.crm-customer-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  box-shadow: var(--crm-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.crm-customer-card:hover {
  box-shadow: var(--crm-shadow-md);
  border-color: rgba(79, 110, 247, 0.25);
}
.crm-customer-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.crm-customer-card__avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--crm-accent-light);
  color: var(--crm-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.crm-customer-card__info {
  flex: 1;
  min-width: 0;
}
.crm-customer-card__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--crm-text);
  line-height: 1.3;
}
.crm-customer-card__legal {
  font-size: 0.8rem;
  color: var(--crm-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-customer-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
}
.crm-customer-card__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.crm-customer-card__meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
}
.crm-customer-card__meta-value {
  color: var(--crm-text);
  font-weight: 500;
}
.crm-customer-card__address {
  font-size: 0.8rem;
  color: var(--crm-text-secondary);
  line-height: 1.4;
}
.crm-customer-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--crm-border-light);
}
.crm-customer-card__actions .btn {
  min-height: 2.75rem;
}
.crm-customer-card__actions .btn-danger-wide {
  grid-column: 1 / -1;
}

/* Results count */
.crm-results-count {
  font-size: 0.85rem;
  color: var(--crm-text-secondary);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* Empty state tweaks */
.crm-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.crm-empty-state i {
  font-size: 3.5rem;
  color: var(--crm-text-muted);
  opacity: 0.35;
}
.crm-empty-state h5 {
  font-weight: 700;
  color: var(--crm-text-secondary);
  margin-top: 1.25rem;
}
.crm-empty-state p {
  color: var(--crm-text-muted);
  font-size: 0.95rem;
}
.crm-empty-state__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
  margin: 1.25rem auto 0;
}

/* FAB for mobile */
.crm-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 1040;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(79, 110, 247, 0.35);
}
.crm-fab:hover,
.crm-fab:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(79, 110, 247, 0.42);
}
.crm-fab:active {
  transform: scale(0.96);
}

/* Responsive filter bar and header */
@media (min-width: 768px) {
  .crm-page-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }
  .crm-page-header__actions {
    width: auto;
  }
  .crm-page-header__actions .btn {
    flex: 0 0 auto;
  }
  .crm-filter-bar {
    grid-template-columns: 2fr 1fr 1fr auto auto;
    align-items: end;
  }
  .crm-filter-bar__actions {
    flex-direction: row;
  }
  .crm-filter-bar__actions .btn {
    flex: 0 0 auto;
  }
  .crm-customer-card__actions {
    grid-template-columns: repeat(3, 1fr);
  }
  .crm-customer-card__actions .btn-danger-wide {
    grid-column: auto;
  }
  .crm-empty-state__actions {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }
}

@media (min-width: 992px) {
  .crm-filter-bar {
    grid-template-columns: 2.5fr 1fr 1fr auto auto;
  }
}

/* ═══════════════════════════════════════════
   Products index — mobile-first modern list
   ═══════════════════════════════════════════ */

.crm-product-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  box-shadow: var(--crm-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.crm-product-card:hover {
  box-shadow: var(--crm-shadow-md);
  border-color: rgba(79, 110, 247, 0.25);
}
.crm-product-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.crm-product-card__avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--crm-radius-sm);
  background: var(--crm-accent-light);
  color: var(--crm-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.crm-product-card__info {
  flex: 1;
  min-width: 0;
}
.crm-product-card__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--crm-text);
  line-height: 1.3;
}
.crm-product-card__key {
  font-size: 0.8rem;
  color: var(--crm-text-secondary);
  font-family: var(--bs-font-monospace, monospace);
}
.crm-product-card__price-tag {
  text-align: right;
  flex-shrink: 0;
}
.crm-product-card__price-tag .label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
}
.crm-product-card__price-tag .value {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--crm-accent);
  line-height: 1.2;
}
.crm-product-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
}
.crm-product-card__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.crm-product-card__meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
}
.crm-product-card__meta-value {
  color: var(--crm-text);
  font-weight: 500;
}
.crm-product-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--crm-border-light);
}
.crm-product-card__actions .btn {
  min-height: 2.75rem;
}
.crm-product-card__actions .btn-danger-wide {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .crm-product-card__actions {
    grid-template-columns: repeat(3, 1fr);
  }
  .crm-product-card__actions .btn-danger-wide {
    grid-column: auto;
  }
}

/* ═══════════════════════════════════════════
   Data grid — compact software-style records table
   ═══════════════════════════════════════════ */

.crm-data-table {
  margin-bottom: 0;
  font-size: 0.8125rem;
}
.crm-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--crm-surface-2, var(--crm-hover));
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: var(--crm-text-muted);
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--crm-border);
  white-space: nowrap;
}
.crm-data-table tbody td {
  padding: 0.4rem 0.85rem;
  line-height: 1.3;
  vertical-align: middle;
  border-top: 1px solid var(--crm-border-light);
  color: var(--crm-text);
}
.crm-data-table tbody tr:first-child td {
  border-top: 0;
}
.crm-data-table tbody tr:nth-child(even) {
  background-color: color-mix(in srgb, var(--crm-hover) 45%, transparent);
}
.crm-data-table.table-hover tbody tr:hover {
  background-color: var(--crm-hover);
}
/* Desktop-software style action toolbar within the grid */
.crm-data-table .btn-actions {
  gap: 0.25rem;
  justify-content: flex-end;
}
.crm-data-table .btn-action {
  --btn-action-size: 2rem;
  width: var(--btn-action-size);
  height: var(--btn-action-size);
  border: 1px solid transparent;
  border-radius: 8px;
  background-color: transparent;
  color: var(--crm-text-muted);
  font-size: 0.875rem;
  box-shadow: none;
}
.crm-data-table .btn-action.btn-action-view {
  color: var(--crm-text-muted);
  background-color: transparent;
}
.crm-data-table .btn-action.btn-action-edit {
  color: var(--crm-text-muted);
  background-color: transparent;
}
.crm-data-table .btn-action.btn-action-delete {
  color: var(--crm-text-muted);
  background-color: transparent;
}
.crm-data-table .btn-action:hover,
.crm-data-table .btn-action:focus-visible {
  transform: none;
  box-shadow: none;
}
.crm-data-table .btn-action.btn-action-view:hover,
.crm-data-table .btn-action.btn-action-view:focus-visible {
  color: var(--crm-text);
  background-color: var(--crm-hover);
  border-color: var(--crm-border-light);
}
.crm-data-table .btn-action.btn-action-edit {
  color: var(--crm-text-muted);
  background-color: transparent;
}
.crm-data-table .btn-action.btn-action-edit:hover,
.crm-data-table .btn-action.btn-action-edit:focus-visible {
  color: var(--crm-accent);
  background-color: var(--crm-accent-light);
  border-color: transparent;
}
.crm-data-table .btn-action.btn-action-delete {
  color: var(--crm-text-muted);
  background-color: transparent;
}
.crm-data-table .btn-action.btn-action-delete:hover,
.crm-data-table .btn-action.btn-action-delete:focus-visible {
  color: #dc3545;
  background-color: rgba(220, 53, 69, 0.1);
  border-color: transparent;
}
[data-bs-theme="dark"] .crm-data-table .btn-action {
  background-color: transparent;
}
[data-bs-theme="dark"] .crm-data-table .btn-action.btn-action-delete:hover,
[data-bs-theme="dark"] .crm-data-table .btn-action.btn-action-delete:focus-visible {
  color: #f58da0;
  background-color: rgba(220, 53, 69, 0.15);
}

/* ═══════════════════════════════════════════
   Customers index — mobile app list + desktop software grid
   ═══════════════════════════════════════════ */

.crm-customers-index {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.crm-customers-filters {
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding: 0.75rem;
}

.crm-customers-filters__form {
  margin: 0;
}

.crm-customers-filters__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
  margin-bottom: 0.35rem;
}

.crm-customers-filters .form-control,
.crm-customers-filters .form-select {
  min-height: 2.75rem;
  font-size: 0.9375rem;
}

.crm-customers-filters .crm-filter-bar__search {
  display: flex;
  flex-direction: column;
}

.crm-customers-filters .crm-filter-bar__search-icon {
  top: auto;
  bottom: 0.9rem;
  transform: none;
}

.crm-customers-index .crm-results-count {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--crm-text-muted);
}

.crm-customers-panel {
  background: var(--crm-surface);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  overflow: hidden;
}

.crm-customers-panel__footer {
  padding: 0.75rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--crm-border-light);
  background: var(--crm-surface-alt);
}

/* Mobile app-style list rows */
.crm-customers-list {
  display: flex;
  flex-direction: column;
}

.crm-customer-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--crm-border-light);
  background: var(--crm-surface);
}

.crm-customer-row:last-child {
  border-bottom: 0;
}

.crm-customer-row__main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  min-height: 4.25rem;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.15s ease;
}

.crm-customer-row__main:hover,
.crm-customer-row__main:focus-visible {
  background: var(--crm-hover);
  color: inherit;
}

.crm-customer-row__main:active {
  background: color-mix(in srgb, var(--crm-accent-light) 55%, var(--crm-hover));
}

.crm-customer-row__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--crm-accent-light);
  color: var(--crm-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.crm-customer-row__body {
  flex: 1;
  min-width: 0;
}

.crm-customer-row__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.crm-customer-row__name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
  color: var(--crm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-customer-row__badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  line-height: 1.1;
}

.crm-customer-row__legal {
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: var(--crm-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-customer-row__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--crm-text-muted);
  line-height: 1.25;
}

.crm-customer-row__code {
  font-weight: 600;
  color: var(--crm-text-secondary);
}

.crm-customer-row__rfc {
  font-family: var(--bs-font-monospace, ui-monospace, monospace);
  letter-spacing: 0.01em;
}

.crm-customer-row__sep {
  opacity: 0.55;
}

.crm-customer-row__chevron {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--crm-text-muted);
  opacity: 0.7;
}

.crm-customer-row__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0 0.9rem 0.75rem;
}

.crm-customer-row__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--crm-radius-xs);
  border: 1px solid var(--crm-border);
  background: var(--crm-surface-alt);
  color: var(--crm-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.crm-customer-row__action:hover,
.crm-customer-row__action:focus-visible {
  color: var(--crm-text);
  background: var(--crm-hover);
  border-color: var(--crm-border);
}

.crm-customer-row__action--edit:hover,
.crm-customer-row__action--edit:focus-visible {
  color: var(--crm-accent);
  background: var(--crm-accent-light);
  border-color: transparent;
}

.crm-customer-row__action--delete:hover,
.crm-customer-row__action--delete:focus-visible {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
  border-color: transparent;
}

/* Desktop software data grid refinements */
.crm-customers-table-wrap {
  max-height: calc(100vh - 16rem);
  overflow: auto;
}

.crm-customers-table .crm-customers-table__identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.crm-customers-table .crm-customers-table__avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--crm-accent-light);
  color: var(--crm-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.crm-customers-table .crm-customers-table__names {
  min-width: 0;
}

.crm-customers-table .crm-customers-table__name {
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.2;
  color: var(--crm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22ch;
}

.crm-customers-table .crm-customers-table__legal {
  font-size: 0.72rem;
  color: var(--crm-text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 28ch;
}

.crm-customers-table .crm-customers-table__code {
  font-weight: 600;
  font-size: 0.8rem;
  font-family: var(--bs-font-monospace, ui-monospace, monospace);
  white-space: nowrap;
}

.crm-customers-table .crm-customers-table__rfc {
  font-family: var(--bs-font-monospace, ui-monospace, monospace);
  font-size: 0.78rem;
  color: var(--crm-text-secondary);
  white-space: nowrap;
}

.crm-customers-table .crm-customers-table__badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  line-height: 1.1;
}

.crm-customers-table .crm-customers-table__address {
  display: inline-block;
  max-width: 28ch;
  font-size: 0.78rem;
  color: var(--crm-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.crm-customers-table .crm-customers-table__address--empty {
  font-style: italic;
  color: var(--crm-text-muted);
}

@media (min-width: 768px) {
  .crm-customers-index {
    gap: 1rem;
    padding-bottom: 0;
  }

  .crm-customers-filters {
    padding: 1rem 1.15rem;
    border-radius: var(--crm-radius-sm);
  }

  .crm-customers-filters .crm-filter-bar {
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: end;
  }

  .crm-customers-filters .crm-filter-bar__actions {
    display: flex;
  }

  .crm-customers-filters .crm-filter-bar__actions .btn {
    flex: 0 0 auto;
    min-height: 2.5rem;
  }

  .crm-customers-filters .form-control,
  .crm-customers-filters .form-select {
    min-height: 2.5rem;
    font-size: 0.875rem;
  }

  .crm-customers-filters .crm-filter-bar__search-icon {
    top: auto;
    bottom: 0.8rem;
    transform: none;
  }

  .crm-customers-panel {
    border-radius: var(--crm-radius-xs);
    box-shadow: var(--crm-shadow);
  }

  .crm-customers-panel__footer {
    padding: 0.65rem 1rem;
  }

  .crm-customers-table tbody td {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }
}

@media (min-width: 992px) {
  .crm-customers-filters .crm-filter-bar {
    grid-template-columns: 2.5fr 1fr 1.1fr auto;
  }

  .crm-customers-table .crm-customers-table__name {
    max-width: 32ch;
  }

  .crm-customers-table .crm-customers-table__legal {
    max-width: 40ch;
  }

  .crm-customers-table .crm-customers-table__address {
    max-width: 40ch;
  }
}

@media (max-width: 767.98px) {
  .crm-customers-index .crm-page-header {
    margin-bottom: 0;
    gap: 0.5rem;
  }

  .crm-customers-index .crm-page-header__title {
    font-size: 1.35rem;
  }

  .crm-customers-filters {
    border-radius: var(--crm-radius-xs);
    padding: 0.65rem;
  }

  .crm-customers-filters .crm-filter-bar {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .crm-customers-panel {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin-left: -1rem;
    margin-right: -1rem;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *



 */
