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

/* ================= PAGE ================= */
.page {
  @include dashPageComponent;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: $bg-soft;
  border: 1px solid $border;

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

/* ================= CONTENT ================= */
.content {
  padding: 1rem 2.5rem;

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

.statsTitle {
  @include sectionTitle
}

.statsDesc {
  @include sectionDescription
}

/* ================= TOP BAR ================= */
.topBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ---------- SEARCH ---------- */
.search {
  flex: 1;
  display: flex;
  justify-content: flex-end;

  @media (max-width: 768px) {
    justify-content: flex-start;
    margin-top: 0.8rem;
  }
}


/* ================= CHART ================= */
.chartSection {
  @include dashPageComponent;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;

  margin-bottom: 2rem;

  overflow: hidden;


  .chartTabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;

  button {
    padding: 0.45rem 0.9rem;

    border-radius: 999px;

    border: 1px solid $border;

    background: #ffffff;

    cursor: pointer;

    font-size: 0.8rem;

    font-weight: 600;

    color: $text-light;

    transition: all 0.2s ease;

    &:hover {
      background: $primary-soft;
      border-color: $primary-border;
      color: $primary;
    }
  }
}

/* ================= ACTIVE CHART TAB ================= */

.activeChart {
  background: $primary-soft-strong !important;

  color: $primary !important;

  border-color: $primary-border !important;
}
}

/* ================= VIEW TOGGLE ================= */
.viewTabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;

  button {
    padding: 0.45rem 0.9rem;

    border-radius: 999px;

    border: 1px solid $border;

    background: #ffffff;

    cursor: pointer;

    font-size: 0.8rem;

    font-weight: 600;

    color: $text-light;

    transition: all 0.2s ease;

    &:hover {
      background: $primary-soft;
      border-color: $primary-border;
      color: $primary;
    }
  }
}

.activeView {
  background: $primary-soft-strong !important;

  color: $primary !important;

  border-color: $primary-border !important;
}

/* ================= QUICK ACTIONS ================= */
/* ================= QUICK ACTIONS ================= */
.quickActions {
  display: flex;
  flex-direction: column;
  @include dashPageComponent;

  overflow-x: hidden !important;
  padding-top: 0;
}

/* GRID */
.actionsOptions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

/* CARD */
.actionCard {
  display: flex;
  align-items: center;
  gap: 0.8rem;

  padding: 0.85rem 0.9rem;

  border-radius: 12px;

  border: 1px solid $border;
  background: #ffffff;

  cursor: pointer;

  transition: all 0.22s ease;

  /* subtle base depth */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);

  &:hover {
    background: $primary-soft;
    border-color: $primary-border;

    transform: translateY(-1px);

    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  }
}

/* =========================================
   LEFT ICON BOX
========================================= */

.actionLeft {
  height: 2.4rem;
  width: 2.4rem;
  min-width: 2.4rem;

  border-radius: 10px;

  display: flex;
  justify-content: center;
  align-items: center;

  background: $primary-soft;
  color: $primary;

  transition: all 0.2s ease;

  span {
    display: flex;
    align-items: center;
    justify-content: center;

    svg {
      font-size: 1rem;
    }
  }

  /* subtle hover reaction */
  .actionCard:hover & {
    background: $primary;
    color: #ffffff;
  }
}

/* =========================================
   TEXT CONTENT
========================================= */

.actionContent {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;

  h1 {
    font-size: 0.88rem;
    font-weight: 600;

    color: $text-dark;

    margin: 0;
    line-height: 1.2;

    transition: color 0.2s ease;
  }

  p {
    font-size: 0.75rem;
    font-weight: 500;

    color: $text-light;

    margin: 0;

    transition: color 0.2s ease;
  }

  /* hover text enhancement */
  .actionCard:hover & h1 {
    color: $primary;
  }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .actionsOptions {
    grid-template-columns: 1fr;
  }

  .actionCard {
    padding: 0.8rem;
  }

  .actionLeft {
    height: 2.2rem;
    width: 2.2rem;
  }

  .actionContent {
    h1 {
      font-size: 0.85rem;
    }

    p {
      font-size: 0.75rem;
    }
  }
}

/* ================= ANIMATIONS ================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}



/* ================= TABLE CARD FIX ================= */
.tableCard {
  margin-top: 2rem;
  width: 100%;
  overflow: hidden; // 🔥 prevents page overflow
}

/* ================= TABLE WRAPPER ================= */
.tableWrapper {
  width: 100%;
  overflow-x: auto; // 🔥 enables horizontal scroll INSIDE
  border-radius: 12px;
}

/* OPTIONAL: Smooth scroll feel */
.tableWrapper::-webkit-scrollbar {
  height: 6px;
}

.tableWrapper::-webkit-scrollbar-thumb {
  background: rgba(0, 56, 69, 0.2);
  border-radius: 10px;
}

/* ================= SAFETY (VERY IMPORTANT) ================= */
.tableWrapper table {
  min-width: 800px; // 🔥 ensures proper layout without breaking
}


