/* Espaços VECONI V2 — identidade global e seletor compartilhado pela Home, Vender e cadastros. */
.space-context-bar {
  --space-accent: #078d70;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #dce7e3;
  border-radius: 16px;
  background: linear-gradient(120deg, #fff 0%, #f5fcfa 100%);
  box-shadow: 0 5px 18px rgba(31, 58, 73, 0.045);
  color: #17233b;
}

.space-context-bar label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.space-context-bar label > span,
.space-context-bar.is-single > span {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: #647286;
  font-size: 0.75rem;
  font-weight: 750;
}

.space-context-bar label > span svg,
.space-context-bar.is-single > span svg {
  width: 17px;
  height: 17px;
  color: var(--space-accent);
}

.space-context-bar select {
  width: min(100%, 340px);
  min-width: 0;
  height: 40px;
  border: 1px solid #cfdcd8;
  border-radius: 11px;
  background: #fff;
  padding: 0 34px 0 12px;
  color: #17233b;
  font: inherit;
  font-weight: 800;
  text-overflow: ellipsis;
}

.space-context-bar select:focus-visible {
  outline: 3px solid rgba(8, 169, 130, 0.17);
  border-color: var(--space-accent);
}

.space-selector-trigger {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px !important;
  width: min(100%, 390px);
  min-width: 0;
  min-height: 48px !important;
  border-color: #cfe0da !important;
  padding: 5px 11px 5px 6px !important;
  text-align: left;
}

.space-selector-icon,
.space-picker-option-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e5f8f3;
  color: var(--space-accent);
}

.space-selector-icon svg,
.space-picker-option-icon svg {
  width: 19px;
  height: 19px;
}

.space-selector-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.space-selector-copy small {
  color: #748195;
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.1;
}

.space-selector-copy strong {
  overflow: hidden;
  color: #17233b;
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-selector-chevron {
  width: 17px !important;
  height: 17px !important;
  color: #68778c;
}

.space-context-bar > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border: 1px solid #d6e3df;
  border-radius: 11px;
  background: #fff;
  padding: 0 12px;
  color: #405066;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.space-context-bar > button:hover {
  border-color: #a7d9cc;
  background: #edf9f6;
  color: var(--space-accent);
}

.space-context-bar > button svg {
  width: 17px;
  height: 17px;
}

.space-picker-modal {
  width: min(520px, 100%);
  max-height: min(720px, calc(100dvh - 24px));
  overflow: hidden;
}

.space-picker-modal .modal-head {
  align-items: flex-start;
}

.space-picker-modal .modal-head > div {
  min-width: 0;
}

.space-picker-modal .modal-head h3,
.space-picker-modal .modal-head p {
  margin: 0;
}

.space-picker-modal .modal-head p {
  margin-top: 4px;
  color: #718095;
  font-size: 0.76rem;
  line-height: 1.4;
}

.space-picker-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

.space-picker-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 62px;
  border: 1px solid #dde6e3;
  border-radius: 15px;
  background: #fff;
  padding: 9px 11px;
  color: #1c2940;
  text-align: left;
}

.space-picker-option:hover {
  border-color: #a8dcd0;
  background: #f4fbf9;
}

.space-picker-option:focus-visible {
  outline: 3px solid rgba(8, 169, 130, 0.18);
  outline-offset: 1px;
}

.space-picker-option.is-selected {
  border-color: #78cdbb;
  background: #eaf9f5;
  box-shadow: inset 3px 0 #0aa581;
}

.space-picker-option > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.space-picker-option b,
.space-picker-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-picker-option b {
  font-size: 0.88rem;
}

.space-picker-option small {
  color: #6e7d91;
  font-size: 0.72rem;
}

.space-picker-check {
  width: 19px;
  height: 19px;
  color: #9aa6b5;
}

.space-picker-option.is-selected .space-picker-check {
  color: #078d70;
  stroke-width: 3;
}

.space-picker-manage {
  min-height: 44px;
}

.space-context-bar.is-single {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.space-context-bar.is-single > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-data-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #f0d8a4;
  border-radius: 13px;
  background: #fffaf0;
  color: #674a10;
}

.space-data-notice > svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #bf7900;
}

.space-data-notice > span {
  min-width: 0;
}

.space-data-notice b,
.space-data-notice small {
  display: block;
}

.space-data-notice b {
  font-size: 0.78rem;
}

.space-data-notice small {
  margin-top: 2px;
  color: #826832;
  font-size: 0.69rem;
  line-height: 1.35;
}

.desktop-space-goal {
  display: grid;
  grid-template-columns: 42px minmax(170px, 1fr) minmax(220px, 0.9fr) auto auto;
  align-items: center;
  gap: 13px;
  min-width: 0;
  min-height: 76px;
  padding: 12px 15px;
  border: 1px solid #cfe8e1;
  border-radius: 16px;
  background: linear-gradient(110deg, #f2fcf9, #fff);
  color: #17233b;
  box-shadow: 0 5px 18px rgba(31, 58, 73, 0.04);
}

button.desktop-space-goal {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.desktop-space-goal-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #dff7f0;
  color: #078d70;
}

.desktop-space-goal-icon svg {
  width: 21px;
}

.desktop-space-goal-copy {
  min-width: 0;
}

.desktop-space-goal-copy b,
.desktop-space-goal-copy small {
  display: block;
}

.desktop-space-goal-copy b {
  font-size: 0.84rem;
}

.desktop-space-goal-copy small {
  margin-top: 3px;
  color: #718093;
  font-size: 0.68rem;
  line-height: 1.35;
}

.desktop-space-goal-values {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.desktop-space-goal-values > span {
  color: #647286;
  font-size: 0.72rem;
  white-space: nowrap;
}

.desktop-space-goal-values strong {
  color: #087d64;
  font-size: 0.92rem;
}

.desktop-space-goal-values > div {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #dce8e5;
}

.desktop-space-goal-values i {
  display: block;
  width: var(--space-goal-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #08a982, #43d9ae);
}

.desktop-space-goal > em {
  min-width: 52px;
  color: #087d64;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.desktop-space-goal > button,
.desktop-space-goal.is-empty > strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 10px;
  background: #e4f7f1;
  padding: 9px 11px;
  color: #087d64;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 850;
  white-space: nowrap;
}

.desktop-space-goal > button svg,
.desktop-space-goal.is-empty > strong svg {
  width: 14px;
}

.desktop-space-goal.is-empty {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.desktop-space-goal.is-reached {
  border-color: #aaddcd;
  background: linear-gradient(110deg, #eafaf5, #fff);
}

.space-manager-modal,
.space-form-modal {
  width: min(680px, calc(100vw - 28px));
  max-height: min(780px, calc(100dvh - 28px));
  overflow: auto;
}

.space-manager-modal .modal-head > div > small,
.space-form-modal .modal-head > div > small {
  color: #078d70;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.space-manager-modal .modal-head h3,
.space-form-modal .modal-head h3 {
  margin-top: 3px;
}

.space-manager-help {
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #f3f7f8;
  color: #5f6d80;
  font-size: 0.78rem;
  line-height: 1.45;
}

.space-manager-list {
  display: grid;
  gap: 9px;
}

.space-manager-list article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #e1e7eb;
  border-radius: 13px;
  background: #fff;
}

.space-manager-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #e5f8f2;
  color: #078d70;
}

.space-manager-icon svg {
  width: 21px;
}

.space-manager-list article > div {
  min-width: 0;
}

.space-manager-list article b,
.space-manager-list article small,
.space-manager-list article em {
  display: block;
}

.space-manager-list article b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.space-manager-list article small {
  margin-top: 3px;
  color: #69778b;
  font-size: 0.7rem;
  line-height: 1.35;
}

.space-manager-list article em {
  margin-top: 4px;
  color: #a16908;
  font-size: 0.66rem;
  font-style: normal;
}

.space-manager-list article > button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  border: 1px solid #dbe4e2;
  border-radius: 10px;
  background: #f8fbfa;
  padding: 0 10px;
  color: #405066;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
}

.space-manager-list article > button svg {
  width: 14px;
}

.space-capabilities,
.product-space-availability {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.space-capabilities legend,
.product-space-availability legend {
  margin-bottom: 9px;
  color: #26364d;
  font-size: 0.82rem;
  font-weight: 850;
}

.space-capabilities > label,
.product-space-availability > label:not(.product-space-single) {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #e0e6ea;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.space-capabilities input,
.product-space-availability input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: #078d70;
}

.space-capabilities label > span,
.product-space-availability label > span {
  min-width: 0;
}

.space-capabilities label > span > svg {
  float: left;
  width: 18px;
  margin-right: 7px;
  color: #078d70;
}

.space-capabilities b,
.space-capabilities small,
.product-space-availability b,
.product-space-availability small {
  display: block;
}

.space-capabilities b,
.product-space-availability b {
  font-size: 0.8rem;
}

.space-capabilities small,
.product-space-availability small {
  margin-top: 3px;
  color: #6e7b8d;
  font-size: 0.69rem;
  line-height: 1.35;
}

.space-capabilities > label:has(input:checked),
.product-space-availability > label:has(input:checked) {
  border-color: #a9ddd0;
  background: #f0fbf8;
}

.product-space-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
  border-radius: 12px;
  background: #f3f6f8;
}

.product-space-checks[hidden],
.product-space-single[hidden] {
  display: none !important;
}

.product-space-checks label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border-radius: 9px;
  background: #fff;
  color: #314159;
  font-size: 0.74rem;
  font-weight: 750;
}

.product-space-checks label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-space-single {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: #f3f6f8;
  color: #45556c;
  font-size: 0.74rem;
  font-weight: 800;
}

.product-space-single select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d8e0e5;
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
  color: #26364d;
  font: inherit;
}

@media (max-width: 767px) {
  .space-context-bar {
    gap: 8px;
    padding: 9px;
    border-radius: 15px;
  }

  .space-context-bar label {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .space-context-bar label > span,
  .space-context-bar.is-single > span {
    font-size: 0.66rem;
  }

  .space-context-bar select {
    width: 100%;
    height: 44px;
    font-size: 0.8rem;
  }

  .space-context-bar > button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0;
  }

  .space-context-bar > button:not(.space-selector-trigger) > span {
    display: none;
  }

  .space-context-bar.is-home {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .space-selector-trigger {
    width: 100% !important;
    height: 48px !important;
    padding: 5px 10px 5px 5px !important;
  }

  .space-selector-trigger .space-selector-icon,
  .space-selector-trigger .space-selector-copy {
    display: grid;
  }

  .space-picker-modal {
    width: min(100%, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    border-radius: 22px 22px 8px 8px;
  }

  .space-picker-modal .modal-head {
    padding: 16px 17px 14px;
  }

  .space-picker-modal .modal-body {
    padding: 12px;
  }

  .space-picker-modal .modal-foot {
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  }

  .space-picker-option {
    min-height: 64px;
  }

  .space-context-bar.is-single {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .space-context-bar.is-single > span {
    display: none;
  }

  .space-context-bar.is-single > strong {
    padding-left: 4px;
    font-size: 0.84rem;
  }

  .space-data-notice {
    padding: 9px 10px;
  }

  .space-data-notice small {
    font-size: 0.65rem;
  }

  .desktop-space-goal {
    display: none;
  }

  .space-manager-modal,
  .space-form-modal {
    width: min(100%, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
  }

  .space-manager-list article {
    grid-template-columns: 40px minmax(0, 1fr) 44px;
    gap: 8px;
    padding: 9px;
  }

  .space-manager-icon {
    width: 40px;
    height: 40px;
  }

  .space-manager-list article > button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .space-manager-list article > button svg {
    width: 15px;
    margin: auto;
  }

  .space-manager-modal .modal-foot,
  .space-form-modal .modal-foot {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .space-manager-modal .icon-btn,
  .space-form-modal .icon-btn,
  .space-picker-modal .icon-btn,
  .home-goal-modal .icon-btn {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
  }

  .product-space-checks {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1000px) {
  .desktop-space-goal {
    grid-template-columns: 42px minmax(150px, 1fr) minmax(180px, 0.8fr) auto;
  }

  .desktop-space-goal > em {
    display: none;
  }
}

@media (max-width: 350px) {
  .space-context-bar {
    grid-template-columns: minmax(0, 1fr) 44px;
    padding: 8px;
  }

  .space-context-bar > button {
    width: 44px;
    min-width: 44px;
  }

  .space-context-bar select {
    padding-left: 9px;
    font-size: 0.75rem;
  }

  .space-selector-trigger {
    grid-template-columns: 36px minmax(0, 1fr) 16px;
    gap: 7px !important;
  }

  .space-selector-icon {
    width: 36px;
    height: 36px;
  }

  .space-manager-list article small {
    font-size: 0.64rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-space-goal-values i {
    transition: none;
  }
}
