/* P7CO Surplus form (Wolmart, no Bootstrap) */

.p7co-surplus-form {
  margin-top: 1.5rem;
}

.p7co-validation-summary {
  border: 1px solid rgba(17, 17, 17, 0.9);
  background: #111;
  color: #fff;
  border-radius: 0.35rem;
  padding: 1.05rem 1.15rem;
  margin-top: 1.1rem;
  margin-bottom: 1.1rem;
}

.p7co-validation-summary__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.p7co-validation-summary__title {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
}

.p7co-validation-summary__title i {
  color: #ffcf33;
}

.p7co-validation-summary__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  font-size: 1.45rem;
  line-height: 1;
}

.p7co-validation-summary__close:hover {
  color: #fff;
}

.p7co-validation-summary__list {
  margin: 0.8rem 0 0;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 1.25rem;
}

.p7co-validation-summary__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.p7co-surplus-accordion {
  margin-top: 1.25rem;
}

.p7co-accordion-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.p7co-subtitle {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: #222;
}

.p7co-form-grid {
  display: grid;
  gap: 1rem;
}

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

.p7co-form-grid.p7co-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.p7co-form-grid.p7co-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.p7co-span-2 {
  grid-column: span 2;
}

.p7co-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.p7co-field--compact {
  margin-top: 0.25rem;
}

.p7co-label {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
}

.p7co-required {
  color: #c81e1e;
  font-weight: 700;
  margin-left: 0.2rem;
}

.p7co-input,
.p7co-select,
.p7co-textarea {
  width: 100%;
  border: 1px solid #e5e5e5;
  border-radius: 0.35rem;
  padding: 0.9rem 1rem;
  font-size: 1.4rem;
  background: #fff;
  color: #222;
}

.p7co-input--sm {
  padding: 0.7rem 0.9rem;
  font-size: 1.35rem;
}

.p7co-textarea {
  resize: vertical;
  min-height: 11rem;
}

.p7co-input:focus,
.p7co-select:focus,
.p7co-textarea:focus {
  outline: none;
  border-color: #336699;
  box-shadow: 0 0 0 0.15rem rgba(51, 102, 153, 0.18);
}

.p7co-input[readonly],
.p7co-textarea[readonly] {
  background: #f7f7f7;
  color: #555;
}

.p7co-help {
  font-size: 1.25rem;
  color: #777;
  margin-top: 0.35rem;
}

.p7co-note {
  border: 1px solid #eee;
  background: #fafafa;
  border-radius: 0.35rem;
  padding: 0.8rem 1rem;
  font-size: 1.25rem;
  color: #555;
}

.p7co-form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.p7co-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.25rem;
  border-radius: 0.35rem;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
}

.p7co-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.p7co-btn-primary {
  background: #336699;
  border-color: #336699;
  color: #fff;
}

.p7co-btn-primary:hover {
  background: #2d5c88;
  border-color: #2d5c88;
  color: #fff;
}

.p7co-btn-outline {
  background: #fff;
  border-color: #336699;
  color: #336699;
}

.p7co-btn-outline:hover {
  background: #336699;
  color: #fff;
}

.p7co-btn-ghost {
  background: #fff;
  border-color: #e5e5e5;
  color: #333;
}

.p7co-btn-ghost:hover {
  border-color: #cfcfcf;
}

.p7co-check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
}

.p7co-check__input {
  margin-top: 0.15rem;
  width: 1.6rem;
  height: 1.6rem;
}

.p7co-check__label {
  font-size: 1.3rem;
  color: #333;
  line-height: 1.4;
}

.p7co-repeat-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.p7co-repeat-item {
  border: 1px solid #eee;
  border-radius: 0.35rem;
  padding: 1rem;
  background: #fff;
}

.p7co-chip-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.p7co-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  background: #f7f7f7;
  font-size: 1.2rem;
  color: #333;
}

.p7co-engineering-empty {
  font-size: 1.25rem;
  color: #777;
}

.p7co-engineering-count {
  margin-top: 0.35rem;
  font-size: 1.25rem;
  color: #777;
}

.p7co-engineering-hint {
  margin: 0;
  font-size: 1.25rem;
  color: #777;
}

.p7co-engineering-summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.p7co-engineering-summary__main {
  min-width: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.p7co-engineering-summary__actions {
  flex: 0 0 auto;
}

.p7co-eng-modal.modal__container {
  padding: 22px;
  overflow: hidden;
}

.p7co-eng-modal .modal__content {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

.p7co-eng-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  height: 60vh;
}

.p7co-eng-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.p7co-eng-colhead {
  margin-bottom: 0.5rem;
}

.p7co-eng-coltitle {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  color: #333;
}

.p7co-eng-scroll {
  border: 1px solid #eee;
  border-radius: 0.35rem;
  background: #fff;
  padding: 0.4rem;
  overflow: auto;
  min-height: 0;
  height: 100%;
}

.p7co-eng-scroll--materials {
  padding: 0.6rem;
}

.p7co-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.p7co-category-item {
  cursor: pointer;
  padding: 0.65rem 0.8rem;
  border-radius: 0.35rem;
  border: 1px solid transparent;
  font-size: 1.3rem;
  color: #333;
}

.p7co-category-item:hover {
  background: #f5f7fa;
  border-color: #eef1f4;
}

.p7co-category-item.is-active {
  background: #336699;
  color: #fff;
  border-color: #336699;
}

.p7co-eng-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.p7co-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  background: #f7f7f7;
  font-size: 1.2rem;
  color: #333;
  white-space: nowrap;
}

.p7co-materials-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.p7co-material-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.55rem 0.4rem;
  border-radius: 0.35rem;
  cursor: pointer;
}

.p7co-material-row:hover {
  background: #f5f7fa;
}

.p7co-material-row.is-selected {
  background: rgba(51, 102, 153, 0.08);
}

.p7co-material-checkbox {
  margin-top: 0.2rem;
  width: 1.6rem;
  height: 1.6rem;
}

.p7co-material-label {
  font-size: 1.3rem;
  color: #333;
  line-height: 1.35;
}

.p7co-engineering-warning {
  margin-top: 0.6rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.06);
  color: #b91c1c;
  font-size: 1.25rem;
}

.p7co-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.p7co-geo {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.p7co-geo__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.p7co-geo__fields {
  margin-top: 0.5rem;
}

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

.p7co-image-slot {
  border: 1px solid #eee;
  border-radius: 0.35rem;
  background: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.p7co-image-slot__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.p7co-image-slot__label {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

.p7co-image-slot__preview {
  border: 1px dashed #e5e5e5;
  border-radius: 0.35rem;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  overflow: hidden;
}

.p7co-image-slot__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p7co-image-slot__empty {
  font-size: 1.2rem;
  color: #888;
}

.p7co-docs {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.p7co-docs__block {
  border: 1px solid #eee;
  border-radius: 0.35rem;
  background: #fff;
  padding: 1rem;
}

.p7co-docs__title {
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #222;
}

.p7co-docs__item {
  border-top: 1px dashed #eee;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
}

.p7co-surplus-accordion .card,
.p7co-surplus-accordion .card-body {
  background: transparent;
  box-shadow: none;
}

@media (max-width: 991px) {
  .p7co-form-grid.p7co-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p7co-form-grid.p7co-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .p7co-image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .p7co-form-grid.p7co-grid-2,
  .p7co-form-grid.p7co-grid-3,
  .p7co-form-grid.p7co-grid-4 {
    grid-template-columns: 1fr;
  }
  .p7co-span-2 {
    grid-column: auto;
  }
  .p7co-eng-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .p7co-eng-scroll {
    max-height: 35vh;
    height: auto;
  }
  .p7co-image-grid {
    grid-template-columns: 1fr;
  }
  .p7co-form-actions {
    justify-content: stretch;
  }
  .p7co-form-actions .p7co-btn {
    flex: 1 1 100%;
  }
}

/* ============================= */
/* Engenharia (tabs + dimensões) */
/* ============================= */

.p7co-engineering-inline {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #e5e5e5;
}

/* Inline dimensions list: keep it visible even when MicroModal is absent */
.p7co-engineering-inline #engineeringDimensionResults {
  display: block !important;
  background: linear-gradient(135deg, #f9fbfb 0%, #ffffff 100%);
  padding: 1rem;
  min-height: 180px;
  border: 1px solid #d6e4e0;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.p7co-engineering-inline #engineeringDimensionResults .btn {
  margin-bottom: 0.65rem;
  border-width: 1.5px;
  font-size: 1.05rem;
  line-height: 1.35;
  padding: 0.95rem 1.1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Mobile-first: stack everything cleanly */
.p7co-engineering-inline .p7co-field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.p7co-engineering-inline .p7co-input,
.p7co-engineering-inline .select2-container--default .select2-selection--single {
  min-height: 46px;
  font-size: 1.4rem;
}

/* Select2 PLACEHOLDER - LARGER & PERSISTENT */
.p7co-engineering-inline .select2-container--default .select2-selection--single .select2-selection__placeholder {
  font-size: 1.4rem !important;
  color: #666 !important;
  font-weight: 500;
  opacity: 1 !important;
}

.p7co-engineering-inline #engineeringDimensionSearch {
  border-radius: 10px;
  border: 1px solid #d6e4e0;
  padding: 0.9rem 1rem;
  font-size: 1rem;
}

.p7co-engineering-inline #engineeringDimensionNote {
  font-weight: 600;
  color: #157a63;
  margin-top: 0.35rem;
}

@media (max-width: 768px) {
  .p7co-engineering-inline #engineeringDimensionResults {
    max-height: none;
    padding: 0.85rem;
  }

  .p7co-engineering-inline #engineeringDimensionResults .btn {
    font-size: 1rem;
    padding: 0.85rem 1rem;
  }
}

.p7co-eng-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.p7co-eng-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 1rem;
}

.p7co-eng-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #333;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  border-radius: 0.35rem 0.35rem 0 0;
  cursor: pointer;
}

.p7co-eng-tab.is-active {
  border-color: #e5e5e5;
  border-bottom-color: #fff;
  background: #fff;
}

.p7co-eng-panels {
  margin-top: 0.35rem;
}

.p7co-eng-panel {
  display: none;
}

.p7co-eng-panel.is-active {
  display: block;
}

.p7co-dimensions-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ============================= */
/* Demo3 verde – overrides local */
/* ============================= */

.p7co-surplus-form {
  --p7co-primary: #189578;
  --p7co-primary-strong: #157a63;
  --p7co-primary-soft: rgba(24, 149, 120, 0.12);
  --p7co-primary-focus: rgba(24, 149, 120, 0.2);
}

.p7co-surplus-form .p7co-btn-primary {
  background: var(--p7co-primary);
  border-color: var(--p7co-primary);
}

.p7co-surplus-form .p7co-btn-primary:hover {
  background: var(--p7co-primary-strong);
  border-color: var(--p7co-primary-strong);
}

.p7co-surplus-form .p7co-btn-outline {
  border-color: var(--p7co-primary);
  color: var(--p7co-primary);
}

.p7co-surplus-form .p7co-btn-outline:hover {
  background: var(--p7co-primary);
  color: #fff;
}

.p7co-surplus-form .p7co-input:focus,
.p7co-surplus-form .p7co-select:focus,
.p7co-surplus-form .p7co-textarea:focus {
  border-color: var(--p7co-primary);
  box-shadow: 0 0 0 0.15rem var(--p7co-primary-focus);
}

.p7co-surplus-form .p7co-category-item.is-active {
  background: var(--p7co-primary);
  border-color: var(--p7co-primary);
}

.p7co-surplus-form .p7co-material-row.is-selected {
  background: var(--p7co-primary-soft);
}

.p7co-surplus-form .p7co-chip {
  border-color: rgba(24, 149, 120, 0.2);
  background: rgba(24, 149, 120, 0.08);
  color: #0f5132;
}

.p7co-surplus-form .p7co-count-pill {
  border-color: rgba(24, 149, 120, 0.25);
  background: rgba(24, 149, 120, 0.08);
  color: #0f5132;
}

.p7co-surplus-form .p7co-eng-modal .modal__header {
  border-bottom: 2px solid rgba(24, 149, 120, 0.6);
}

.p7co-surplus-form .p7co-eng-tab.is-active {
  color: #0f5132;
  border-color: var(--p7co-primary);
}

/* Document preview */
.p7co-doc-existing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  margin-bottom: 0.75rem;
}

.p7co-doc-existing__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.p7co-doc-existing__info > span[class^="w-icon-"] {
  font-size: 1.75rem;
  color: #dc3545;
  flex-shrink: 0;
}

.p7co-doc-existing__name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p7co-doc-existing__size {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.15rem;
}

.p7co-btn--sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

/* ============================================================================
   MVO-188: Surplus Lifecycle Validation Styles
   ============================================================================ */

/* Alert boxes (XOR warning, re-moderation notice) */
.p7co-alert {
  border-radius: 0.35rem;
  padding: 1rem 1.15rem;
  margin: 1rem 0;
  font-size: 1.25rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.p7co-alert--warning {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  color: #92400e;
}

.p7co-alert--warning::before {
  content: "⚠️";
  font-size: 1.4rem;
  flex-shrink: 0;
}

.p7co-alert--info {
  background: #eff6ff;
  border: 1px solid #3b82f6;
  color: #1e40af;
}

.p7co-alert--info::before {
  content: "ℹ️";
  font-size: 1.4rem;
  flex-shrink: 0;
}

.p7co-alert--danger {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.p7co-alert--danger::before {
  content: "❌";
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* Bootstrap-compat: alert classes for JS */
.alert {
  border-radius: 0.35rem;
  padding: 1rem 1.15rem;
  margin: 1rem 0;
  font-size: 1.25rem;
  line-height: 1.5;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  color: #92400e;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #3b82f6;
  color: #1e40af;
}

.alert-danger {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

/* Input validation states */
.p7co-input.is-invalid,
.p7co-select.is-invalid,
.p7co-textarea.is-invalid {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.p7co-input.is-invalid:focus,
.p7co-select.is-invalid:focus,
.p7co-textarea.is-invalid:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 0.15rem rgba(239, 68, 68, 0.25);
}

.p7co-input.is-valid,
.p7co-select.is-valid {
  border-color: #22c55e;
}

/* Disabled select styling */
.p7co-select:disabled,
.p7co-input:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  border-color: #e5e7eb;
}

/* LER/Engineering XOR section */
#ler-field-group .p7co-select:disabled {
  background: #f9fafb;
  border-style: dashed;
  opacity: 0.7;
}

#ler-field-group .p7co-help .text-muted {
  color: #9ca3af;
  font-style: italic;
}

/* Quantity + Unit coupled styling */
#quantity-unit-group {
  position: relative;
}

#quantity-unit-group .p7co-input.is-invalid + .p7co-help,
#quantity-unit-group .p7co-select.is-invalid + .p7co-help {
  color: #ef4444;
}

/* Re-moderation warning banner */
#remoderation-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* XOR alert special styling */
#ler-engineering-xor-alert {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

/* Unit dropdown styling */
#UnitId.p7co-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Required mark toggle */
.p7co-ler-required-mark {
  transition: opacity 0.2s ease;
}

.p7co-ler-required-mark[style*="display:none"],
.p7co-ler-required-mark[style*="display: none"] {
  opacity: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #quantity-unit-group.p7co-form-grid.p7co-grid-2 {
    grid-template-columns: 1fr;
  }
  
  .p7co-alert {
    flex-direction: column;
    gap: 0.5rem;
  }
}
