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

$border-light: rgba(0, 0, 0, 0.06);
$text-muted: #6b6b6b;
$primary-light: rgba(122, 75, 32, 0.08);

.page {
  @include dashPageComponent;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  background: $bg-soft;
  border: 1px solid $border-light;

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

.content {
  padding: 1rem 2.5rem;

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

/* ================= STATS ================= */
.statsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ================= CHART ================= */
.chartCard {
  background: #fff;
  padding: 1.6rem;
  border-radius: 16px;
  margin-bottom: 4rem;
  border: 1px solid $border-light;
  box-shadow: 0 12px 30px rgba(122, 75, 32, 0.08);

  h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    font-size: 0.95rem;
    font-weight: 600;
    color: $text-dark;

    svg {
      color: $primary;
    }
  }

  .recharts-cartesian-grid line {
    stroke: rgba(0, 0, 0, 0.05);
  }

  .recharts-default-tooltip {
    border-radius: 10px !important;
    border: 1px solid $border-light !important;
  }
}

/* ================= TABLE ================= */
.tableCard {
  background: #fff;
  padding: 1.6rem;
  border-radius: 16px;

  border: 1px solid $border-light;
  box-shadow: 0 12px 30px rgba(122, 75, 32, 0.08);
}

.tableHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 1.5rem;

  @media (max-width: 1000px) {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: $text-dark;
  }

  p {
    font-size: 0.85rem;
    color: $text-muted;
  }
}
/* ================= QUICK ACTIONS ================= */
.quickActions {
  margin: 2.5rem 0;

  background: linear-gradient(180deg, #ffffff 0%, #faf8f6 100%);
  padding: 1.8rem;
  border-radius: 18px;

  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 10px 30px rgba(122, 75, 32, 0.06);

  position: relative;
  overflow: hidden;
}

/* subtle glow accent */
.quickActions::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top right,
    rgba(122, 75, 32, 0.08),
    transparent 60%
  );
  pointer-events: none;
}

/* ================= HEADER ================= */
.actionsHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 1.2rem;
}

/* ================= ADD BUTTON ================= */
.addBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  background: linear-gradient(135deg, #7a4b20, #5e3817);
  color: #ffffff;

  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  border: none;

  font-size: 0.85rem;
  font-weight: 600;

  cursor: pointer;

  box-shadow: 0 6px 16px rgba(122, 75, 32, 0.25);
  transition: all 0.25s ease;

  svg {
    font-size: 1rem;
  }

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(122, 75, 32, 0.35);
  }

  &:active {
    transform: scale(0.96);
  }
}

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

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

  padding: 0.8rem 1rem;
  border-radius: 14px;

  /* 🔥 blended surface */
  background: linear-gradient(180deg, #ffffff, #f9f7f5);

  border: 1px solid rgba(0, 0, 0, 0.04);

  cursor: pointer;
  transition: all 0.25s ease;

  position: relative;
  overflow: hidden;

  /* subtle depth */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);

  &:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(122, 75, 32, 0.12);
    border-color: rgba(122, 75, 32, 0.2);
  }

  /* hover glow */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
      circle at bottom left,
      rgba(122, 75, 32, 0.08),
      transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  &:hover::after {
    opacity: 1;
  }
}

/* ================= ICON ================= */
.actionLeft {
  width: 36px;
  height: 36px;

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

  border-radius: 10px;

  background: linear-gradient(
    135deg,
    rgba(122, 75, 32, 0.12),
    rgba(122, 75, 32, 0.04)
  );

  border: 1px solid rgba(122, 75, 32, 0.1);

  span {
    font-size: 1rem;
    color: #7a4b20;
  }
}

/* ================= TEXT ================= */
.actionContent {
  display: flex;
  flex-direction: column;

  h1 {
    font-size: 0.84rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
    line-height: 1.2;
  }

  p {
    font-size: 0.72rem;
    color: #6b6b6b;
  }
}

/* ================= MOBILE ================= */
@media (max-width: 600px) {
  .actionsHeader {
    flex-direction: column;
    gap: 0.8rem;
    align-items: stretch;
  }

  .addBtn {
    width: 100%;
    justify-content: center;
  }
}


/* ================= PERFORMANCE SECTION ================= */
.chartCard {
  position: relative;
  background: linear-gradient(180deg, #ffffff, #faf8f6);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  padding: 1.2rem 1.3rem;
  margin-bottom: 1.5rem;

  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.03);

  h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.9rem;
    letter-spacing: 0.2px;
  }
}

/* ================= GRID ================= */
.performanceGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;

  @media (max-width: 600px) {
    grid-template-columns: 1fr;
  }
}

/* ================= CARD ================= */
.performanceCard {
  position: relative;

  background: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);

  padding: 0.75rem 0.85rem;

  display: flex;
  flex-direction: column;
  gap: 0.2rem;

  transition: all 0.2s ease;

  /* subtle depth */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);

  &:hover {
    transform: translateY(-2px);
    border-color: rgba(122, 75, 32, 0.15);
    box-shadow: 0 6px 14px rgba(122, 75, 32, 0.08);
  }

  /* subtle left accent */
  &::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 6px;
    background: #7a4b20;
    opacity: 0.15;
  }

  h4 {
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b6b6b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
}

/* ================= TEXT ================= */
.serviceName {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.2;
}

.serviceMeta {
  font-size: 0.68rem;
  color: #6b6b6b;
  margin-bottom: 2px;
}

.serviceValue {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #7a4b20;
}

/* ================= STATE COLORS ================= */
.performanceCard:first-child {
  .serviceValue {
    color: #166534; /* green */
  }

  &::before {
    background: #16a34a;
    opacity: 0.25;
  }
}

.performanceCard:last-child {
  .serviceValue {
    color: #92400e; /* amber */
  }

  &::before {
    background: #f59e0b;
    opacity: 0.25;
  }
}

/* ================= MOBILE OPTIMIZATION ================= */
@media (max-width: 480px) {
  .chartCard {
    padding: 1rem;
  }

  .performanceCard {
    padding: 0.7rem;
  }

  .serviceValue {
    font-size: 1rem;
  }
}


/* ================= BAR CHART SECTION ================= */
.barChartSection {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;

  border: 1px solid rgba(0, 0, 0, 0.05);

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

  h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.8rem;
  }
}

/* ================= CHART WRAPPER ================= */
.chartWrapper {
  width: 100%;
  height: 260px;

  @media (max-width: 768px) {
    height: 220px;
  }
}