// ========================================
// DASHBOARD
// ========================================

.dashboard-static {
  min-height: 0;

  // ======================================
  // Header
  // ======================================

  .dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

    h2 {
      color: white !important;
      font-weight: 600;
    }
  }

  .welcome-text {
    color: #FFFFFF !important;
    font-size: 1rem;
    font-weight: 500;
  }

  .dashboard-header-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
  }

  .warehouse-filter {
    display: inline-block;
    flex: 0 0 auto;
    min-width: 279px;
    max-width: 380px;
    position: relative;
  }

  .date-range-filter {
    display: inline-block;
    flex: 0 0 auto;
    min-width: 280px;
    max-width: 380px;
    position: relative;

    .vue-daterange-picker {
      width: 100% !important;
    }

    .form-control.reportrange-text {
      background: #764ba200 !important;
      color: white !important;
      border: none !important;
      padding: 0 !important;
    }

    .daterangepicker {
      z-index: 2055 !important;
      color: #111827 !important;
    }
  }

  .date-picker-header-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 600 !important;
    color: white !important;
    transition: all 0.3s ease !important;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;

    &:hover {
      background: rgba(255, 255, 255, 0.3) !important;
      color: white !important;
    }

    &:focus,
    &:active {
      background: rgba(255, 255, 255, 0.3) !important;
      color: white !important;
      outline: none;
      box-shadow: none !important;
    }

    i {
      color: white;
      margin-right: 0.5rem;
    }

    span {
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  // ======================================
  // Warehouse Filter (v-select deep)
  // ======================================

  .warehouse-filter {
    .v-select {
      width: 100%;
      background: transparent !important;

      .vs__dropdown-toggle {
        background: rgba(255, 255, 255, 0.2) !important;
        background-color: rgba(255, 255, 255, 0.2) !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 0.5rem 1rem !important;
        min-height: auto !important;
        height: auto !important;
        cursor: pointer;
        transition: all 0.3s ease !important;
        display: flex !important;
        align-items: center !important;

        * {
          background: transparent !important;
          background-color: transparent !important;
        }

        &:hover {
          background: rgba(255, 255, 255, 0.3) !important;
        }

        &:focus,
        &:active {
          background: rgba(255, 255, 255, 0.3) !important;
          outline: none;
          box-shadow: none !important;
        }
      }

      .vs__selected-options {
        padding: 0 !important;
        margin: 0 !important;
        display: flex;
        align-items: center;
        flex: 1;

        .vs__selected {
          color: white !important;
          font-weight: 600 !important;
          font-size: 0.95rem !important;
          margin: 0 !important;
          padding: 0 !important;
          background: transparent !important;
          border: none !important;
          display: flex;
          align-items: center;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;

          i {
            color: white;
            margin-right: 0.5rem;
            flex-shrink: 0;
          }
        }
      }

      .vs__search,
      .vs__search:focus {
        color: white !important;
        font-weight: 600 !important;
        font-size: 0.95rem !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        height: auto !important;
        line-height: 1.5 !important;

        &::placeholder {
          color: rgba(255, 255, 255, 0.7) !important;
          font-weight: 600 !important;
        }
      }

      .vs__actions {
        padding: 0 !important;
        margin-left: 0.5rem;
      }

      .vs__clear {
        fill: white !important;
        margin-right: 0.5rem;
      }

      .vs__open-indicator {
        fill: white !important;
      }

      .vs__dropdown-menu {
        z-index: 2056 !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid #e0e6ed !important;
        margin-top: 0.5rem !important;
      }

      .vs__dropdown-option {
        padding: 0.75rem 1rem !important;
        color: #1f2937 !important;
        font-size: 0.875rem !important;
        display: flex;
        align-items: center;

        &--highlight {
          background: #8B5CF6 !important;
          color: white !important;

          i {
            color: white !important;
          }
        }
      }
    }
  }

  // ======================================
  // Filter Card
  // ======================================

  .filter-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
  }

  .date-picker-btn {
    border: 1px solid #e0e6ed;
    transition: all 0.3s ease;

    &:hover {
      border-color: #8B5CF6;
      color: #8B5CF6;
    }
  }

  .quick-wrap .btn {
    min-width: 58px;
    border-radius: 6px;
    transition: all 0.3s ease;

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(139, 92, 246, 0.2);
    }
  }

  // ======================================
  // Stat Cards
  // ======================================

  .stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: 100%;
    min-height: 120px;

    &:hover {
      transform: translateY(-5px);
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    }
  }

  .stat-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
  }

  .sales-card .stat-card-icon {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    color: white;
  }

  .purchases-card .stat-card-icon {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    color: white;
  }

  .sales-due-card .stat-card-icon {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    color: white;
  }

  .purchase-due-card .stat-card-icon {
    background: linear-gradient(135deg, #f97316 0%, #fdba74 100%);
    color: white;
  }

  .invoices-card .stat-card-icon {
    background: linear-gradient(135deg, #a855f7 0%, #d8b4fe 100%);
    color: white;
  }

  .profit-card .stat-card-icon {
    background: linear-gradient(135deg, #16a34a 0%, #4ade80 100%);
    color: white;
  }

  .returns-card .stat-card-icon {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    color: white;
  }

  .revenue-card .stat-card-icon {
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    color: white;
  }

  .stat-card-content {
    flex: 1;
  }

  .stat-card-label {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 0 0.25rem 0;
    font-weight: 500;
  }

  .stat-card-value {
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-card-link {
    color: #8B5CF6;
    font-size: 0.875rem;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    white-space: nowrap;

    &:hover {
      color: #6D28D9;
      text-decoration: none;
    }
  }

  // ======================================
  // Info Cards (Sales by Payment & Stock Value)
  // ======================================

  .info-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;

    &:hover {
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    }
  }

  .info-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .info-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
  }

  .info-card-menu {
    color: #6b7280;
    cursor: pointer;
    font-size: 1.25rem;
    transition: color 0.3s ease;

    &:hover {
      color: #1f2937;
    }
  }

  .info-card-body {
    padding: 1.5rem;
    flex: 1;
  }

  .info-card-item {
    margin-bottom: 1.5rem;

    &:last-child {
      margin-bottom: 0;
    }
  }

  .info-card-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
  }

  .info-card-item-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
  }

  .info-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
  }

  .dot-orange { background: #F59E0B; }
  .dot-blue { background: #3B82F6; }
  .dot-green { background: #10B981; }
  .dot-grey { background: #6B7280; }

  .info-card-item-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    text-align: right;
  }

  .info-card-percentage {
    color: #6b7280;
    font-weight: 500;
    margin-left: 0.25rem;
  }

  .info-card-progress {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
  }

  .info-card-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
  }

  .progress-orange { background: #F59E0B; }
  .progress-blue { background: #3B82F6; }
  .progress-green { background: #10B981; }
  .progress-grey { background: #6B7280; }

  // ======================================
  // Stock Value Items
  // ======================================

  .stock-value-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;

    &:last-child {
      border-bottom: none;
      padding-bottom: 0;
    }

    &:first-child {
      padding-top: 0;
    }

    .info-card-item-label {
      font-size: 0.875rem;
      color: #6b7280;
    }

    .info-card-item-value {
      font-size: 1rem;
      font-weight: 700;
      color: #1f2937;
    }
  }

  .info-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
    font-size: 1.125rem;
    color: white;
  }

  .stock-icon-cost {
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
  }

  .stock-icon-retail {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
  }

  .stock-icon-wholesale {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
  }

  // ======================================
  // Chart Cards
  // ======================================

  .chart-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: visible;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;

    &:hover {
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    }
  }

  .chart-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;

    .btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      transition: all 0.3s ease;

      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(139, 92, 246, 0.2);
      }
    }
  }

  .chart-card-header-filter {
    margin-left: auto;

    .form-control.reportrange-text {
      background: transparent !important;
      border: none !important;
      padding: 0 !important;
      height: auto !important;
      box-shadow: none !important;
    }

    .daterangepicker {
      z-index: 2055 !important;
    }
  }

  .chart-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
  }

  .chart-card-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .legend-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
  }

  .legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
  }

  .sales-dot { background: #8B5CF6; }
  .purchases-dot { background: #DDD6FE; }
  .sent-dot { background: #EF4444; }
  .received-dot { background: #10B981; }

  .chart-card-body {
    padding: 1.5rem;
    height: 400px;
    flex-shrink: 0;
    min-height: 400px;
  }

  // ======================================
  // Table Cards
  // ======================================

  .table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;

    &:hover {
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    }
  }

  .table-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
  }

  .table-card-link {
    color: #8B5CF6;
    font-size: 0.875rem;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;

    &:hover {
      color: #6D28D9;
      text-decoration: none;

      i {
        transform: translateX(4px);
      }
    }

    i {
      margin-left: 0.25rem;
      transition: transform 0.3s ease;
    }
  }

  .table-card-body {
    padding: 1rem;
  }

  // ======================================
  // Modern Table
  // ======================================

  .modern-table {
    font-size: 0.875rem;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;

    thead th,
    &.vgt-table thead th {
      background: #f8f9fa !important;
      color: #212529;
      font-weight: 600;
      text-transform: none;
      font-size: 0.8125rem;
      letter-spacing: 0.01em;
      padding: 0.75rem 1rem !important;
      border-bottom: 2px solid #dee2e6 !important;
    }

    tbody td,
    &.vgt-table tbody td {
      padding: 0.75rem 1rem;
      border-bottom: 1px solid #e9ecef;
      vertical-align: middle;
    }

    tbody tr:nth-child(even) {
      background: #fcfcfd;
    }

    tbody tr:hover {
      background: #f8f9fa;
    }
  }

  // ======================================
  // Stock Alert Table
  // ======================================

  .stock-alert-table {
    font-size: 0.875rem;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px;
    overflow: hidden;

    thead {
      background: #f9fafb !important;

      th {
        background: #f9fafb !important;
        color: #374151 !important;
        font-weight: 600 !important;
        text-transform: none;
        font-size: 0.8125rem !important;
        letter-spacing: 0.01em;
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #e5e7eb !important;
      }
    }

    tbody {
      td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f3f4f6;
        vertical-align: middle;
        background: #ffffff;
        transition: background-color 0.2s ease;
      }

      tr {
        transition: background-color 0.2s ease;

        &:nth-child(even) {
          background: #fcfcfd;
        }

        &:hover {
          background: #f9fafb;
        }

        &:last-child td {
          border-bottom: none;
        }
      }
    }
  }

  .stock-alert-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 6px;
    border: 1px solid #fecaca;
    transition: all 0.2s ease;

    &:hover {
      background: #fecaca;
      border-color: #fca5a5;
    }
  }

  // ======================================
  // Dashboard Badges
  // ======================================

  .badge {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
  }

  .badge-success {
    background: #d1fae5;
    color: #065f46;
  }

  .badge-info {
    background: #dbeafe;
    color: #1e40af;
  }

  .badge-warning {
    background: #fef3c7;
    color: #92400e;
  }

  .badge-primary {
    background: #e0e7ff;
    color: #3730a3;
  }

  .badge-danger {
    background: #fee2e2;
    color: #991b1b;
  }

  // ======================================
  // Welcome Card
  // ======================================

  .welcome-card {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 1.5rem;
  }

  .welcome-card h3 {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 0.5rem;
  }

  // ======================================
  // Responsive — Tablet
  // ======================================

  @media (max-width: 1024px) and (min-width: 769px) {
    .warehouse-filter,
    .date-range-filter {
      min-width: auto;
      max-width: 100%;
      width: 100%;
      flex: 1 1 auto;
    }
  }

  // ======================================
  // Responsive — Mobile
  // ======================================

  @media (max-width: 768px) {
    .dashboard-header {
      text-align: center;
    }

    .dashboard-header-filters {
      flex-direction: column;
      align-items: stretch !important;
      gap: 0.75rem !important;
      margin-top: 1rem;
    }

    .warehouse-filter,
    .date-range-filter {
      min-width: auto;
      max-width: 100%;
      width: 100%;
      margin-left: 0;
    }

    .stat-card {
      flex-direction: column;
      text-align: center;
    }

    .stat-card-icon {
      margin-right: 0;
      margin-bottom: 1rem;
    }

    .info-card-header {
      padding: 1.25rem;
    }

    .info-card-body {
      padding: 1.25rem;
    }

    .info-card-item {
      margin-bottom: 1.25rem;
    }

    .stock-value-item {
      padding: 0.875rem 0;
    }

    .chart-card-header,
    .table-card-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 1rem;
    }

    .quick-wrap {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;

      .btn {
        flex: 1;
        min-width: auto;
      }
    }
  }

  // ======================================
  // Date Range Picker — Mobile Responsive
  // ======================================

  @media (max-width: 768px) {
    .date-range-filter {
      .daterangepicker {
        left: 12px !important;
        right: 12px !important;
        width: calc(100% - 24px) !important;
        max-width: calc(100vw - 24px) !important;

        .calendars-container {
          display: flex !important;
          flex-direction: column !important;
        }

        .drp-calendar {
          float: none !important;
          width: 100% !important;
          padding: 10px !important;

          &.right {
            display: none !important;
          }
        }

        .ranges {
          float: none !important;
          width: 100% !important;
          margin: 10px 0 0 0 !important;
          border-top: 1px solid #e5e7eb !important;
          padding-top: 10px !important;

          ul {
            width: 100% !important;
          }

          li {
            width: 100% !important;
            margin-bottom: 5px !important;
            text-align: center !important;
          }
        }

        .calendar-table {
          width: 100% !important;

          th,
          td {
            padding: 6px !important;
            font-size: 0.875rem !important;
          }
        }

        .drp-buttons {
          display: flex !important;
          flex-direction: column !important;
          gap: 8px !important;
          padding: 10px !important;

          .btn {
            width: 100% !important;
            margin: 0 !important;
          }
        }
      }
    }
  }

  @media (max-width: 576px) {
    .date-range-filter {
      .daterangepicker {
        left: 8px !important;
        right: 8px !important;
        width: calc(100% - 16px) !important;
        max-width: calc(100vw - 16px) !important;

        .calendar-table {
          th,
          td {
            padding: 4px !important;
            font-size: 0.75rem !important;
          }
        }

        .drp-calendar {
          padding: 8px !important;
        }
      }
    }
  }
}
