/* Global UI Optimization */
:root {
  --el-color-primary: #003F88;
  --el-color-primary-light-3: #4d79ac;
  --el-color-primary-light-5: #809fcb;
  --el-color-primary-light-7: #b3c5e0;
  --el-color-primary-light-8: #cce0f0;
  --el-color-primary-light-9: #e6efff;
  --el-color-primary-dark-2: #00326d;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Global Icon Optimization */
.vab-icon {
  display: inline-block;
  font-size: 16px; /* Default size */
  vertical-align: middle;
  color: inherit;
  transition: all 0.3s;
}

/* Icons in Buttons */
.el-button {
  .vab-icon {
    font-size: 16px;
    margin-right: 6px;
    
    /* Adjust for small buttons */
    .el-button--small & {
      font-size: 14px;
      margin-right: 4px;
    }
    
    /* Adjust for large buttons */
    .el-button--large & {
      font-size: 18px;
      margin-right: 8px;
    }
  }
}

/* Icons in Inputs */
.el-input__prefix, .el-input__suffix {
  .vab-icon {
    font-size: 16px;
    color: #909399;
  }
}

/* Icons in Card Headers */
.el-card__header, .vab-card__header {
  .vab-icon {
    font-size: 20px;
    color: var(--el-color-primary);
    margin-right: 8px;
    vertical-align: sub;
  }
}

/* Card Modernization */
.el-card, .vab-card {
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: #fff;

  &:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
  }
  
  .el-card__header {
    border-bottom: 1px solid #f0f2f5;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
    color: #303133;
    display: flex;
    align-items: center; /* Ensure header content is centered vertically */
  }
}

/* Button Modernization */
.el-button {
  border-radius: 6px !important;
  font-weight: 500;
  transition: all 0.2s;
  
  &--primary {
    box-shadow: 0 2px 6px rgba(0, 63, 136, 0.2);
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 63, 136, 0.3);
    }
  }
}

/* Input Modernization */
.el-input__wrapper {
  border-radius: 6px !important;
  box-shadow: 0 0 0 1px #dcdfe6 inset !important;
  transition: all 0.2s;

  &:hover {
    box-shadow: 0 0 0 1px #c0c4cc inset !important;
  }
  
  &.is-focus {
    box-shadow: 0 0 0 1px var(--el-color-primary) inset !important;
  }
}

/* Table Modernization */
.el-table {
  border-radius: 8px;
  overflow: hidden;
  --el-table-header-bg-color: #f5f7fa;
  
  th.el-table__cell {
    background-color: #f5f7fa !important;
    color: #303133;
    font-weight: 600;
    height: 50px;
  }
  
  .el-table__row {
    transition: background-color 0.2s;
  }
}

/* Dialog Modernization */
.el-dialog {
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
  
  .el-dialog__header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f2f5;
    margin-right: 0;
    
    .el-dialog__title {
      font-weight: 600;
      font-size: 18px;
    }
  }
  
  .el-dialog__body {
    padding: 24px;
  }
  
  .el-dialog__footer {
    padding: 16px 24px;
    background-color: #f9fafc;
    border-top: 1px solid #f0f2f5;
  }
}

/* Tag Modernization */
.el-tag {
  border-radius: 4px;
  border: none;
  font-weight: 500;
  padding: 0 10px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: #c0c4cc;
  border-radius: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* Full Height Layout for Tables */
div[class$="-container"] {
  // height: calc(100vh - 120px) !important; /* Force full height relative to viewport minus header */
  display: flex;
  flex-direction: column;
  // padding: 0 !important; /* Let children handle padding or spacing if needed, but vab-card has margins usually */
  
  > .vab-card, 
  > .el-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important; /* Remove bottom margin to prevent scroll */
    height: 100%;
    
    > .el-card__body {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      height: 100%;
      padding: 20px;
      
      /* Query Form Fixed Height */
      .vab-query-form {
        flex-shrink: 0;
        margin-bottom: 15px;
      }
      
      /* Table Takes Remaining Space */
      .el-table {
        flex: 1;
        // height: 0 !important; /* Critical for flex resizing */
        width: 100%;
      }
      
      /* Pagination Fixed Height */
      .vab-pagination {
        flex-shrink: 0;
        margin-top: 15px;
        display: flex;
        justify-content: flex-end;
      }
    }
  }
}
