.role-management-container {
  padding: 12px 20px;
  background-color: #fafafa;
  min-height: 100vh;

  // Header Section
  .role-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom:20px;

    .header-content {
      .header-title {
        font-size: 36px;
        font-weight: 700;
        color: #1A1A1ADE;
        margin: 0 0 6px 0;
        line-height: 1.2;
        letter-spacing: -0.5px;
      }

      .header-subtitle {
        font-size: 15px;
        color: #6b7280;
        margin: 0;
        font-weight: 400;
      }
    }

    .btn-create-role {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 11px 20px;
      background-color:var(--action-primary-default);
      color: #ffffff;
      border: none;
      border-radius: 6px;
      font-size: 16px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: 0 1px 2px rgba(37, 99, 235, 0.15);

      &:hover {
        box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
        transform: translateY(-1px);
      }

      &:active {
        transform: translateY(0);
      }

      .btn-icon {
        font-size: 20px;
        font-weight: 400;
        line-height: 1;
      }
    }
  }

  // Roles Count
  .roles-count {
    font-size: 16px;
    color: #1A1A1ADE;
    margin-bottom: 20px;
    font-weight: 400;
  }

  // Table Wrapper
  .roles-table-wrapper {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);

    .roles-table {
      width: 100%;
      border-collapse: collapse;
      background-color: #ffffff;

      thead {
        background-color: #fafafa;

        tr {
          th {
            padding: 12px 18px;
            font-family: Helvetica !important;
            font-weight: 700;
            font-style: Bold;
            font-size: 14px;
            text-align: left;
            line-height: 150%;
            letter-spacing: 0%;
            color: #1A1A1ADE;

            
          }
        }
      }

      tbody {
        .table-row {
          border-bottom: 1px solid #f0f0f0;
          transition: background-color 0.12s ease;

          &:hover {
            background-color: #fafafa;
          }

          &:last-child {
            border-bottom: none;
          }

          td {
            padding: 12px 18px;
            font-family: Helvetica !important;
            font-weight: 400;
            font-style: Regular;
            font-size: 14px;
            line-height: 150%;
            letter-spacing: 0%;
            color: #1A1A1ADE;
            vertical-align: middle;
          }


          .modules-cell,
          .users-cell {
            .badge {
              display: inline-flex;
              align-items: center;
              justify-content: center;
              gap: 6px;
              padding: 5px 12px;
              border-radius: 6px;
              font-size: 13px;
              font-weight: 600;
              min-width: 50px;

              mat-icon.badge-icon {
                font-size: 16px;
                width: 16px;
                height: 16px;
                line-height: 1;
                display: inline-flex;
                align-items: center;
                justify-content: center;
              }

              .badge-icon {
                font-size: 14px;
                line-height: 1;
              }

              &.badge-blue {
                background-color: #dbeafe;
                color: #1e40af;
              }

              &.badge-green {
                background-color: #d1fae5;
                color: #065f46;
              }
            }
          }

          .actions-cell {
            text-align: center;

            .btn-action {
              display: inline-flex;
              align-items: center;
              justify-content: center;
              width: 32px;
              height: 32px;
              background-color: transparent;
              border: 1px solid #e0e0e0;
              border-radius: 6px;
              cursor: pointer;
              transition: all 0.15s ease;
              padding: 0;

              &:hover {
                background-color: #f5f5f5;
                border-color: #d0d0d0;
              }

              &:active {
                background-color: #ebebeb;
              }

              .edit-icon {
                font-size: 16px;
                color: #6b7280;
              }
            }
          }
        }
      }
    }
  }
}



// Responsive Design
@media (max-width: 1200px) {
  .role-management-container {
    padding: 24px 32px;
  }
}

@media (max-width: 1024px) {
  .role-management-container {
    padding: 24px;

    .role-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 20px;

      .btn-create-role {
        width: 100%;
        justify-content: center;
      }
    }

    .roles-table-wrapper {
      overflow-x: auto;

      .roles-table {
        min-width: 900px;
      }
    }
  }
}

@media (max-width: 768px) {
  .role-management-container {
    padding: 20px 16px;

    .role-header {
      margin-bottom: 32px;

      .header-content {
        .header-title {
          font-size: 28px;
        }

        .header-subtitle {
          font-size: 14px;
        }
      }
    }

    .roles-table-wrapper {
      border-radius: 8px;

      .roles-table {
        thead tr th {
          padding: 16px 16px;
          font-size: 11px;
        }

        tbody .table-row td {
          padding: 18px 16px;
          font-size: 13px;
        }
      }
    }
  }

  .btn-back-to-list {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .role-management-container {
    padding: 16px;

    .role-header {
      .header-content {
        .header-title {
          font-size: 24px;
        }
      }
    }
  }
}

@media (max-width: 1024px) {
  .role-management-container {
    padding: 20px 16px;

    .role-header {
      flex-direction: column;
      align-items: stretch;
      gap: 16px;

      .header-content .header-title {
        font-size: 28px;
      }

      .btn-create-role {
        width: 100%;
        justify-content: center;
      }
    }

    .roles-table-wrapper {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;

      .roles-table {
        min-width: 680px;
      }
    }
  }
}

@media (max-width: 768px) {
  .role-management-container {
    padding: 16px 12px;

    .role-header {
      margin-bottom: 14px;

      .header-content {
        .header-title  { font-size: 22px; }
        .header-subtitle { font-size: 13px; }
      }
    }

    .roles-count {
      font-size: 13px;
      margin-bottom: 12px;
    }

    .roles-table-wrapper {
      border-radius: 8px;

      .roles-table {
        min-width: 580px;

        thead tr th {
          padding: 10px 12px;
          font-size: 12px;
        }

        tbody .table-row td {
          padding: 10px 12px;
          font-size: 13px;
        }

        .modules-cell .badge,
        .users-cell .badge {
          padding: 4px 8px;
          font-size: 12px;
          min-width: 40px;

          ::ng-deep mat-icon.badge-icon {
            font-size: 14px;
            width: 14px;
            height: 14px;
          }
        }
      }
    }
  }
}

@media (max-width: 480px) {
  .role-management-container {
    padding: 12px 10px;

    .role-header .header-content {
      .header-title    { font-size: 18px; }
      .header-subtitle { font-size: 12px; }
    }

    .btn-create-role {
      font-size: 14px;
      padding: 9px 14px;
    }

    .roles-table-wrapper .roles-table {
      min-width: 500px;

      thead tr th,
      tbody .table-row td {
        padding: 8px 10px;
        font-size: 12px;
      }
    }
  }

  .FormOverView {
    div[style*="display: flex"] {
      flex-direction: column !important;

      .adjacentField {
        width: 100% !important;
      }
    }
  }
}