/* Compras: Provider Style */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.35);
  display: flex;
  justify-content: center;
  align-items: center;

  .modal-content {
    width: min(75%, 1000px);
    max-height: 95vh;
    overflow: auto;
    border: 6px solid var(--color-base);
    border-radius: 0.8rem;
    background-color: var(--color-light);

    .modal-head {
      position: relative;
      padding: 2rem;
      padding-bottom: 0;
    }

    .modal-body {
      /*
      position: relative;
      padding: 2rem;
      */
      max-height: 1000px;
      padding: 0 1.4rem;
      padding-top: 1rem;
    }

    .modal-head .modal--button {
      position: absolute;
      top: 2rem;
      right: 2rem;
      width: 2.4rem;
      height: 2.4rem;
      border-radius: 2rem;
      padding: 0;
    }

  }
}

.modal {
  .--new, .--edit {
    display: none;
  }
}

.modal.new .--new {
  display: block;
}
.modal.edit .--edit {
  display: block;
}

.code-table {
  position: relative;
}

.code-table table-data {
  padding: 0;

  table-view, div[tabulator].tabulator {
    height: 400px !important;
  }
}

/* PROVIDER LIST STYLES */
.provider-list-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem 0;
}

.provider-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-base);
}

.provider-list-controls {
  display: flex;
  gap: 0.5rem;
}

.provider-block {
  background-color: var(--color-light);
  border: 2px solid var(--color-light);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;

  &:hover {
    border-color: var(--color-base);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
  }
}

.provider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.provider-status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.provider-status-badge:empty {
  display: none;
}

.provider-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.provider-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.provider-detail-item.full-width {
  grid-column: 1 / -1;
  border-left: 4px solid var(--color-base);
  padding-left: 1rem;
}

.detail-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 0.9375rem;
  color: var(--text);
  word-break: break-word;
}

.detail-value a {
  color: var(--color-base);
}

.detail-value pre {
  margin: 0;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  white-space: pre-wrap;
  overflow-x: auto;
}

.provider-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.provider-actions button {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.provider-actions button.edit-provider {
  background-color: #3b82f6;
  color: white;
  border: 1px solid #3b82f6;

  &:hover {
    background-color: #2563eb;
    border-color: #2563eb;
  }
}

.provider-actions button.delete-provider {
  background-color: #ef4444;
  color: white;
  border: 1px solid #ef4444;

  &:hover {
    background-color: #dc2626;
    border-color: #dc2626;
  }
}

.provider-block + .provider-block {
  margin-top: 2rem;
}

/* Status colors */
.provider-status-badge {
  &.s0 {
    background-color: #d1fae5;
    color: #065f46;
  }

  &.s1 {
    background-color: #fee2e2;
    color: #991b1b;
  }

  &.s2 {
    background-color: #fef3c7;
    color: #7c2d12;
  }
}