<template>
  <div class="salary-calculation-container">
    <!-- 主要内容区域 - 左右布局 -->
    <div class="main-content">
      <!-- 左侧：统计操作区域 -->
      <div class="left-panel">
        <!-- 顶部控制区域 - 同一行显示 -->
        <div class="top-controls-row">
          <!-- 月份选择区域 -->
          <el-card class="box-card month-selector-card">
            <div slot="header" class="clearfix">
              <span><i class="el-icon-date"></i> 选择统计月份</span>
              <el-button style="float: right; padding: 3px 0" type="text" @click="resetMonth">重置</el-button>
            </div>
            <div class="month-picker-wrapper">
              <el-date-picker
                v-model="statisticsMonth"
                type="month"
                placeholder="选择月份"
                format="yyyy年MM月"
                value-format="yyyyMM"
                :clearable="false"
                class="month-picker"
              >
              </el-date-picker>
            </div>
          </el-card>

          <!-- 一键计算工资 -->
          <el-card class="box-card calculate-card">
            <div slot="header" class="clearfix">
              <span><i class="el-icon-cpu"></i> 一键计算工资</span>
            </div>
            <div class="calculate-content">
              <p class="calculate-desc">按顺序执行所有统计方法，生成完整的工资数据</p>
              <el-button
                type="primary"
                size="large"
                :loading="isCalculating"
                @click="handleCalculateSalary"
                class="calculate-button"
                :disabled="!statisticsMonth"
              >
                <i class="el-icon-magic-stick"></i> 
                {{ isCalculating ? '计算中...' : '一键计算工资' }}
              </el-button>
            </div>
          </el-card>
        </div>

        <!-- 单独统计操作 -->
        <el-card class="box-card statistics-card">
          <div slot="header" class="clearfix">
            <span><i class="el-icon-s-operation"></i> 单独统计操作</span>
          </div>
          <div class="statistics-grid">
            <div class="stat-item blue-item">
              <div class="stat-header">
                <i class="el-icon-s-data"></i>
                <span>金三角开卡业绩</span>
              </div>
              <el-button
                type="primary"
                :loading="loadingStates.goldTriangle"
                @click="handleGoldTriangleStatistics"
                class="stat-button"
                :disabled="!statisticsMonth"
              >
                立即统计
              </el-button>
            </div>

            <div class="stat-item green-item">
              <div class="stat-header">
                <i class="el-icon-user"></i>
                <span>健康师个人开单业绩</span>
              </div>
              <el-button
                type="success"
                :loading="loadingStates.personalPerformance"
                @click="handlePersonalPerformanceStatistics"
                class="stat-button"
                :disabled="!statisticsMonth"
              >
                立即统计
              </el-button>
            </div>

            <div class="stat-item orange-item">
              <div class="stat-header">
                <i class="el-icon-s-promotion"></i>
                <span>科技部开单业绩</span>
              </div>
              <el-button
                type="warning"
                :loading="loadingStates.techPerformance"
                @click="handleTechPerformanceStatistics"
                class="stat-button"
                :disabled="!statisticsMonth"
              >
                立即统计
              </el-button>
            </div>

            <div class="stat-item purple-item">
              <div class="stat-header">
                <i class="el-icon-s-shop"></i>
                <span>门店耗卡业绩</span>
              </div>
              <el-button
                type="info"
                :loading="loadingStates.storeConsumePerformance"
                @click="handleStoreConsumePerformanceStatistics"
                class="stat-button"
                :disabled="!statisticsMonth"
              >
                立即统计
              </el-button>
            </div>

            <div class="stat-item teal-item">
              <div class="stat-header">
                <i class="el-icon-user-solid"></i>
                <span>个人消耗业绩</span>
              </div>
              <el-button
                type="primary"
                :loading="loadingStates.departmentConsumePerformance"
                @click="handleDepartmentConsumePerformanceStatistics"
                class="stat-button"
                :disabled="!statisticsMonth"
              >
                立即统计
              </el-button>
            </div>

            <div class="stat-item red-item">
              <div class="stat-header">
                <i class="el-icon-s-finance"></i>
                <span>门店总业绩</span>
              </div>
              <el-button
                type="danger"
                :loading="loadingStates.storeTotalPerformance"
                @click="handleStoreTotalPerformanceStatistics"
                class="stat-button"
                :disabled="!statisticsMonth"
              >
                立即统计
              </el-button>
            </div>

            <div class="stat-item gold-item">
              <div class="stat-header">
                <i class="el-icon-money"></i>
                <span>工资统计</span>
              </div>
              <el-button
                type="warning"
                :loading="loadingStates.salaryStatistics"
                @click="handleSalaryStatistics"
                class="stat-button"
                :disabled="!statisticsMonth"
              >
                立即统计
              </el-button>
            </div>

            <!-- 预留位置，用于未来添加更多统计方法 -->
            <div class="stat-item placeholder-item">
              <div class="stat-header">
                <i class="el-icon-plus"></i>
                <span>更多统计方法</span>
              </div>
              <el-button
                type="info"
                disabled
                class="stat-button"
              >
                敬请期待
              </el-button>
            </div>
          </div>
        </el-card>
      </div>

      <!-- 右侧：结果显示区域 -->
      <div class="right-panel">
        <!-- 计算进度区域 -->
        <el-card class="box-card progress-card" v-if="calculationProgress.length > 0">
          <div slot="header" class="clearfix">
            <span><i class="el-icon-time"></i> 计算进度</span>
          </div>
          <div class="progress-content">
            <div v-for="(step, index) in calculationProgress" :key="index" class="progress-step">
              <i :class="getProgressIcon(step.status)" :style="{ color: getProgressColor(step.status) }"></i>
              <span :class="{ 'completed': step.status === 'completed', 'failed': step.status === 'failed' }">
                {{ step.name }}
              </span>
            </div>
          </div>
        </el-card>

        <el-card class="box-card result-card">
          <div slot="header" class="clearfix">
            <span><i class="el-icon-document"></i> 统计结果</span>
            <div>
              <el-button type="success" size="mini" @click="goToSalaryPage">
                <i class="el-icon-view"></i> 查看工资统计
              </el-button>
              <el-button type="text" @click="clearResults">
                <i class="el-icon-delete"></i> 清空
              </el-button>
            </div>
          </div>
          <div class="result-list" ref="resultList">
            <div v-if="results.length === 0" class="no-results">
              <i class="el-icon-document-copy"></i>
              <p>暂无统计结果</p>
              <p class="no-results-desc">请选择月份并点击上方按钮进行统计</p>
            </div>
            <div v-for="(result, index) in results" :key="index" :class="['result-item', result.success ? 'success-item' : 'error-item']">
              <div class="result-header">
                <i :class="[result.success ? 'el-icon-success' : 'el-icon-error', 'result-icon']"></i>
                <span class="result-title">{{ result.title }}</span>
                <span class="result-time">{{ result.time }}</span>
              </div>
              <pre class="result-content">{{ formatJson(result.data) }}</pre>
            </div>
          </div>
        </el-card>
      </div>
    </div>
  </div>
</template>

<script>
import {
  saveGoldTriangleStatistics,
  savePersonalPerformanceStatistics,
  saveTechPerformanceStatistics,
  saveStoreConsumePerformanceStatistics,
  saveDepartmentConsumePerformanceStatistics,
  saveStoreTotalPerformanceStatistics,
  saveSalaryStatistics
} from '@/api/extend/salaryCalculation'

export default {
  name: 'SalaryCalculation',
  data() {
    return {
      statisticsMonth: this.getCurrentMonth(),
      loadingStates: {
        goldTriangle: false,
        personalPerformance: false,
        techPerformance: false,
        storeConsumePerformance: false,
        departmentConsumePerformance: false,
        storeTotalPerformance: false,
        salaryStatistics: false
      },
      results: [], // 存储统计结果，最多保留10条
      isCalculating: false, // 一键计算状态
      calculationProgress: [] // 计算进度
    }
  },
  methods: {
    resetMonth() {
      this.statisticsMonth = this.getCurrentMonth()
      this.$message.info('已重置为当前月份')
    },
    getCurrentMonth() {
      const now = new Date()
      const year = now.getFullYear()
      const month = String(now.getMonth() + 1).padStart(2, '0')
      return `${year}${month}`
    },
    clearResults() {
      this.results = []
      this.calculationProgress = []
      this.$message.info('已清空所有统计结果')
    },
    addResult(newResult) {
      this.results.unshift(newResult) // 添加到数组开头
      if (this.results.length > 10) {
        this.results.pop() // 保持最多10条记录
      }
      this.$nextTick(() => {
        this.$refs.resultList.scrollTop = 0 // 滚动到顶部显示最新结果
      })
    },
    formatJson(json) {
      if (typeof json !== 'string') {
        json = JSON.stringify(json, null, 2)
      }
      return json
    },

    // 一键计算工资
    async handleCalculateSalary() {
      if (!this.statisticsMonth) {
        this.$message.error('请先选择统计月份')
        return
      }

      this.isCalculating = true
      this.calculationProgress = []
      this.results = [] // 清空之前的结果

      // 定义统计步骤
      const steps = [
        {
          name: '金三角开卡业绩统计',
          method: 'handleGoldTriangleStatistics',
          type: 'gold-triangle'
        },
        {
          name: '健康师个人开单业绩统计',
          method: 'handlePersonalPerformanceStatistics',
          type: 'personal-performance'
        },
        {
          name: '科技部开单业绩统计',
          method: 'handleTechPerformanceStatistics',
          type: 'tech-performance'
        },
        {
          name: '门店耗卡业绩统计',
          method: 'handleStoreConsumePerformanceStatistics',
          type: 'store-consume-performance'
        },
        {
          name: '个人消耗业绩统计',
          method: 'handleDepartmentConsumePerformanceStatistics',
          type: 'department-consume-performance'
        },
        {
          name: '门店总业绩统计',
          method: 'handleStoreTotalPerformanceStatistics',
          type: 'store-total-performance'
        },
        {
          name: '工资统计',
          method: 'handleSalaryStatistics',
          type: 'salary-statistics'
        }
      ]

      try {
        // 按顺序执行每个统计步骤
        for (let i = 0; i < steps.length; i++) {
          const step = steps[i]
          
          // 更新进度状态
          this.calculationProgress.push({
            name: step.name,
            status: 'running'
          })

          try {
            // 调用对应的统计方法
            await this[step.method]()
            
            // 标记为完成
            this.calculationProgress[i].status = 'completed'
            
            // 等待一秒再执行下一步
            if (i < steps.length - 1) {
              await new Promise(resolve => setTimeout(resolve, 1000))
            }
          } catch (error) {
            // 标记为失败
            this.calculationProgress[i].status = 'failed'
            this.$message.error(`${step.name}失败: ${error.message}`)
            
            // 如果某个步骤失败，询问是否继续
            const continueCalc = await this.$confirm(
              `${step.name}执行失败，是否继续执行后续统计？`,
              '统计失败',
              {
                confirmButtonText: '继续',
                cancelButtonText: '停止',
                type: 'warning'
              }
            ).catch(() => false)
            
            if (!continueCalc) {
              break
            }
          }
        }

        // 检查是否所有步骤都完成
        const completedCount = this.calculationProgress.filter(p => p.status === 'completed').length
        if (completedCount === steps.length) {
          this.$message.success('工资计算完成！所有统计步骤都已成功执行')
        } else {
          this.$message.warning(`工资计算部分完成，成功执行了 ${completedCount}/${steps.length} 个统计步骤`)
        }

      } catch (error) {
        this.$message.error('工资计算过程中发生错误')
      } finally {
        this.isCalculating = false
      }
    },

    // 获取进度图标
    getProgressIcon(status) {
      switch (status) {
        case 'running':
          return 'el-icon-loading'
        case 'completed':
          return 'el-icon-success'
        case 'failed':
          return 'el-icon-error'
        default:
          return 'el-icon-time'
      }
    },

    // 获取进度颜色
    getProgressColor(status) {
      switch (status) {
        case 'running':
          return '#409EFF'
        case 'completed':
          return '#67C23A'
        case 'failed':
          return '#F56C6C'
        default:
          return '#909399'
      }
    },

    // 金三角开卡业绩统计
    async handleGoldTriangleStatistics() {
      this.loadingStates.goldTriangle = true
      try {
        const response = await saveGoldTriangleStatistics(this.statisticsMonth)
        this.addResult({
          type: 'gold-triangle',
          title: '金三角开卡业绩统计',
          success: true,
          data: response.data,
          time: new Date().toLocaleString()
        })
        this.$message.success('金三角开卡业绩统计完成')
      } catch (error) {
        this.addResult({
          type: 'gold-triangle',
          title: '金三角开卡业绩统计',
          success: false,
          data: error.message || '统计失败',
          time: new Date().toLocaleString()
        })
        this.$message.error('金三角开卡业绩统计失败')
        throw error // 重新抛出错误，用于一键计算时的错误处理
      } finally {
        this.loadingStates.goldTriangle = false
      }
    },

    // 健康师个人开单业绩统计
    async handlePersonalPerformanceStatistics() {
      this.loadingStates.personalPerformance = true
      try {
        const response = await savePersonalPerformanceStatistics(this.statisticsMonth)
        this.addResult({
          type: 'personal-performance',
          title: '健康师个人开单业绩统计',
          success: true,
          data: response.data,
          time: new Date().toLocaleString()
        })
        this.$message.success('健康师个人开单业绩统计完成')
      } catch (error) {
        this.addResult({
          type: 'personal-performance',
          title: '健康师个人开单业绩统计',
          success: false,
          data: error.message || '统计失败',
          time: new Date().toLocaleString()
        })
        this.$message.error('健康师个人开单业绩统计失败')
        throw error
      } finally {
        this.loadingStates.personalPerformance = false
      }
    },

    // 科技部开单业绩统计
    async handleTechPerformanceStatistics() {
      this.loadingStates.techPerformance = true
      try {
        const response = await saveTechPerformanceStatistics(this.statisticsMonth)
        this.addResult({
          type: 'tech-performance',
          title: '科技部开单业绩统计',
          success: true,
          data: response.data,
          time: new Date().toLocaleString()
        })
        this.$message.success('科技部开单业绩统计完成')
      } catch (error) {
        this.addResult({
          type: 'tech-performance',
          title: '科技部开单业绩统计',
          success: false,
          data: error.message || '统计失败',
          time: new Date().toLocaleString()
        })
        this.$message.error('科技部开单业绩统计失败')
        throw error
      } finally {
        this.loadingStates.techPerformance = false
      }
    },

    // 门店耗卡业绩统计
    async handleStoreConsumePerformanceStatistics() {
      this.loadingStates.storeConsumePerformance = true
      try {
        const response = await saveStoreConsumePerformanceStatistics(this.statisticsMonth)
        this.addResult({
          type: 'store-consume-performance',
          title: '门店耗卡业绩统计',
          success: true,
          data: response.data,
          time: new Date().toLocaleString()
        })
        this.$message.success('门店耗卡业绩统计完成')
      } catch (error) {
        this.addResult({
          type: 'store-consume-performance',
          title: '门店耗卡业绩统计',
          success: false,
          data: error.message || '统计失败',
          time: new Date().toLocaleString()
        })
        this.$message.error('门店耗卡业绩统计失败')
        throw error
      } finally {
        this.loadingStates.storeConsumePerformance = false
      }
    },

    // 个人消耗业绩统计
    async handleDepartmentConsumePerformanceStatistics() {
      this.loadingStates.departmentConsumePerformance = true
      try {
        const response = await saveDepartmentConsumePerformanceStatistics(this.statisticsMonth)
        this.addResult({
          type: 'department-consume-performance',
          title: '个人消耗业绩统计',
          success: true,
          data: response.data,
          time: new Date().toLocaleString()
        })
        this.$message.success('个人消耗业绩统计完成')
      } catch (error) {
        this.addResult({
          type: 'department-consume-performance',
          title: '个人消耗业绩统计',
          success: false,
          data: error.message || '统计失败',
          time: new Date().toLocaleString()
        })
        this.$message.error('个人消耗业绩统计失败')
        throw error
      } finally {
        this.loadingStates.departmentConsumePerformance = false
      }
    },

    // 门店总业绩统计
    async handleStoreTotalPerformanceStatistics() {
      this.loadingStates.storeTotalPerformance = true
      try {
        const response = await saveStoreTotalPerformanceStatistics(this.statisticsMonth)
        this.addResult({
          type: 'store-total-performance',
          title: '门店总业绩统计',
          success: true,
          data: response.data,
          time: new Date().toLocaleString()
        })
        this.$message.success('门店总业绩统计完成')
      } catch (error) {
        this.addResult({
          type: 'store-total-performance',
          title: '门店总业绩统计',
          success: false,
          data: error.message || '统计失败',
          time: new Date().toLocaleString()
        })
        this.$message.error('门店总业绩统计失败')
        throw error
      } finally {
        this.loadingStates.storeTotalPerformance = false
      }
    },

    // 工资统计
    async handleSalaryStatistics() {
      this.loadingStates.salaryStatistics = true
      try {
        const response = await saveSalaryStatistics(this.statisticsMonth)
        this.addResult({
          type: 'salary-statistics',
          title: '工资统计',
          success: true,
          data: response.data,
          time: new Date().toLocaleString()
        })
        this.$message.success('工资统计完成')
      } catch (error) {
        this.addResult({
          type: 'salary-statistics',
          title: '工资统计',
          success: false,
          data: error.message || '统计失败',
          time: new Date().toLocaleString()
        })
        this.$message.error('工资统计失败')
        throw error
      } finally {
        this.loadingStates.salaryStatistics = false
      }
    },

    // 跳转到工资统计页面
    goToSalaryPage() {
      this.$router.push({
        path: '/salaryStatistics',
        query: {
          month: this.statisticsMonth
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.salary-calculation-container {
  padding: 20px;
  background-color: #f0f2f5;
  min-height: calc(100vh - 50px);
  font-family: 'Arial', sans-serif;

  .box-card {
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

    ::v-deep .el-card__header {
      background-color: #fff;
      border-bottom: 1px solid #ebeef5;
      padding: 18px 20px;
      font-size: 1.1em;
      font-weight: bold;
      color: #303133;
    }

    ::v-deep .el-card__body {
      padding: 20px;
    }
  }

  // 顶部控制区域 - 同一行显示两个卡片
  .top-controls-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;

    .month-selector-card, .calculate-card {
      flex: 1;
      min-width: 0;
    }

    .month-selector-card {
      .month-picker-wrapper {
        display: flex;
        justify-content: flex-start;
        align-items: center;
      }
      .month-picker {
        width: 100%;
        max-width: 200px;
      }
    }

    .calculate-card {
      background: linear-gradient(135deg, #67C23A, #85CE61);
      color: white;

      ::v-deep .el-card__header {
        background: rgba(255, 255, 255, 0.1);
        color: white;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
      }

      .calculate-content {
        text-align: center;

        .calculate-desc {
          color: rgba(255, 255, 255, 0.9);
          margin-bottom: 15px;
          font-size: 0.95em;
          line-height: 1.4;
        }

        .calculate-button {
          width: 100%;
          height: 40px;
          font-size: 1em;
          font-weight: bold;
          border-radius: 6px;
          background: rgba(255, 255, 255, 0.2);
          border: 2px solid rgba(255, 255, 255, 0.3);
          color: white;

          &:hover:not(:disabled) {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
          }

          &:disabled {
            opacity: 0.6;
          }
        }
      }
    }
  }

  // 主要内容区域 - 左右布局
  .main-content {
    display: flex;
    gap: 20px;
    min-height: 600px;

    .left-panel {
      flex: 1;
      min-width: 0; // 防止flex子项溢出
    }

    .right-panel {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
    }
  }


  // 统计操作卡片
  .statistics-card {
    .statistics-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 15px;

      .stat-item {
        background: #fff;
        border-radius: 8px;
        padding: 15px;
        text-align: center;
        transition: all 0.3s ease;
        border: 2px solid transparent;

        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .stat-header {
          margin-bottom: 15px;

          i {
            font-size: 1.5em;
            margin-bottom: 8px;
            display: block;
          }

          span {
            font-weight: bold;
            font-size: 0.9em;
            color: #333;
          }
        }

        .stat-button {
          width: 100%;
          height: 40px;
          font-size: 0.9em;
          border-radius: 6px;
        }

        // 不同主题色
        &.blue-item {
          border-color: #409EFF;
          .stat-header i { color: #409EFF; }
        }

        &.green-item {
          border-color: #67C23A;
          .stat-header i { color: #67C23A; }
        }

        &.orange-item {
          border-color: #E6A23C;
          .stat-header i { color: #E6A23C; }
        }

        &.purple-item {
          border-color: #909399;
          .stat-header i { color: #909399; }
        }

        &.teal-item {
          border-color: #17A2B8;
          .stat-header i { color: #17A2B8; }
        }

        &.red-item {
          border-color: #F56C6C;
          .stat-header i { color: #F56C6C; }
        }

        &.gold-item {
          border-color: #E6A23C;
          .stat-header i { color: #E6A23C; }
        }

        &.placeholder-item {
          border-color: #C0C4CC;
          background: #f5f7fa;
          .stat-header i { color: #C0C4CC; }
        }
      }
    }
  }

  // 进度卡片
  .progress-card {
    margin-bottom: 20px;
    background: linear-gradient(135deg, #E6F7FF, #BAE7FF);
    border: 1px solid #91D5FF;

    .progress-content {
      .progress-step {
        display: flex;
        align-items: center;
        margin-bottom: 12px;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.7);
        border-radius: 6px;
        font-size: 0.95em;

        &:last-child {
          margin-bottom: 0;
        }

        i {
          margin-right: 10px;
          font-size: 1.1em;
        }

        span {
          color: #333;
          font-weight: 500;

          &.completed {
            color: #67C23A;
            font-weight: bold;
          }

          &.failed {
            color: #F56C6C;
            font-weight: bold;
          }
        }
      }
    }
  }

  // 结果显示卡片
  .result-card {
    flex: 1;
    display: flex;
    flex-direction: column;

    ::v-deep .el-card__body {
      flex: 1;
      display: flex;
      flex-direction: column;
      padding: 20px;
    }

    .result-list {
      flex: 1;
      overflow-y: auto;
      padding-right: 10px;

      .no-results {
        text-align: center;
        color: #909399;
        padding: 40px 20px;

        i {
          font-size: 3em;
          margin-bottom: 15px;
          color: #ddd;
        }

        p {
          margin: 5px 0;
          font-size: 1.1em;
        }

        .no-results-desc {
          font-size: 0.9em;
          color: #bbb;
        }
      }

      .result-item {
        border-left: 5px solid;
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 8px;
        background-color: #f9f9f9;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

        &:last-child {
          margin-bottom: 0;
        }

        &.success-item {
          border-color: #67C23A;
        }
        &.error-item {
          border-color: #F56C6C;
        }

        .result-header {
          display: flex;
          align-items: center;
          margin-bottom: 10px;
          font-weight: bold;
          color: #303133;

          .result-icon {
            font-size: 1.2em;
            margin-right: 8px;
            &.el-icon-success {
              color: #67C23A;
            }
            &.el-icon-error {
              color: #F56C6C;
            }
          }

          .result-title {
            font-size: 1.1em;
            flex-grow: 1;
          }

          .result-time {
            font-size: 0.9em;
            color: #909399;
          }
        }

        .result-content {
          background-color: #eee;
          padding: 10px;
          border-radius: 5px;
          white-space: pre-wrap;
          word-break: break-all;
          font-family: 'Consolas', 'Monaco', monospace;
          font-size: 0.9em;
          color: #333;
        }
      }
    }
  }
}

// 响应式调整
@media (max-width: 1200px) {
  .main-content {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .salary-calculation-container {
    padding: 10px;
  }
  
  .top-controls-row {
    flex-direction: column;
    gap: 15px;
  }

  .month-selector-card, .calculate-card {
    width: 100%;
  }
  
  .statistics-grid {
    grid-template-columns: 1fr !important;
  }
  
  .calculate-button {
    height: 50px !important;
    font-size: 1.1em !important;
  }
}
</style>