.advance-transfer-container {
  padding: 20px;
  font-family: Helvetica;
  background-color: #f5f7fa;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  .header {
    text-align: center;
    margin-bottom: 30px;

    h2 {
      color: #6b1f7b;
      font-size: 28px;
      font-weight: 600;
      margin-bottom: 10px;
      font-family: 'Times New Roman', Times, serif;
    }

    .subtitle {
      color: #7f8c8d;
      font-size: 14px;
      margin: 0;
    }
  }
// Add these styles to your existing SCSS file

.sortable-header {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 28px !important;
  transition: background-color 0.2s ease;

  &:hover {
    background-color: rgba(0, 0, 0, 0.03);
  }

  span {
    display: inline-block;
  }

  .sort-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke-width: 2;
    opacity: 0.3;
    transition: all 0.2s ease;

    &.active {
      opacity: 1;
      color: #834DD0;
    }

    &.asc {
      transform: translateY(-50%) rotate(180deg);
      color: #834DD0;
    }

    &.desc {
      transform: translateY(-50%) rotate(0deg);
      color: #834DD0;
    }
  }

  &:active {
    background-color: rgba(0, 0, 0, 0.05);
  }
}
  // Success Message
  .success-message {
    background: linear-gradient(135deg, #834DD0 0%, #834DD0 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;

    .success-icon {
      width: 24px;
      height: 24px;
      stroke-width: 2.5;
    }
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  // Loading Spinner
  .loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;

    .spinner {
      border: 4px solid #f3f3f3;
      border-top: 4px solid #834DD0;
      border-radius: 50%;
      width: 50px;
      height: 50px;
      animation: spin 1s linear infinite;
    }

    p {
      margin-top: 15px;
      color: #7f8c8d;
      font-size: 16px;
    }
  }

  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  // Action Bar with Summary
  .action-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-shrink: 0;

    .left-section {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .selected-info {
      color: #34495e;
      font-size: 14px;

      .selected-count {
        margin-right: 10px;
      }

      .selected-amount {
        color: #7f8c8d;
      }

      strong {
        color: #834DD0;
        font-weight: 600;
      }
    }

    .summary-cards {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;

      .summary-card {
        background-color: #FFFFFF;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        padding: 8px 14px;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 90px;
        transition: all 0.2s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

        &:hover {
          box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        }

        .summary-label {
          font-size: 10px;
          color: #834DD0;
          font-weight: 500;
          text-transform: uppercase;
          letter-spacing: 0.3px;
          margin-bottom: 3px;
        }

        .summary-value {
          font-size: 14px;
          font-weight: 600;
          color: #424242;
          margin-left: 4px;
        }

        &.pending,
        &.completed,
        &.outstanding {
          border-color: #e0e0e0;
          background-color: #FFFFFF;

          .summary-value {
            color: #424242;
          }
        }
      }
    }

    .transfer-btn {
      background: #834DD0;
      color: white;
      width:120px;
      height:40px;
      border: none;
      padding: 12px 24px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 2px;
      

      .btn-icon {
        width: 18px;
        height: 18px;
        stroke-width: 2.5;
      }

      &:hover:not(.disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(131, 77, 208, 0.4);
      }

      &:active:not(.disabled) {
        transform: translateY(0);
      }

      &.disabled {
        background: #95a5a6;
        cursor: not-allowed;
        box-shadow: none;
        opacity: 0.6;
      }
    }
  }

  // Table Container - Now fills remaining space
 .table-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 280px); // Adjust based on header + action bar height

    .advance-transfer-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 14px;
      display: flex;
      flex-direction: column;
      height: 100%;

      thead {
  background: #E6DBF9;
  color: rgba(26, 26, 26, 0.87);
  flex-shrink: 0;

  tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }

  tr th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    // REMOVE THIS LINE: text-transform: uppercase;
    letter-spacing: 0px;
    border-right: 2px solid #ddbef8;
    border-left: 1px solid #ddbef8;
    background-color:#EBD4FF;
    font-family: Helvetica;

    &:first-child {
      border-left: 2px solid #ddbef8;
    }

    &:last-child {
      border-right: 2px solid #ddbef8;
    }

    &.checkbox-column {
      width: 60px;
      text-align: center;

      .checkbox-label {
        display: none;
      }
      
      // ADD THIS: Make header checkbox same size as row checkboxes
      .checkbox-input {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: #834DD0;
      }
    }

    &.text-right {
      text-align: right;
    }

    &.text-center {
      text-align: center;
    }
  }
}

      tbody {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: block;

  tr {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-bottom: 1px solid #e8ecef;
    transition: all 0.2s ease;
          &.even-row {
            background-color: #FFFFFF;
          }

          &.odd-row {
            background-color: #F3EDFA;
          }

          &:hover:not(.transferred-row) {
            background-color: #D9C8F0 !important;
          }

          &.selected-row {
            background-color: #e3f2fd;
          }

          &.transferred-row {
            background-color: #f5f5f5;
            opacity: 0.7;

            td {
              color: #95a5a6;
            }
          }

           td {
      padding: 12px;
      color: rgba(26, 26, 26, 0.87);

      &.checkbox-column {
        text-align: center;
        width: 60px;
        accent-color: #834DD0;
      }

      .checkbox-input {
        width: 18px;  // Changed from 70px
        height: 18px;
        cursor: pointer;
        accent-color: #834DD0;

        &:disabled {
          cursor: not-allowed;
        }
      }

            &.code-cell {
              font-family: 'Courier New', monospace;
              font-weight: 500;
              font-size: 13px;
              color: rgba(26, 26, 26, 0.87); // Changed to black

              &.old-code {
                color: rgba(26, 26, 26, 0.87); // Removed red color
              }

              &.new-code {
                color: rgba(26, 26, 26, 0.87); // Removed green color
              }
            }

            &.name-cell {
              font-weight: 500;
              color: #34495e;
            }

            &.amount-cell {
              font-weight: 600;
              color: #834DD0;

              &.text-right {
                text-align: right;
                padding-right: 15px;
              }
            }

            &.status-cell {
              &.text-center {
                text-align: center;
              }

              .status-badge {
                display: inline-block;
                padding: 4px 12px;
                border-radius: 12px;
                font-size: 12px;
                font-weight: 600;
                background-color: #ffeaa7;
                color: #d63031;

                &.status-transferred {
                  background-color: #55efc4;
                  color: #00b894;
                }
              }
            }

            &.text-right {
              text-align: right;
            }

            &.text-center {
              text-align: center;
            }
          }
        }
      }

      tfoot {
        background-color: #F3EDFA;
        border-top: 2px solid #ddbef8;
        flex-shrink: 0;

        tr {
          display: table;
          width: 100%;
          table-layout: fixed;
        }

        tr.total-row {
          font-weight: 700;

          td {
            padding: 15px 12px;

            &.total-label {
              text-align: right;
              color: rgba(26, 26, 26, 0.87);
              font-size: 15px;
              text-transform: uppercase;
              letter-spacing: 0.5px;
            }

            &.total-amount {
              font-size: 16px;
              color: #834DD0;
              font-weight: 700;

              &.text-right {
                text-align: right;
                padding-right: 15px;
              }
            }
          }
        }
      }
    }
  }
}

// Text alignment utility classes
.text-right {
  text-align: right !important;
}

.text-left {
  text-align: left !important;
}

.text-center {
  text-align: center !important;
}

// Custom scrollbar styling for tbody
.advance-transfer-table tbody::-webkit-scrollbar {
  width: 10px;
}

.advance-transfer-table tbody::-webkit-scrollbar-track {
  background: #F3EDFA;
  border-radius: 5px;
}

.advance-transfer-table tbody::-webkit-scrollbar-thumb {
  background: #834DD0;
  border-radius: 5px;
  border: 2px solid #F3EDFA;
}

.advance-transfer-table tbody::-webkit-scrollbar-thumb:hover {
  background: #6b1f7b;
}

// For Firefox
.advance-transfer-table tbody {
  scrollbar-width: thin;
  scrollbar-color: #834DD0 #F3EDFA;
}

// Responsive Design
@media screen and (max-width: 1024px) {
  .advance-transfer-container {
    .action-bar {
      flex-direction: column;

      .left-section {
        width: 100%;
      }

      .transfer-btn {
        align-self: flex-end;
      }

      .summary-cards {
        .summary-card {
          min-width: calc(25% - 9px);
        }
      }
    }
  }
}

@media screen and (max-width: 768px) {
  .advance-transfer-container {
    padding: 10px;
    height: 100vh;

    .header h2 {
      font-size: 22px;
    }

    .action-bar {
      flex-direction: column;
      gap: 15px;
      align-items: stretch;

      .summary-cards {
        .summary-card {
          min-width: calc(50% - 6px);
        }
      }

      .transfer-btn {
        justify-content: center;
        align-self: stretch;
      }
    }

    .table-container {
      .advance-transfer-table {
        font-size: 12px;

        thead tr th {
          padding: 10px 8px;
          font-size: 11px;

          &.checkbox-column .checkbox-label {
            display: none;
          }
        }

        tbody tr td {
          padding: 10px 8px;
        }
      }
    }
  }
}
