@use '../variables' as v;
@use '../mixins' as m;

// ─────────────────────────────────────────────
// Dashboard welcome banner
// ─────────────────────────────────────────────
.dashboard-welcome {
  @include m.card-base;
  padding: 24px 28px;
  @include m.flex-between;
  gap: 24px;
  margin-bottom: 22px;
  overflow: hidden;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: v.$primary-light;
    border-radius: v.$radius-full;
    opacity: 0.6;
  }

  &-body { position: relative; z-index: 1; }

  h2 {
    font-size: 22px;
    font-weight: 700;
    color: v.$gray-900;
    margin-bottom: 4px;
  }

  p {
    font-size: v.$font-size-sm;
    color: v.$gray-500;
    margin-bottom: 14px;
    @include m.flex-start;
    gap: 6px;
    flex-wrap: wrap;

    a { color: v.$primary-medium; font-weight: 500; }
  }

  &-meta {
    @include m.flex-start;
    gap: 14px;
    flex-wrap: wrap;
    font-size: v.$font-size-xs;
    color: v.$gray-500;

    span {
      @include m.flex-start;
      gap: 5px;

      svg { width: 13px; height: 13px; }
    }
  }

  &-illustration {
    flex-shrink: 0;
    width: 120px;
    opacity: 0.8;
    position: relative;
    z-index: 1;

    @include m.max-md { display: none; }
  }
}

// ─────────────────────────────────────────────
// Quick action strip
// ─────────────────────────────────────────────
.quick-actions {
  @include m.flex-start;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

// ─────────────────────────────────────────────
// Chart card
// ─────────────────────────────────────────────
.chart-card {
  @include m.card-base;
  overflow: hidden;

  &-header {
    @include m.flex-between;
    padding: 16px 20px;
    border-bottom: 1px solid v.$border-color;
    flex-wrap: wrap;
    gap: 12px;

    &-left h3 {
      font-size: v.$font-size-base;
      font-weight: 600;
      color: v.$gray-800;
    }

    &-left p {
      font-size: v.$font-size-xs;
      color: v.$gray-400;
      margin-top: 2px;
    }
  }

  &-tabs {
    @include m.flex-start;
    gap: 4px;
  }

  &-tab {
    padding: 5px 12px;
    border-radius: v.$radius;
    font-size: v.$font-size-xs;
    font-weight: 500;
    color: v.$gray-500;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background v.$transition-base, color v.$transition-base;

    &:hover { background: v.$gray-100; color: v.$gray-700; }

    &.is-active {
      background: v.$primary;
      color: v.$white;
    }
  }

  &-body {
    padding: 20px;
    height: 280px;
    position: relative;

    canvas { width: 100% !important; height: 100% !important; }
  }

  &-legend {
    @include m.flex-start;
    gap: 16px;
    padding: 12px 20px;
    border-top: 1px solid v.$border-color;
    background: v.$gray-50;
    flex-wrap: wrap;

    &-item {
      @include m.flex-start;
      gap: 6px;
      font-size: v.$font-size-xs;
      color: v.$gray-500;

      &-dot {
        width: 8px;
        height: 8px;
        border-radius: v.$radius-full;
      }
    }
  }
}

// ─────────────────────────────────────────────
// System health
// ─────────────────────────────────────────────
.health-widget {
  @include m.card-base;
  padding: 18px 20px;

  h4 {
    font-size: v.$font-size-sm;
    font-weight: 600;
    color: v.$gray-700;
    margin-bottom: 14px;
  }

  &-row {
    @include m.flex-between;
    padding: 8px 0;
    border-bottom: 1px solid v.$border-color;
    font-size: v.$font-size-sm;

    &:last-child { border-bottom: none; }

    &-label { color: v.$gray-600; }
  }
}
