@use "../../../styles/abstracts/variables" as *;
@use "../../../styles/abstracts/mixins" as *;

$control-height: 42px;

/* ================= PAGE ================= */

.page {
  @include dashPageComponent;

  height: 100%;
  padding: 0;

  display: flex;
  flex-direction: column;
  background: $bg-soft;
  border: 1px solid $border;

  @media (max-width: 1000px) {
    margin-top: 5rem;
  }
}

/* ================= CONTENT ================= */
.content {
  padding: 1rem 2.5rem;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 1.2rem !important;

  @media (max-width: 1000px) {
    padding: 1.5rem;
    padding-top: 0;
  }
}

/* ================= HEADER ================= */

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;

  overflow: visible;
}

/* ================= SELECT ================= */

.selectWrap {
  height: $control-height;
  min-width: 150px;

  select {
    height: 100%;
    width: 100%;

    padding: 0 0.7rem;

    border-radius: 10px;
    border: 1px solid $border;

    font-size: 0.8rem;
    background: #fff;

    &:focus {
      outline: none;
      border-color: $primary;
      box-shadow: 0 0 0 2px $primary-soft;
    }
  }
}

/* ================= ACTIONS ================= */

.actions {
  display: flex;
  gap: 0.4rem;
}

.actions button {
  height: $control-height;
  padding: 0 0.85rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

/* BUTTON VARIANTS */

.apply {
  background: $primary;
  color: #fff;
  border: none;
}

.clear {
  border: 1px solid $border;
  background: #fff;
}

.export {
  background: $primary-soft;
  color: $primary;
  border: none;
}

/* ================= TABLE ================= */

.tableSection {
  margin-top: 1.5rem;
  background: #FFF;
  padding: 2rem;
  border-radius: 10px;
}

/* ================= ANIMATION ================= */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1024px) {
  .filters {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .dateGroup {
    width: 100%;
    flex-wrap: nowrap; /* 🔥 keeps alignment */
  }

  .selectWrap {
    width: 100%;
  }

  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .actions button {
    width: 100%;
  }
}
