// Variáveis de Tema (Devem idealmente vir de um ficheiro global)
$color-primary: #007672; // Verde/Teal da imagem
$color-bg: #f8f9fa;
$color-text: #333;
$color-text-light: #666;
$color-border: #e0e0e0;
$border-radius: 8px;

.page-container {
  padding: 24px;
  background-color: #f4f5f6;
  min-height: 100vh;
  font-family: 'Segoe UI', Roboto, Helvetica, sans-serif;
  color: $color-text;
}

// Typography & Headers
.back-link {
  color: $color-primary;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;

  h1 { margin: 0; font-size: 24px; font-weight: 700; }
}

.btn-history {
  background: none;
  border: none;
  color: $color-primary;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

// Cards
.card {
  background: #ffffff;
  border-radius: $border-radius;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  padding: 24px;
  border: 1px solid #ebedf0;
}

.top-card { margin-bottom: 24px; }

// Stepper Input
.input-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: $color-text;
}

.stepper-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stepper-input {
  display: flex;
  align-items: center;
  border: 1px solid $color-border;
  border-radius: 4px;
  width: fit-content;
  overflow: hidden;

  input {
    border: none;
    padding: 8px 16px;
    width: 60px;
    text-align: left;
    outline: none;
    font-size: 16px;
    -moz-appearance: textfield;
    
    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
  }

  .stepper-actions {
    display: flex;
    align-items: center;
    border-left: 1px solid $color-border;

    button {
      background: none;
      border: none;
      color: $color-primary;
      font-size: 18px;
      padding: 8px 12px;
      cursor: pointer;
      &:hover { background: #f0f0f0; }
      &:disabled { color: #ccc; cursor: not-allowed; }
    }
    .divider {
      width: 1px;
      height: 20px;
      background-color: $color-border;
    }
  }
}

.hint-text {
  font-size: 12px;
  color: $color-text-light;
}

// Tabs
.tabs {
  display: flex;
  border-bottom: 1px solid $color-border;
  margin-bottom: 24px;

  .tab-item {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: $color-text-light;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;

    &.active {
      color: $color-primary;
      border-bottom-color: $color-primary;
    }
  }
}

// Grid para os 2 Cards (Crucial para o seu pedido)
.section-title {
  font-size: 16px;
  margin-bottom: 16px;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Duas colunas de tamanho exatamente igual */
  gap: 24px;
  align-items: stretch; /* Garante que ambos os cards esticam para ter a mesma altura */

  .card {
    margin: 0; // Reset margin para o grid gerir o espaço
  }
}

// Table
.data-table {
  width: 100%;
  border-collapse: collapse;

  th {
    text-align: left;
    padding: 12px;
    color: $color-text-light;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid $color-border;
    
    .sort-icon { color: #999; margin-left: 4px; }
  }

  td {
    padding: 16px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
  }

  .align-center { text-align: center; }
}

// Custom Toggle Switch
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;

  input { 
    opacity: 0;
    width: 0;
    height: 0;
  }

  .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-start;

    &:before {
      position: absolute;
      content: "";
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      transition: .4s;
      border-radius: 50%;
    }
  }

  input:checked + .slider {
    background-color: $color-primary;
  }

  input:checked + .slider:before {
    transform: translateX(20px);
  }

  .check-icon {
    width: 14px;
    height: 14px;
    color: $color-primary;
    z-index: 1;
    margin-left: 23px; // Posiciona o check dentro da "bolinha" quando ativo
    transition: .4s;
  }
}